import { ActionDeltaUpdate, ActionTrigger, DocumentAction } from '../types/ActionTypes'; import { EditorAPI, Id } from '../types/CommonTypes'; /** * The ActionController is responsible for all Actions-related functionality. * Methods inside this controller can be called by `window.SDK.action.{method-name}` */ export declare class ActionController { #private; /** * @ignore */ constructor(editorAPI: EditorAPI); /** * This method returns the list of all actions. * @returns list of all actions */ getAll: () => Promise>; /** * This method returns an action by the id * @param id the id of a specific action * @returns action details */ getById: (id: Id) => Promise>; /** * This method creates a new action. * @returns the id of the newly created action. */ create: () => Promise>; /** * This method duplicates an existing action by the id * @param id the id of a specific action * @returns the id of the duplicated action. */ duplicate: (id: Id) => Promise>; /** * This method removes the action by the id * @param id the id of a specific action * @returns */ remove: (id: Id) => Promise>; /** * This method updates an existing Action * @param id the id of a specific Action * @param update the delta update to apply to the Action * @returns */ update: (id: Id, update: ActionDeltaUpdate) => Promise>; /** * @deprecated use the update method instead * * This method renames an action by the id and provided name * @param id the id of a specific action * @param name the new unique name for the action * @returns */ rename: (id: Id, name: string) => Promise>; /** * @deprecated use the update method instead * * This method updates the script the action uses by the id and provided script * @param id the id of a specific action * @param actionScript the JavaScript based action script * @returns */ updateScript: (id: Id, actionScript: string) => Promise>; /** * @deprecated use the update method instead * * This method updates the triggers on which the action will react. * @param id the id of a specific action * @param triggers the triggers this action should react on. * @returns */ updateTriggers: (id: Id, triggers: ActionTrigger[]) => Promise>; /** * This method changes positions of actions * @param order the position of actions * @param ids the list of action IDs * @returns */ move: (order: number, ids: string[]) => Promise>; /** * @deprecated use the update method instead * * This method stores the state of action type errors to the document * * Those errors states can be read back from the usual getters or the * `onActionsChanged` stream * @param id the id of a specific action * @param hasTypeErrors whether there is an action type error * @returns */ setTypeError: (id: string, hasTypeErrors: boolean) => Promise>; /** * This method disables the execution of Actions. * Note that any Action will be ignored and forgotten. * @returns */ disable: () => Promise>; /** * This method enables the execution of Actions. * Note this is enabled by default. * @returns */ enable: () => Promise>; /** * This method enables the execution of Component Actions. * Note this is enabled by default. * @param shouldEnable whether to enable or disable component actions * @returns */ enableForComponents: (shouldEnable: boolean) => Promise>; }