@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
37 lines (36 loc) • 1.71 kB
TypeScript
import { DOMConversionMap, DOMExportOutput, DecoratorNode, EditorConfig, LexicalEditor, LexicalNode, LexicalUpdateJSON, SerializedLexicalNode, Spread } from 'lexical';
export type SerializedFileNode = Spread<{
fileUrl?: string;
message?: string;
name: string;
size?: number;
status?: 'pending' | 'uploaded' | 'error';
}, SerializedLexicalNode>;
export declare class FileNode extends DecoratorNode<any> {
static getType(): string;
static clone(node: FileNode): FileNode;
static importJSON(serializedNode: SerializedFileNode): FileNode;
static importDOM(): DOMConversionMap | null;
__name: string;
__fileUrl: string | undefined;
__size: number | undefined;
__status: 'pending' | 'uploaded' | 'error';
__message?: string;
get name(): string;
get fileUrl(): string | undefined;
get size(): number | undefined;
get status(): 'pending' | 'uploaded' | 'error';
get message(): string | undefined;
constructor(name: string, fileUrl?: string, size?: number, status?: 'pending' | 'uploaded' | 'error', message?: string, key?: string);
setUploaded(url: string): void;
setError(message: string): void;
exportDOM(): DOMExportOutput;
createDOM(config: EditorConfig): HTMLElement;
exportJSON(): SerializedFileNode;
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedFileNode>): this;
getTextContent(): string;
updateDOM(): boolean;
decorate(editor: LexicalEditor): any;
}
export declare function $createFileNode(name?: string, fileUrl?: string, size?: number, status?: 'pending' | 'uploaded' | 'error', message?: string): FileNode;
export declare function $isFileNode(node: LexicalNode): node is FileNode;