1 | import { ScriptedFlushable } from "../internal/common/Flushable";
|
2 |
|
3 |
|
4 |
|
5 | export interface FileCore {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 | readonly name: string;
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 | readonly path: string;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 | export interface FileScripting extends ScriptedFlushable<File> {
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 | recordSetContent(newContent: string): this;
|
29 | recordRename(name: string): this;
|
30 | recordSetPath(name: string): this;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 | recordReplace(re: RegExp, replacement: string): this;
|
37 | recordReplaceAll(oldLiteral: string, newLiteral: string): this;
|
38 | }
|
39 | export interface FileAsync extends FileCore {
|
40 | setContent(content: string): Promise<this>;
|
41 | rename(name: string): Promise<this>;
|
42 | getContent(): Promise<string>;
|
43 | replace(re: RegExp, replacement: string): Promise<this>;
|
44 | replaceAll(oldLiteral: string, newLiteral: string): Promise<this>;
|
45 | setPath(path: string): Promise<this>;
|
46 | isExecutable(): Promise<boolean>;
|
47 | isReadable(): Promise<boolean>;
|
48 | isBinary(): Promise<boolean>;
|
49 | }
|
50 | export interface FileNonBlocking extends FileScripting, FileAsync {
|
51 | }
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export interface FileSync extends FileCore {
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 | getContentSync(): string;
|
63 | setContentSync(content: string): this;
|
64 | }
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | export interface File extends FileScripting, FileSync, FileAsync {
|
70 | |
71 |
|
72 |
|
73 | extension: string;
|
74 | }
|
75 | export declare function isFile(a: any): a is File;
|
76 |
|
\ | No newline at end of file |