rittenhop-ghost/versions/5.94.2/node_modules/lexical/LexicalEditorState.d.ts

29 lines
1.2 KiB
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from './LexicalEditor';
import type { NodeMap, SerializedLexicalNode } from './LexicalNode';
import type { BaseSelection } from './LexicalSelection';
import type { SerializedRootNode } from './nodes/LexicalRootNode';
export interface SerializedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> {
root: SerializedRootNode<T>;
}
export declare function editorStateHasDirtySelection(editorState: EditorState, editor: LexicalEditor): boolean;
export declare function cloneEditorState(current: EditorState): EditorState;
export declare function createEmptyEditorState(): EditorState;
export declare class EditorState {
_nodeMap: NodeMap;
_selection: null | BaseSelection;
_flushSync: boolean;
_readOnly: boolean;
constructor(nodeMap: NodeMap, selection?: null | BaseSelection);
isEmpty(): boolean;
read<V>(callbackFn: () => V): V;
clone(selection?: null | BaseSelection): EditorState;
toJSON(): SerializedEditorState;
}