lightning-fs
lightning-fs copied to clipboard
Incorrect `IDB` interface
I noticed that current IDB interface had two errors:
- The constructor type was typed as a regular function
- The
readFilewas mis-typed asloadFile
/lightning-fs/index.d.ts
export interface IDB {
- constructor(dbname: string, storename: string): IDB
+ new (dbname: string, storename: string): IDB
saveSuperblock(sb: Uint8Array): TypeOrPromise<void>
loadSuperblock(): TypeOrPromise<FS.SuperBlock>
- loadFile(inode: number): TypeOrPromise<Uint8Array>
+ readFile(inode: number): TypeOrPromise<Uint8Array>
writeFile(inode: number, data: Uint8Array): TypeOrPromise<void>
wipe(): TypeOrPromise<void>
close(): TypeOrPromise<void>
}
Do you want to add a PR?
See #127. Note that I removed the constructor instead of using new. I realized that my originally proposed fix was wrong as well and the constructor interface was unnecessary.