1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export interface Host {
|
9 | write(path: string, content: string): Promise<void>;
|
10 | read(path: string): Promise<string>;
|
11 | }
|
12 | export interface Change {
|
13 | apply(host: Host): Promise<void>;
|
14 | readonly path: string | null;
|
15 | readonly order: number;
|
16 | readonly description: string;
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 | export declare class NoopChange implements Change {
|
22 | description: string;
|
23 | order: number;
|
24 | path: null;
|
25 | apply(): Promise<void>;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 | export declare class InsertChange implements Change {
|
31 | path: string;
|
32 | pos: number;
|
33 | toAdd: string;
|
34 | order: number;
|
35 | description: string;
|
36 | constructor(path: string, pos: number, toAdd: string);
|
37 | /**
|
38 | * This method does not insert spaces if there is none in the original string.
|
39 | */
|
40 | apply(host: Host): Promise<void>;
|
41 | }
|
42 | /**
|
43 | * Will remove text from the source code.
|
44 | */
|
45 | export declare class RemoveChange implements Change {
|
46 | path: string;
|
47 | private pos;
|
48 | private toRemove;
|
49 | order: number;
|
50 | description: string;
|
51 | constructor(path: string, pos: number, toRemove: string);
|
52 | apply(host: Host): Promise<void>;
|
53 | }
|
54 | /**
|
55 | * Will replace text from the source code.
|
56 | */
|
57 | export declare class ReplaceChange implements Change {
|
58 | path: string;
|
59 | private pos;
|
60 | private oldText;
|
61 | private newText;
|
62 | order: number;
|
63 | description: string;
|
64 | constructor(path: string, pos: number, oldText: string, newText: string);
|
65 | apply(host: Host): Promise<void>;
|
66 | }
|