UNPKG

1.28 kBTypeScriptView Raw
1/**
2 * Base file exposes the API to add action and `cd` in/out from
3 * the application base directory.
4 */
5export declare abstract class File {
6 private basePath;
7 protected abstract actions: {
8 action: string;
9 body?: any;
10 }[];
11 /**
12 * The user current working directory reference. This is maintained, since
13 * we virtually cd into the `basePath`.
14 */
15 private currentDir;
16 constructor(basePath: string);
17 /**
18 * Add a new action to the actions stack. The action workings
19 * are independent on the user adding the action
20 */
21 protected addAction(action: string, body?: any): void;
22 /**
23 * Returns an array of actions to commit
24 */
25 protected getCommitActions(): {
26 action: string;
27 body?: any;
28 }[];
29 /**
30 * Returns an array of actions for performing revert. Since
31 * reverts are done in reverse, this method will reverse
32 * the actions array.
33 */
34 protected getRevertActions(): {
35 action: string;
36 body?: any;
37 }[];
38 /**
39 * `cd` to the application base path
40 */
41 protected cdIn(): void;
42 /**
43 * `cd` out from the application base path
44 */
45 protected cdOut(): void;
46}