import { API } from '@editorjs/editorjs'; import { LaTexToolData, LaTexToolConfig } from './types/types'; /** * Nodes interface representing various elements in the UI. */ interface Nodes { /** * Wrapper element in the UI. */ wrapper: HTMLElement; /** * Container for the preview element in the UI. */ preview: HTMLElement; /** * Input element for the LaTex expression. */ input: HTMLInputElement; } /** * ConstructorParams interface representing parameters for the Ui class constructor. */ interface ConstructorParams { /** * Editor.js API. */ api: API; /** * Configuration for the LatexTool. */ config: LaTexToolConfig; /** * Flag indicating if the UI is in read-only mode. */ readOnly: boolean; } /** * Class for working with UI: */ export default class Ui { /** * Nodes representing various elements in the UI. */ nodes: Nodes; /** * API instance for Editor.js. */ private api; /** * Configuration for the LaTex tool. */ private config; /** * Flag indicating if the UI is in read-only mode. */ private readOnly; /** * @param ui - LaTex tool Ui module * @param ui.api - Editor.js API * @param ui.config - user config * @param ui.readOnly - read-only mode flag */ constructor({ api, config, readOnly }: ConstructorParams); /** * Apply visual representation of activated tune * @param tuneName - one of available tunes {@link Tunes.tunes} * @param status - true for enable, false for disable */ applyTune(tuneName: string, status: boolean): void; /** * Renders tool UI * @param toolData - saved tool data */ render(toolData: LaTexToolData): HTMLElement; /** * Shows caption input * @param text - caption content text */ fillInput(text: string): void; /** * CSS classes */ private get CSS(); } export {};