The ConnectorController manages lifetime of all available connectors, regardless of the type, in the document. Use it to add/remove connectors to a template, or set specific configuration.

The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an implementation of a set of capabilities we need to interact with a certain external resource management system. In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to execute the media connector both on web using webassembly and on the server side during e.g. animation output generation. This controller is an interface to the running connector instance inside the studio engine. The engine will automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered manually.

Hierarchy

  • ConnectorController

Methods

  • Configures a registered connector. A configurator helper is passed as an argument of the callback for you to setup your connector.

    Returns

    Parameters

    • id: string

      the id of your registered connector

    • configurationCallback: ((configurator: ConnectorConfigurator) => Promise<void>)

      callback to setup the connector

        • (configurator: ConnectorConfigurator): Promise<void>
        • Parameters

          • configurator: ConnectorConfigurator

          Returns Promise<void>

    Returns Promise<EditorResponse<null>>

  • Registers a new connector in the SDK. After successful registration, depending on the connector type, the connector can be configured and used in the template Remember to add custom authentication information after registering the connector

    Returns

    the Id of the newly created connector, this Id should be used going forward.

    Parameters

    Returns Promise<EditorResponse<string>>

  • Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially useful during startup of the SDK / right after the loadDocument call.

    Returns

    Parameters

    • id: string

      the id of your registered connector you want to make sure it is loaded

    • timeoutMilliseconds: number = 2000

    Returns Promise<EditorResponse<null>>

Generated using TypeDoc