Skip to content

Commit 9c4e818

Browse files
authored
Merge pull request #97 from tachibana-shin/patch-1
interpolation for `readFile` with `utf8`
2 parents b86383a + d4e48bf commit 9c4e818

File tree

3 files changed

+16323
-62
lines changed

3 files changed

+16323
-62
lines changed

index.d.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ declare module '@isomorphic-git/lightning-fs' {
4747

4848
writeFile(filepath: string, data: Uint8Array | string, options: FS.WriteFileOptions | undefined | string, cb: (err: Error) => void): void
4949

50-
readFile(filepath: string, options: FS.ReadFileOptions | undefined | string, cb: (err: Error, data: Uint8Array | string) => void): void
50+
readFile(filepath: string, options: 'utf8' | { encoding: 'utf8' }, cb: (err: Error, data: string) => void): void
51+
readFile(filepath: string, options: {} | void, cb: (err: Error, data: Uint8Array) => void): void
5152

5253
/**
5354
* Delete a file
@@ -149,7 +150,8 @@ declare module '@isomorphic-git/lightning-fs' {
149150

150151
writeFile(filepath: string, data: Uint8Array | string, options?: FS.WriteFileOptions | string): Promise<void>
151152

152-
readFile(filepath: string, options?: FS.ReadFileOptions | string): Promise<Uint8Array | string>
153+
readFile(filepath: string, options: 'utf8' | { encoding: 'utf8' }): Promise<string>
154+
readFile(filepath: string, options?: {}): Promise<Uint8Array>
153155

154156
/**
155157
* Delete a file

0 commit comments

Comments
 (0)