UNPKG

924 BTypeScriptView Raw
1import { EmbedBlot } from 'parchment';
2import type { ScrollBlot } from 'parchment';
3import type Selection from '../core/selection.js';
4import type { EmbedContextRange } from './embed.js';
5declare class Cursor extends EmbedBlot {
6 static blotName: string;
7 static className: string;
8 static tagName: string;
9 static CONTENTS: string;
10 static value(): undefined;
11 selection: Selection;
12 textNode: Text;
13 savedLength: number;
14 constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection);
15 detach(): void;
16 format(name: string, value: unknown): void;
17 index(node: Node, offset: number): number;
18 length(): number;
19 position(): [Text, number];
20 remove(): void;
21 restore(): EmbedContextRange | null;
22 update(mutations: MutationRecord[], context: Record<string, unknown>): void;
23 optimize(context?: unknown): void;
24 value(): string;
25}
26export default Cursor;