Add missing FS object

This commit is contained in:
Sxxov 2020-12-18 19:19:12 +08:00
parent c03cd585da
commit 9c35d2bea9

6
src/index.d.ts vendored
View File

@ -1,3 +1,9 @@
export const FS: {
writeFile: (fileName: string, binaryData: Uint8Array) => Promise<void>,
readFile: (fileName: string) => Promise<Uint8Array>,
unlink: (fileName: string) => Promise<void>,
}
type FSMethodNames = { [K in keyof typeof FS]: (typeof FS)[K] extends (...args: any[]) => any ? K : never }[keyof typeof FS]; type FSMethodNames = { [K in keyof typeof FS]: (typeof FS)[K] extends (...args: any[]) => any ? K : never }[keyof typeof FS];
type FSMethodArgs = { [K in FSMethodNames]: Parameters<(typeof FS)[K]> }; type FSMethodArgs = { [K in FSMethodNames]: Parameters<(typeof FS)[K]> };
type FSMethodReturn = { [K in FSMethodNames]: ReturnType<(typeof FS)[K]> }; type FSMethodReturn = { [K in FSMethodNames]: ReturnType<(typeof FS)[K]> };