Merge pull request #369 from Jeffxz/improve-ts

expose more FS methods to ts
This commit is contained in:
jeromewu 2022-08-14 18:37:06 +08:00 committed by GitHub
commit fe730353cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

3
.gitignore vendored
View File

@ -2,3 +2,6 @@ node_modules
dist dist
/.nyc_output /.nyc_output
.DS_Store .DS_Store
# ide
.idea/

2
src/index.d.ts vendored
View File

@ -3,6 +3,8 @@ export const FS: {
readFile: (fileName: string) => Uint8Array, readFile: (fileName: string) => Uint8Array,
readdir: (pathName: string) => string[], readdir: (pathName: string) => string[],
unlink: (fileName: string) => void, unlink: (fileName: string) => void,
mkdir: (fileName: string) => void,
readdir: (fileName: string) => string[],
} }
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];