summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno.ns.d.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-05-11 10:13:33 +0800
committerGitHub <noreply@github.com>2021-05-11 11:13:33 +0900
commit2b8376db2445a6b0643b753a12860ee7db9012a3 (patch)
treeb03780340a28e3706f7644d3acd74ad9ade78255 /cli/dts/lib.deno.ns.d.ts
parent60c172cccb32eb5615e9a2060adfa6c358883f37 (diff)
docs(cli/dts): fix Deno.seek and Deno.seekSync examples (#10568)
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r--cli/dts/lib.deno.ns.d.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index 535bae4aa..ebdf8097e 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -651,6 +651,7 @@ declare namespace Deno {
* ```ts
* const file = Deno.openSync('hello.txt', {read: true, write: true, truncate: true, create: true});
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello world"));
+ *
* // advance cursor 6 bytes
* const cursorPosition = Deno.seekSync(file.rid, 6, Deno.SeekMode.Start);
* console.log(cursorPosition); // 6
@@ -663,6 +664,9 @@ declare namespace Deno {
*
* ```ts
* // Given file.rid pointing to file with "Hello world", which is 11 bytes long:
+ * const file = Deno.openSync('hello.txt', {read: true, write: true, truncate: true, create: true});
+ * Deno.writeSync(file.rid, new TextEncoder().encode("Hello world"));
+ *
* // Seek 6 bytes from the start of the file
* console.log(Deno.seekSync(file.rid, 6, Deno.SeekMode.Start)); // "6"
* // Seek 2 more bytes from the current position
@@ -681,8 +685,10 @@ declare namespace Deno {
* The call resolves to the new position within the resource (bytes from the start).
*
* ```ts
+ * // Given file.rid pointing to file with "Hello world", which is 11 bytes long:
* const file = await Deno.open('hello.txt', {read: true, write: true, truncate: true, create: true});
* await Deno.write(file.rid, new TextEncoder().encode("Hello world"));
+ *
* // advance cursor 6 bytes
* const cursorPosition = await Deno.seek(file.rid, 6, Deno.SeekMode.Start);
* console.log(cursorPosition); // 6
@@ -695,6 +701,9 @@ declare namespace Deno {
*
* ```ts
* // Given file.rid pointing to file with "Hello world", which is 11 bytes long:
+ * const file = await Deno.open('hello.txt', {read: true, write: true, truncate: true, create: true});
+ * await Deno.write(file.rid, new TextEncoder().encode("Hello world"));
+ *
* // Seek 6 bytes from the start of the file
* console.log(await Deno.seek(file.rid, 6, Deno.SeekMode.Start)); // "6"
* // Seek 2 more bytes from the current position