pCon.basket - Plugin Development
    Preparing search index...

    Interface UserInputHandler

    Plugin which is used to handle/adjust user inputs.

    • Plugin category = UserInputHandler
    interface UserInputHandler {
        isAvailable?: boolean;
        name: string;
        handleQuantity?(
            pItems: BasketItem[],
            pNewQuantity: number,
        ): Promise<number | null>;
        initialize(
            pDescriptor: PluginDescriptor,
            pSettings: unknown,
        ): Promise<void>;
    }

    Hierarchy (View Summary)

    Index
    isAvailable?: boolean

    Optional, if false this plugin will not be used.

    name: string
    • Will be called if the user changes the quantity of one or more items. Can be used to adjust the entered quantity before it is applied.

      Parameters

      • pItems: BasketItem[]

        The currently selected items. If a sub article is selected the array will contain the main article instead.

      • pNewQuantity: number

        The quantity entered by the user.

      Returns Promise<number | null>

      The adjusted quantity. If null is returned the current item quantity will not be changed.

    • Will be called once after the plugin was loaded.

      Parameters

      • pDescriptor: PluginDescriptor

        Plugin descriptor for this plugin.

      • pSettings: unknown

        Optional plugin specific settings which may be defined as part of the application settings.

      Returns Promise<void>