diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 8759306dfe..cc069ed989 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -2100,6 +2100,9 @@ declare namespace Deno { * console.log(await Deno.seek(file.rid, -2, Deno.SeekMode.End)); // "9" (i.e. 11-2) * ``` * + * @deprecated Use `file.seek()` instead. {@linkcode Deno.seek} will be + * removed in Deno 2.0. + * * @category I/O */ export function seek( @@ -2145,6 +2148,9 @@ declare namespace Deno { * console.log(Deno.seekSync(file.rid, -2, Deno.SeekMode.End)); // "9" (i.e. 11-2) * ``` * + * @deprecated Use `file.seekSync()` instead. {@linkcode Deno.seekSync} + * will be removed in Deno 2.0. + * * @category I/O */ export function seekSync( diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 452c62725d..24e73d30e7 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -109,8 +109,22 @@ const denoNs = { stdin: io.stdin, stdout: io.stdout, stderr: io.stderr, - seek: fs.seek, - seekSync: fs.seekSync, + seek(rid, offset, whence) { + internals.warnOnDeprecatedApi( + "Deno.seek()", + new Error().stack, + "Use `file.seek()` instead.", + ); + return fs.seek(rid, offset, whence); + }, + seekSync(rid, offset, whence) { + internals.warnOnDeprecatedApi( + "Deno.seekSync()", + new Error().stack, + "Use `file.seekSync()` instead.", + ); + return fs.seekSync(rid, offset, whence); + }, connect: net.connect, listen: net.listen, loadavg: os.loadavg,