diff options
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 8ebf16150..da016db8a 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -861,6 +861,15 @@ declare namespace Deno { mode?: number; } + export interface ReadFileOptions { + /** + * An abort signal to allow cancellation of the file read operation. + * If the signal becomes aborted the readFile operation will be stopped + * and the promise returned will be rejected with an AbortError. + */ + signal?: AbortSignal; + } + /** * * Check if a given resource id (`rid`) is a TTY. @@ -1385,7 +1394,10 @@ declare namespace Deno { * ``` * * Requires `allow-read` permission. */ - export function readTextFile(path: string | URL): Promise<string>; + export function readTextFile( + path: string | URL, + options?: ReadFileOptions, + ): Promise<string>; /** Synchronously reads and returns the entire contents of a file as an array * of bytes. `TextDecoder` can be used to transform the bytes to string if @@ -1411,7 +1423,10 @@ declare namespace Deno { * ``` * * Requires `allow-read` permission. */ - export function readFile(path: string | URL): Promise<Uint8Array>; + export function readFile( + path: string | URL, + options?: ReadFileOptions, + ): Promise<Uint8Array>; /** A FileInfo describes a file and is returned by `stat`, `lstat`, * `statSync`, `lstatSync`. */ |