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 |
|
23 | export interface FileScripting extends ScriptedFlushable<File> {
|
24 | }
|
25 | export interface FileAsync extends FileCore {
|
26 | setContent(content: string): Promise<this>;
|
27 | rename(name: string): Promise<this>;
|
28 | getContent(): Promise<string>;
|
29 | replace(re: RegExp, replacement: string): Promise<this>;
|
30 | replaceAll(oldLiteral: string, newLiteral: string): Promise<this>;
|
31 | setPath(path: string): Promise<this>;
|
32 | isExecutable(): Promise<boolean>;
|
33 | isReadable(): Promise<boolean>;
|
34 | isBinary(): Promise<boolean>;
|
35 | }
|
36 | export interface FileNonBlocking extends FileScripting, FileAsync {
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export interface FileSync extends FileCore {
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 | getContentSync(): string;
|
49 | setContentSync(content: string): this;
|
50 | }
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export interface File extends FileScripting, FileSync, FileAsync {
|
56 | |
57 |
|
58 |
|
59 | extension: string;
|
60 | }
|
61 | export declare function isFile(a: any): a is File;
|