Class Widget<PROPERTIES, CALLBACKS>Abstract

Type Parameters

Hierarchy (view full)

Constructors

  • Type Parameters

    Parameters

    • id: string

      unique identifier of the widget used for injecting HTML nodes

    • container: HTMLElement

      parent HTML element where the widget will be injected

    • Optional target: string

      URL of the environment from which the widget's JS bundle will be fetched. Use this, for example, when testing features that are only released to the sandbox environment. By default, https://widget-library-finapi-general-live.finapi.io is used.

    • Optional ownerDocument: Document

      parent Document where the widget will be injected. For example, shadow root or document fragment. By default, the default top-level document is used.

    • Optional customBundleFileName: string

      allows modifying the filename of the widget's JS bundle that will be fetched. By default, bundle filenames are determined from the supplied id. This property is useful during dev mode when widgets are generated together into one main.js file.

    • Optional internalProps: Record<string, unknown>

      internal properties that will be passed to the widget.

    Returns Widget<PROPERTIES, CALLBACKS>

Properties

container: HTMLElement
internalProps?: Record<string, unknown>
ownerDocument: Document
scriptId: string
source: string
webComponentId: string

Methods

  • Returns HTMLScriptElement

  • Parameters

    Returns WebComponent

  • Parameters

    • widgetId: string
    • Optional target: string
    • Optional customBundleFileName: string

    Returns string

  • Loads the web component into the container element.

    Parameters

    • Optional properties: PROPERTIES

      Optional properties to be passed to the web component.

    • Optional callbacks: CALLBACKS

      Optional callbacks to be passed to the web component.

    Returns void

  • Removes the web component from the DOM.

    Returns void

Generated using TypeDoc