import { TunesMenuConfig } from '@editorjs/editorjs/types/tools'; import { ToolboxConfig, BlockToolConstructorOptions, BlockTool } from '@editorjs/editorjs'; import { ActionConfig, LaTexToolData, LaTexToolConfig } from './types/types'; type LaTexToolConstructorOptions = BlockToolConstructorOptions; /** * Implementation of LaTexTool class */ export default class LaTexTool implements BlockTool { /** * Editor.js API instance */ private api; /** * Current Block API instance */ private block; /** * Configuration for the LaTexTool */ private config; /** * UI module instance */ private ui; /** * Stores current block data internally */ private _data; /** * @param tool - tool properties got from editor.js * @param tool.data - previously saved data * @param tool.config - user config for Tool * @param tool.api - Editor.js API * @param tool.readOnly - read-only mode flag * @param tool.block - current Block API */ constructor({ data, config, api, readOnly, block, }: LaTexToolConstructorOptions); /** * Notify core that read-only mode is supported */ static get isReadOnlySupported(): boolean; /** * Get Tool toolbox settings * icon - Tool icon's SVG * title - title to show in toolbox */ static get toolbox(): ToolboxConfig; /** * Available tune tools */ static get tunes(): Array; /** * Renders Block content */ render(): HTMLDivElement; /** * Validate data: check if latex value exists * @param savedData — data received after saving * @returns false if saved data is not correct, otherwise true */ validate(savedData: LaTexToolData): boolean; /** * Return Block data */ save(blockContent: HTMLElement): LaTexToolData; /** * Returns configuration for block tunes * @returns TunesMenuConfig */ renderSettings(): TunesMenuConfig; /** * Stores all Tool's data * @param data - data in LaTex Tool format */ private set data(value); /** * Return Tool data */ private get data(); /** * Callback fired when Block Tune is activated * @param tuneName - tune that has been clicked */ private tuneToggled; /** * Set one tune * @param tuneName - {@link Tunes.tunes} * @param value - tune state */ private setTune; } export {};