Type alias EventHandlers

EventHandlers: {
    onBack?: ((view) => void);
    onError?: ((type, view) => void);
    onNavigateTo?: ((page, view) => void);
    onResize?: ((height, view) => void);
    onStatusChange?: ((status, view) => void);
    onTitleChange?: ((title, view) => void);
    [key: string]: ((payload, view) => void) | undefined;
}

Type declaration

  • [key: string]: ((payload, view) => void) | undefined
  • Optional onBack?: ((view) => void)
      • (view): void
      • Called whenever a view attempts to close itself.

        Parameters

        Returns void

  • Optional onError?: ((type, view) => void)
      • (type, view): void
      • Called whenever an error occurs. Should handle 2 cases:

        • load: The iframe failed to load the page, or the page failed to communicate in a timely manner.
        • internal: An error occured inside the embedded application. A built-in error screen is shown, it is not necessary for the host application to show an error.

        Parameters

        Returns void

  • Optional onNavigateTo?: ((page, view) => void)
      • (page, view): void
      • Called whenever the view attempts to navigate to another page.

        Parameters

        Returns void

  • Optional onResize?: ((height, view) => void)
      • (height, view): void
      • Called whenever the content of the iframe resizes. Is only enabled when enableResize is set to true.

        Parameters

        Returns void

  • Optional onStatusChange?: ((status, view) => void)
      • (status, view): void
      • Called whenever the status of the view changes.

        Can be used to implement a custom loading-screen by hiding the loading-screen and showing the view on a change to running or errored.

        Can be used to implement a custom error-screen by hiding the view and showing an error page on a change to errored.

        Parameters

        Returns void

  • Optional onTitleChange?: ((title, view) => void)
      • (title, view): void
      • Called whenever the view changes title.

        If a host-application controlled title-bar is used, this text should be shown there.

        Parameters

        Returns void

Generated using TypeDoc