UNPKG

@silexlabs/grapesjs-symbols

Version:
38 lines 1.58 kB
import { Editor, Component } from 'grapesjs'; import Symbol from './model/Symbol'; import { SymbolEditor } from './model/Symbols'; export declare const cmdAdd = "symbols:add"; export declare const cmdRemove = "symbols:remove"; export declare const cmdUnlink = "symbols:unlink"; export declare const cmdCreate = "symbols:create"; export default function (editor: SymbolEditor): void; export declare function displayError(editor: Editor, title: string, message: string): void; /** * Create a new symbol * @param options.component - the component which will become the first instance of the symbol * @returns {Symbol} */ export declare function addSymbol(editor: SymbolEditor, _: any, { label, icon, component }: { label: string; icon: string; component: Component | undefined; }): Symbol; /** * Delete a symbol * @param {symbolId: string} - object containing the symbolId */ export declare function removeSymbol(editor: SymbolEditor, _: any, { symbolId }: { symbolId: string; }): Symbol; export declare function unlinkSymbolInstance(editor: SymbolEditor, _: any, { component }: { component: Component; }): void; /** * @param {{index, indexEl, method}} pos Where to insert the component, as [defined by the Sorter](https://github.com/artf/grapesjs/blob/0842df7c2423300f772e9e6cdc88c6ae8141c732/src/utils/Sorter.js#L871) */ export declare function createSymbolInstance(editor: SymbolEditor, _: any, { symbol, pos, target }: { symbol: Symbol; pos: any; target: HTMLElement; }): Component | null; //# sourceMappingURL=SymbolsCommands.d.ts.map