import { EditorAPI, Id } from '../../types/CommonTypes'; import { ListVariableItem, Variable } from '../../types/VariableTypes'; import { Dictionary } from '../../../../connector-types/src'; import { ConnectorGrafxRegistration, ConnectorLocalRegistration, ConnectorUrlRegistration } from '../types/ConnectorTypes'; export declare class VariableController { #private; image: ImageVariableController; dataSource: DataSourceVariableController; /** * @ignore */ constructor(editorAPI: EditorAPI); /** * This method returns the list of variables * @returns */ getAll: () => Promise>; /** * This method returns a variable by id * @param id the id of a specific variable * @returns */ getById: (id: string) => Promise>; /** * This method returns a variable by name * @param name the name of a specific variable * @returns */ getByName: (name: string) => Promise>; /** * This method sets the items of the list variable * * The items need to be unique and are not case sensitive. * * @param id the id of the list variable * @param items the items of the list * @returns */ setListVariable: (id: Id, items: ListVariableItem[]) => Promise>; } export declare class ImageVariableController { #private; constructor(editorAPI: EditorAPI); /** * This method sets the allow query for an image variable * @param id the id of the variable * @param allowQuery the allow query * @returns */ setAllowQuery: (id: string, allowQuery: boolean) => Promise>; /** * This method sets the allow upload for an image variable * @param id the id of the variable * @param allowUpload the allow upload * @returns */ setAllowUpload: (id: string, allowUpload: boolean) => Promise>; /** * This method sets the minimum size (both width and height) for an image variable that will be uploaded * @param id the id of the variable * @param minWidth the minimum width * @param minHeight the minimum height * @returns */ setMinUploadSize: (id: string, minWidth: string | null, minHeight: string | null) => Promise>; /** * This method sets the image variable connector. Setting a connector will * automatically remove the assetId linked to the connector if present. * If a connector was the source of the variable, it will be unregistered. * @param id The id of the image variable to update * @param registration registration object containing all details about the connector * @returns The new id of the connector */ setConnector: (id: string, registration: ConnectorLocalRegistration | ConnectorGrafxRegistration | ConnectorUrlRegistration) => Promise>; /** * This method sets the connector context for an image variable * @param id the id of the variable * @param context the context dictionary * @returns */ setConnectorContext: (id: string, context: Dictionary) => Promise>; } export declare class DataSourceVariableController { #private; constructor(editorAPI: EditorAPI); setConnector: (id: string, registration: ConnectorLocalRegistration | ConnectorGrafxRegistration | ConnectorUrlRegistration) => Promise>; }