Options
All
  • Public
  • Public/Protected
  • All
Menu

@coyoapp/plugin-adapter

Index

Functions

addError

  • addError(message: string): void
  • Displays an error message above the plug-in.

    Parameters

    • message: string

      the message to display

    Returns void

addOverlay

  • addOverlay(): void
  • Adds an overlay over the plug-in.

    Returns void

create

  • create(html: string): Node | null
  • Creates a new HTML fragment from an HTML string.

    Parameters

    • html: string

      the HTML code to be parsed

    Returns Node | null

    an HTML node or null if the code is invalid

destroy

  • destroy(id: string): void
  • Removes the HTML element with the given ID from the DOM.

    Parameters

    • id: string

      the ID of the element to be removed

    Returns void

getMessage

  • getMessage<T>(reason: T): string
  • Builds an error message from the given error.

    Type parameters

    • T

    Parameters

    • reason: T

      the error reason to be converted into a readable message

    Returns string

    a readable message

showError

  • showError<T>(reason: T): Promise<T>
  • Promise handler to show an error and reject the promise.

    Type parameters

    • T

    Parameters

    • reason: T

      the promise rejection error

    Returns Promise<T>

    a rejected promise

showErrorAndRecover

  • showErrorAndRecover<T, R>(reason: T, recoverWith: R): Promise<R>
  • Promise handler to show an error and resolve the promise with a recover value.

    Type parameters

    • T

    • R

    Parameters

    • reason: T

      the promise rejection error

    • recoverWith: R

      the recover value

    Returns Promise<R>

    a resolved promise

Generated using TypeDoc