Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PluginAdapter

The main service class to be used by a plug-in to establish a safe and secure communication to the COYO front end bridge. It acts as a unified interaction interface to all other plug-in handlers.

Hierarchy

  • PluginAdapter

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates a new instance of this class.

    Parameters

    • Optional srcId: undefined | string

      the plug-in source ID to use for requests

    Returns PluginAdapter

    the new instance

Properties

Readonly srcId

srcId: string

Methods

init

  • Sends an initialization message to the parent window (i.e. COYO) and retrieves the response.

    Parameters

    • Default value timeout: number = 60000

      a maximum time to wait for the response

    Returns Promise<JwtClaims>

    a promise holding the decoded and validated JWT claims

observeHeight

  • observeHeight(selectors?: string): () => void
  • Starts to observe the HTML element that matches the given selectors and sends throttled update messages to COYO.

    Parameters

    • Default value selectors: string = "html"

      the selectors to target the HTML element

    Returns () => void

    a disconnect handler to stop observing the HTML element

      • (): void
      • Returns void

onEdit

  • onEdit(cb: (edit: true, action: "enter" | "save" | "cancel") => void): () => void
  • Connects the given callback listener to edit mode events coming from COYO.

    Parameters

    • cb: (edit: true, action: "enter" | "save" | "cancel") => void

      a callback to be executed when a new edit mode message comes in

        • (edit: true, action: "enter" | "save" | "cancel"): void
        • Parameters

          • edit: true
          • action: "enter" | "save" | "cancel"

          Returns void

    Returns () => void

    a disconnect handler to stop listening to events

      • (): void
      • Returns void

Generated using TypeDoc