UNPKG

2.6 kBTypeScriptView Raw
1import { Ancestor, Editor, Node, Operation, Range, RangeRef, Text } from 'slate';
2import { Action } from '../hooks/android-input-manager/android-input-manager';
3import { TextDiff } from './diff-text';
4import { Key } from './key';
5/**
6 * Two weak maps that allow us rebuild a path given a node. They are populated
7 * at render time such that after a render occurs we can always backtrack.
8 */
9export declare const NODE_TO_INDEX: WeakMap<Node, number>;
10export declare const NODE_TO_PARENT: WeakMap<Node, Ancestor>;
11/**
12 * Weak maps that allow us to go between Slate nodes and DOM nodes. These
13 * are used to resolve DOM event-related logic into Slate actions.
14 */
15export declare const EDITOR_TO_WINDOW: WeakMap<Editor, Window>;
16export declare const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement>;
17export declare const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string>;
18export declare const EDITOR_TO_PLACEHOLDER_ELEMENT: WeakMap<Editor, HTMLElement>;
19export declare const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node>;
20export declare const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement>;
21export declare const NODE_TO_KEY: WeakMap<Node, Key>;
22export declare const EDITOR_TO_KEY_TO_ELEMENT: WeakMap<Editor, WeakMap<Key, HTMLElement>>;
23/**
24 * Weak maps for storing editor-related state.
25 */
26export declare const IS_READ_ONLY: WeakMap<Editor, boolean>;
27export declare const IS_FOCUSED: WeakMap<Editor, boolean>;
28export declare const IS_COMPOSING: WeakMap<Editor, boolean>;
29export declare const EDITOR_TO_USER_SELECTION: WeakMap<Editor, RangeRef | null>;
30/**
31 * Weak map for associating the context `onChange` context with the plugin.
32 */
33export declare const EDITOR_TO_ON_CHANGE: WeakMap<import("..").ReactEditor, (options?: {
34 operation?: Operation;
35}) => void>;
36/**
37 * Weak maps for saving pending state on composition stage.
38 */
39export declare const EDITOR_TO_SCHEDULE_FLUSH: WeakMap<Editor, () => void>;
40export declare const EDITOR_TO_PENDING_INSERTION_MARKS: WeakMap<Editor, Partial<Text> | null>;
41export declare const EDITOR_TO_USER_MARKS: WeakMap<Editor, Partial<Text> | null>;
42/**
43 * Android input handling specific weak-maps
44 */
45export declare const EDITOR_TO_PENDING_DIFFS: WeakMap<Editor, TextDiff[]>;
46export declare const EDITOR_TO_PENDING_ACTION: WeakMap<Editor, Action | null>;
47export declare const EDITOR_TO_PENDING_SELECTION: WeakMap<Editor, Range | null>;
48export declare const EDITOR_TO_FORCE_RENDER: WeakMap<Editor, () => void>;
49/**
50 * Symbols.
51 */
52export declare const PLACEHOLDER_SYMBOL: string;
53export declare const MARK_PLACEHOLDER_SYMBOL: string;
54//# sourceMappingURL=weak-maps.d.ts.map
\No newline at end of file