diff --git a/.changes/fs-write-uint8array-arraybuffer.md b/.changes/fs-write-uint8array-arraybuffer.md new file mode 100644 index 0000000000..37b53d913e --- /dev/null +++ b/.changes/fs-write-uint8array-arraybuffer.md @@ -0,0 +1,6 @@ +--- +fs: patch +fs-js: patch +--- + +`readFile` now returns a more specific type `Promise>` instead of the default `Promise` diff --git a/plugins/fs/guest-js/index.ts b/plugins/fs/guest-js/index.ts index d4858b0e85..572cc1e85b 100644 --- a/plugins/fs/guest-js/index.ts +++ b/plugins/fs/guest-js/index.ts @@ -739,7 +739,7 @@ interface ReadFileOptions { async function readFile( path: string | URL, options?: ReadFileOptions -): Promise { +): Promise> { if (path instanceof URL && path.protocol !== 'file:') { throw new TypeError('Must be a file URL.') }