diff options
Diffstat (limited to 'cli/tsc/dts/lib.deno.ns.d.ts')
-rw-r--r-- | cli/tsc/dts/lib.deno.ns.d.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 83292f2dd..e32b90b41 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -2203,6 +2203,9 @@ declare namespace Deno { * console.log(await Deno.readTextFile("my_file.txt")); // Hello World * ``` * + * @deprecated Use {@linkcode Deno.FsFile.dataSync} instead. + * {@linkcode Deno.fdatasync} will be removed in v2.0.0. + * * @category I/O */ export function fdatasync(rid: number): Promise<void>; @@ -2221,6 +2224,9 @@ declare namespace Deno { * console.log(Deno.readTextFileSync("my_file.txt")); // Hello World * ``` * + * @deprecated Use {@linkcode Deno.FsFile.dataSyncSync} instead. + * {@linkcode Deno.fdatasyncSync} will be removed in v2.0.0. + * * @category I/O */ export function fdatasyncSync(rid: number): void; @@ -2524,6 +2530,38 @@ declare namespace Deno { * ``` */ statSync(): FileInfo; + /** + * Flushes any pending data operations of the given file stream to disk. + * ```ts + * using file = await Deno.open( + * "my_file.txt", + * { read: true, write: true, create: true }, + * ); + * await file.write(new TextEncoder().encode("Hello World")); + * await file.dataSync(); + * console.log(await Deno.readTextFile("my_file.txt")); // Hello World + * ``` + * + * @category I/O + */ + dataSync(): Promise<void>; + /** + * Synchronously flushes any pending data operations of the given file stream + * to disk. + * + * ```ts + * using file = Deno.openSync( + * "my_file.txt", + * { read: true, write: true, create: true }, + * ); + * file.writeSync(new TextEncoder().encode("Hello World")); + * file.dataSyncSync(); + * console.log(Deno.readTextFileSync("my_file.txt")); // Hello World + * ``` + * + * @category I/O + */ + dataSyncSync(): void; /** Close the file. Closing a file when you are finished with it is * important to avoid leaking resources. * |