-
Notifications
You must be signed in to change notification settings - Fork 372
/
interface.ts
34 lines (30 loc) · 972 Bytes
/
interface.ts
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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export interface StorageConnection {
id: string;
type: 'LocalDisk' | 'AzureBlobStorage';
path: string;
[key: string]: string;
}
export interface Stat {
isDir: boolean;
isFile: boolean;
lastModified: string;
size: string;
}
export interface MakeDirectoryOptions {
recursive?: boolean;
}
export interface IFileStorage {
stat(path: string): Promise<Stat>;
readFile(path: string): Promise<string>;
readDir(path: string): Promise<string[]>;
exists(path: string): Promise<boolean>;
writeFile(path: string, content: any): Promise<void>;
removeFile(path: string): Promise<void>;
mkDir(path: string, options?: MakeDirectoryOptions): Promise<void>;
rmDir(path: string): Promise<void>;
glob(pattern: string | string[], path: string): Promise<string[]>;
copyFile(src: string, dest: string): Promise<void>;
rename(oldPath: string, newPath: string): Promise<void>;
}