123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- import { Node } from 'prosemirror-model';
- import { StepMap } from 'prosemirror-transform';
- declare class Span<Data = any> {
-
- readonly length: number;
-
- readonly data: Data;
- }
- declare class Change<Data = any> {
-
- readonly fromA: number;
-
- readonly toA: number;
-
- readonly fromB: number;
-
- readonly toB: number;
-
- readonly deleted: readonly Span<Data>[];
-
- readonly inserted: readonly Span<Data>[];
-
- static merge<Data>(x: readonly Change<Data>[], y: readonly Change<Data>[], combine: (dataA: Data, dataB: Data) => Data): readonly Change<Data>[];
- }
- declare function simplifyChanges(changes: readonly Change[], doc: Node): Change<any>[];
- declare class ChangeSet<Data = any> {
-
- readonly changes: readonly Change<Data>[];
-
- addSteps(newDoc: Node, maps: readonly StepMap[], data: Data | readonly Data[]): ChangeSet<Data>;
-
- get startDoc(): Node;
-
- map(f: (range: Span<Data>) => Data): ChangeSet<Data>;
-
- changedRange(b: ChangeSet, maps?: readonly StepMap[]): {
- from: number;
- to: number;
- } | null;
-
- static create<Data = any>(doc: Node, combine?: (dataA: Data, dataB: Data) => Data): ChangeSet<Data>;
- }
- export { Change, ChangeSet, Span, simplifyChanges };
|