diff --git a/types/memory-fs/index.d.ts b/types/memory-fs/index.d.ts index 9578bb3548..23b3f0aef9 100644 --- a/types/memory-fs/index.d.ts +++ b/types/memory-fs/index.d.ts @@ -43,13 +43,13 @@ declare class MemoryFileSystem { writeFileSync(_path: string, content: string | Buffer, encoding?: string): void; createReadStream( - path: string, options: { + path: string, options?: { start: number; end: number; } ): any; - createWriteStream(path: string, options: any): any; + createWriteStream(path: string, options?: any): any; exists(path: string, callback: (isExist: boolean) => any): any; diff --git a/types/memory-fs/test/index.ts b/types/memory-fs/test/index.ts index 07abb3e3fe..16d477baf2 100644 --- a/types/memory-fs/test/index.ts +++ b/types/memory-fs/test/index.ts @@ -15,3 +15,7 @@ fs.writeFile('hello', 'hahahahah', 'utf-8', function (err) { console.log(err.message); } }); + +fs.createReadStream('hello'); + +fs.createWriteStream('hello'); \ No newline at end of file