UNPKG

@explita/editor

Version:

`@explita/editor` is a versatile, modern rich-text editor built on TipTap for seamless integration into React applications. It provides extensive customization options and advanced features to cater to diverse content creation needs.

45 lines (44 loc) 1.54 kB
import { JSONContent } from "@tiptap/react"; /** * Checks if the specified mark or node is active in the editor. * * @param {string} name - The name of the mark or node to check. * @param {Object} [attributes] - Optional attributes to check for the mark or node. * @returns {boolean} - Returns true if the mark or node is active, false otherwise. */ declare function isActive(name: string, attributes?: {}): boolean; /** * Sets the content of the editor. * * @param {string | JSONContent} content - The content to set in the editor. * It can be a string or a JSONContent object. */ declare function setEditorContent(content: string | JSONContent): void; declare function getEditorContent(type: "html"): string; declare function getEditorContent(type: "text"): string; declare function getEditorContent(type: "json"): JSONContent; /** * Clears all content from the editor. */ declare function clearEditorContent(): void; /** * Checks if the editor is empty. * * @returns {boolean} - Returns true if the editor is empty, false otherwise. */ declare function isEditorEmpty(): boolean; /** * Gets the word count from the editor. * * @returns {number} - The word count from the editor. */ declare function getWordCount(): any; export declare const utils: { isActive: typeof isActive; setEditorContent: typeof setEditorContent; getEditorContent: typeof getEditorContent; clearEditorContent: typeof clearEditorContent; isEditorEmpty: typeof isEditorEmpty; getWordCount: typeof getWordCount; }; export {};