forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
38 lines (29 loc) · 1 KB
/
index.d.ts
File metadata and controls
38 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
declare module 'ot' {
export type SerializedTextOperation = (string | number)[];
class TextOperation {
ops: SerializedTextOperation;
delete(length: number): TextOperation;
insert(str: string): TextOperation;
retain(length: number): TextOperation;
baseLength: number;
targetLength: number;
apply(code: string): string;
compose(operation: TextOperation): TextOperation;
static transform(left: TextOperation, right: TextOperation): TextOperation;
static isRetain(operation: string | number): boolean;
static isInsert(operation: string | number): boolean;
static isDelete(operation: string | number): boolean;
static fromJSON(operation: SerializedTextOperation): TextOperation;
toJSON(): SerializedTextOperation;
}
interface Range {
new (anchor: number, head: number): Range;
transform(operation: TextOperation): Range;
anchor: number;
head: number;
}
class Selection {
static Range: Range;
}
export { TextOperation, Selection };
}