/// import "bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css"; import "bpmn-js/dist/assets/diagram-js.css"; import Modeler from "bpmn-js/lib/Modeler"; import { EventCallback } from "../GlobalEventListenerUtil"; export interface CustomBpmnJsModelerOptions { /** * The ID of the div to use as host for the properties panel. The div must be present inside * the page HTML. If missing or undefined is passed, no properties panel will be initialized. */ propertiesPanel?: string; /** * The ID of the div to use as host for the editor itself. The div must be present inside the * page HTML. */ container: string; /** * The options passed to bpmn-js. Will be merged with the options defined by this library, * with the latter taking precedence in case of conflict. * CAUTION: If you pass invalid properties, the modeler can break! */ bpmnJsOptions?: any; } interface Injector { /** * Returns a named component. * * @param name The name * @param strict If an error should be thrown if the component does not exist. If false, null * will be returned. */ get: (name: string, strict?: boolean) => any; } declare class CustomBpmnJsModeler extends Modeler { /** * Creates a new instance of the bpmn-js modeler. * * @param options The options to include */ constructor(options: CustomBpmnJsModelerOptions); /** * Returns the injector. */ getInjector(): Injector; /** * Saves the editor content as SVG and XML simultaneously. */ save(): Promise<{ xml: string; svg: string; }>; /** * Registers a global event listener that will receive all bpmn-js events. * * @param listener The listener to register */ registerGlobalEventListener(listener: EventCallback): void; /** * Unregisters a previously registered global event listener. * * @param listener The listener to unregister */ unregisterGlobalEventListener(listener: EventCallback): void; /** * Imports element templates into the editor. * * @param elementTemplates The element templates to import. */ importElementTemplates(elementTemplates: Record[]): void; /** * Binds the keyboard to the curretn document. * Keyboard shortcuts will trigger actions in the editor after this has been called. */ bindKeyboard(): void; /** * Unbinds the keyboard from the current document. * Keyboard shortcuts won't work anymore after this has been called. */ unbindKeyboard(): void; /** * Toggles the hand tool. */ toggleHandTool(): void; /** * Toggles the lasso tool. */ toggleLassoTool(): void; /** * Toggles the space tool. */ toggleSpaceTool(): void; /** * Toggles the global connect tool. */ toggleGlobalConnectTool(): void; /** * Toggles the search box. */ toggleFind(): void; /** * Activates the edit label function. */ toggleEditLabel(): void; /** * Expands the selection to all available elements. */ selectAll(): void; /** * Removes the currently selected elements. */ removeSelected(): void; /** * Returns the size of the current selection. */ getSelectionSize(): number; /** * Returns whether there is any element selected that can be copied. * Can be used to determine if the copy button should be enabled or not. */ canCopy(): boolean; /** * Returns whether there is any element in the clipboard that can be pasted. * Can be used to determine if the paste button should be enabled or not. */ canPaste(): boolean; /** * Returns the current stack index. */ getStackIndex(): number; /** * Returns whether the command stack contains any actions that can be undone. * Can be used to determine if the undo button should be enabled or not. */ canUndo(): boolean; /** * Returns whether the command stack contains any actions that can be repeated. * Can be used to determine if the redo button should be enabled or not. */ canRedo(): boolean; /** * Instructs the command stack to undo the last action. */ undo(): void; /** * Instructs the command stack to repeat the last undone action. */ redo(): void; /** * Resets the zoom level to its default value. */ resetZoom(): void; } export default CustomBpmnJsModeler;