Merge pull request #134 from Sxxov/master

Add missing FS object
This commit is contained in:
jeromewu 2021-01-14 18:41:06 +08:00 committed by GitHub
commit d73d88daff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
src/index.d.ts vendored
View File

@ -1,3 +1,9 @@
export const FS: {
writeFile: (fileName: string, binaryData: Uint8Array) => void,
readFile: (fileName: string) => Uint8Array,
unlink: (fileName: string) => 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]> };