Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface UiAPI

Hierarchy

  • UiAPI

Index

Properties

get

get: function

Returns a registered component The component may not be fully ready.

Type declaration

    • (code: string): any
    • Parameters

      • code: string

      Returns any

has

has: function

Returns whether a component exists for the specified code

Type declaration

    • (code: string): boolean
    • Parameters

      • code: string

      Returns boolean

hide

hide: function

Hide a UI component once it is ready. For bundled components, this requires them to have been configured in batchSDK.setup()

Type declaration

    • (componentCode: string): Promise<void>
    • Parameters

      • componentCode: string

      Returns Promise<void>

register

register: function

Register a new component for the specified code.

param

Unique code for your UI component.

param

Init method of your component: Batch will call you back on it.

Type declaration

    • (code: string, init: function): void
    • Parameters

      • code: string
      • init: function
          • (api: PublicAPI, config: any, onDrawnCallback: function): any
          • Parameters

            • api: PublicAPI
            • config: any
            • onDrawnCallback: function
                • (component: any): void
                • Parameters

                  • component: any

                  Returns void

            Returns any

      Returns void

registerAfter

registerAfter: function

Register a new component for the specified code, after waiting for other components to have been registered

param

Components to wait for before calling this one's init method.

param

Unique code for your UI component.

param

Init method of your component: Batch will call you back on it.

Type declaration

    • (dependencies: string[], code: string, init: function): void
    • Parameters

      • dependencies: string[]
      • code: string
      • init: function
          • (api: any, config: any, onDrawnCallback: function): any
          • Parameters

            • api: any
            • config: any
            • onDrawnCallback: function
                • (component: any): void
                • Parameters

                  • component: any

                  Returns void

            Returns any

      Returns void

show

show: function

Show a UI component once it is ready. For bundled components, this requires them to have been configured in batchSDK.setup()

Some components will refuse to show even when calling this method because it might not make sense. For example, the banner will not honor the request if it has been dismissed recently (unless configured otherwise) or if the user is already subscribed to notifications.

You can try to set the force parameter to true, asking it to display itself no matter what.

If you call this method, you probably want to set "autoShow": false in your UI component configuration

Type declaration

    • (componentCode: string, force: boolean): Promise<void>
    • Parameters

      • componentCode: string
      • force: boolean

      Returns Promise<void>

waitUntilDrawn

waitUntilDrawn: function

Returns a promise that is resolved when the specified UI component has been drawn, returning the wrapped component.

Type declaration

    • (componentCode: string): Promise<any>
    • Parameters

      • componentCode: string

      Returns Promise<any>

Generated using TypeDoc