import { EditorAPI, EditorResponse } from '../types/CommonTypes'; import { Component, ComponentConnectorCapabilities, ComponentPreviewType } from '../types/ComponentConnectorTypes'; import { ConnectorConfigOptions, MetaData, QueryOptions, QueryPage } from '../types/ConnectorTypes'; /** * @experimental This controller is still experimental and might change in future releases. * * The ComponentConnectorController is responsible for all communication regarding Component connectors. * Methods inside this controller can be called by `window.SDK.componentConnector.{method-name}` * * The way GraFx Studio handles different sources of Component is called 'ComponentConnector'. * A ComponentConnector is an implementation of a set of capabilities we need * to interact with a certain Component Asset 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 Component connector * both on web using webassembly and on the server side during output generation. * This controller is an interface to the running connector instance inside the studio engine. */ export declare class ComponentConnectorController { #private; /** * @ignore */ constructor(editorAPI: EditorAPI); /** * @experimental This method is still experimental and might change in future releases. * Query a specific ComponentConnector for data using both standardized queryOptions and the dynamic * context as parameters. * @param connectorId unique id of the Component connector * @param queryOptions query options * @param context context that will be available in the connector script. * @returns array of component instances */ query: (connectorId: string, queryOptions: QueryOptions, context?: MetaData) => Promise>>; /** * @experimental This method is still experimental and might change in future releases. * The combination of a `connectorId` and `componentId` is typically enough for a Component connector to * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the * Component connector instance running in the editor engine. * @param connectorId unique id of the Component connector * @param componentId unique id of the Component to download * @param previewType hint to the Component connector about desired format of the Component preview * @param context dynamic map of additional options potentially used by the connector * @returns */ preview: (connectorId: string, componentId: string, previewType: ComponentPreviewType, context?: MetaData) => Promise; /** * @experimental This method is still experimental and might change in future releases. * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This * method allows you to discover which mappings are available for a given connector. If you want to use any of these * mappings, they will be available in the `context` parameter of any connector method. * @param connectorId unique id of the component connector * @returns connector mappings */ getConfigurationOptions: (connectorId: string) => Promise>; /** * @experimental This method is still experimental and might change in future releases. * This method returns what capabilities the selected connector has. It gives an indication what methods can * be used successfully for a certain connector. * @param connectorId unique id of the component connector * @returns ComponentConnectorCapabilities */ getCapabilities: (connectorId: string) => Promise>; }