Options
All
  • Public
  • Public/Protected
  • All
Menu

Callbacks used by the plugin

Hierarchy

  • CallbacksInterface

Index

Methods

  • init(pluginsStates: any): unknown
  • The callback to be run when the instance is initializing.

    This callback function will be passed 1 argument, which is an Object that contains the state(s) of the instance's required plugin(s) with their names as their respective keys. The return value of the callback will be stored by the loader as the 'state' of the plugin. This state will be passed to any other plugins that has the plugin's name as a requirement.

    Parameters

    • pluginsStates: any

      The state(s) of the instance's required plugin(s).

    Returns unknown

    The plugin's state.

  • error(event: string, error: Error): null | Error | Promise<Error> | Promise<null>
  • The callback to be run when the instance encounters an uncaught error when running any of the other callbacks.

    event is the event type of the callback that throws the error. error is the error instance. This callback function should either return an Error instance that will be thrown by the loader, or null to ignore the error entirely and let the whole program continue.

    Parameters

    • event: string

      The event type of the callback.

    • error: Error

      The error instance that was thrown.

    Returns null | Error | Promise<Error> | Promise<null>

    An error instance, or null to ignore the error.

  • shutdown(state: any): void | Promise<void>
  • The callback to be run when the instance is shutting down.

    state is the state of the plugin that is shutting down. This callback does not need to return a value.

    Parameters

    • state: any

      The state of the plugin.

    Returns void | Promise<void>

Generated using TypeDoc