Created
April 4, 2021 22:33
-
-
Save retorquere/5c554ac33e0bf2b5c92c755b63bf5542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare interface DirectoryIterator { | |
forEach: (handler: any) => Promise<void> | |
} | |
declare interface DirectoryIteratorConstructable { | |
new(path: string): DirectoryIterator | |
} | |
export declare const OS: { | |
File: { | |
exists: (path: string) => Promise<boolean> | |
read: (path: string, options: { encoding: string } ) => Promise<string> | |
move: (from: string, to: string) => Promise<void> | |
remove: (path: string, options?: { ignoreAbsent: boolean }) => Promise<void> | |
writeAtomic: (path: string, data: string, options: { tmpPath: string, encoding: string }) => Promise<void> | |
makeDir: (path: string, options: { ignoreExisting: boolean }) => Promise<void> | |
stat: (path: string) => { isDir: boolean, size: number, unixMode?: number } | |
DirectoryIterator: DirectoryIteratorConstructable | |
} | |
Path: { | |
join: (...args: string[]) => string | |
dirname: (path: string) => string | |
basename: (path: string) => string | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment