@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
29 lines (28 loc) • 1.59 kB
TypeScript
import { ElementNode } from 'lexical';
import { ElementTransformer } from "../../markdown/service/shortcut";
export declare const createBlockNode: (createNode: (match: Array<string>, parentNode: ElementNode) => ElementNode) => ElementTransformer['replace'];
/**
* Returns the root's text content.
* @returns The root's text content.
*/
export declare function $rootTextContent(): string;
/**
* Determines if the root has any text content and can trim any whitespace if it does.
* @param isEditorComposing - Is the editor in composition mode due to an active Input Method Editor?
* @param trim - Should the root text have its whitespaced trimmed? Defaults to true.
* @returns true if text content is empty, false if there is text or isEditorComposing is true.
*/
export declare function $isRootTextContentEmpty(isEditorComposing: boolean, trim?: boolean): boolean;
/**
* Determines if the input should show the placeholder. If anything is in
* in the root the placeholder should not be shown.
* @param isComposing - Is the editor in composition mode due to an active Input Method Editor?
* @returns true if the input should show the placeholder, false otherwise.
*/
export declare function $canShowPlaceholder(isComposing: boolean): boolean;
/**
* Returns a function that executes {@link $canShowPlaceholder}
* @param isEditorComposing - Is the editor in composition mode due to an active Input Method Editor?
* @returns A function that executes $canShowPlaceholder with arguments.
*/
export declare function $canShowPlaceholderCurry(isEditorComposing: boolean): () => boolean;