From 22fba790928841f473d9f46d7b1464989e2dcc5e Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 9 Jan 2024 16:14:28 +1100 Subject: [PATCH] deprecation(io): move types file (#4133) --- archive/_common.ts | 2 +- archive/tar.ts | 2 +- archive/untar.ts | 2 +- io/_test_common.ts | 2 +- io/buf_reader.ts | 2 +- io/buf_reader_test.ts | 2 +- io/buf_writer.ts | 2 +- io/buf_writer_test.ts | 2 +- io/buffer.ts | 2 +- io/copy_n.ts | 2 +- io/limited_reader.ts | 2 +- io/multi_reader.ts | 2 +- io/read_delim.ts | 2 +- io/read_lines.ts | 2 +- io/read_range.ts | 2 +- io/read_range_test.ts | 2 +- io/read_string_delim.ts | 2 +- io/string_writer.ts | 2 +- io/types.d.ts | 14 +-- io/types.ts | 116 ++++++++++++++++++++ streams/copy.ts | 2 +- streams/iterate_reader.ts | 2 +- streams/iterate_reader_test.ts | 2 +- streams/read_all.ts | 2 +- streams/readable_stream_from_reader.ts | 2 +- streams/readable_stream_from_reader_test.ts | 2 +- streams/reader_from_iterable.ts | 2 +- streams/reader_from_stream_reader.ts | 2 +- streams/writable_stream_from_writer.ts | 2 +- streams/writable_stream_from_writer_test.ts | 2 +- streams/write_all.ts | 2 +- streams/writer_from_stream_writer.ts | 2 +- 32 files changed, 152 insertions(+), 38 deletions(-) create mode 100644 io/types.ts diff --git a/archive/_common.ts b/archive/_common.ts index 0f6c427b0..ab0ddeb7e 100644 --- a/archive/_common.ts +++ b/archive/_common.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { PartialReadError } from "../io/buf_reader.ts"; -import type { Reader } from "../io/types.d.ts"; +import type { Reader } from "../io/types.ts"; export interface TarInfo { fileMode?: number; diff --git a/archive/tar.ts b/archive/tar.ts index 5544b167e..b32b55aea 100644 --- a/archive/tar.ts +++ b/archive/tar.ts @@ -35,7 +35,7 @@ import { type TarOptions, ustarStructure, } from "./_common.ts"; -import type { Reader } from "../io/types.d.ts"; +import type { Reader } from "../io/types.ts"; import { MultiReader } from "../io/multi_reader.ts"; import { Buffer } from "../io/buffer.ts"; import { assert } from "../assert/assert.ts"; diff --git a/archive/untar.ts b/archive/untar.ts index 0a597f9cd..12cc2a73d 100644 --- a/archive/untar.ts +++ b/archive/untar.ts @@ -38,7 +38,7 @@ import { ustarStructure, } from "./_common.ts"; import { readAll } from "../streams/read_all.ts"; -import type { Reader } from "../io/types.d.ts"; +import type { Reader } from "../io/types.ts"; /** * Extend TarMeta with the `linkName` property so that readers can access diff --git a/io/_test_common.ts b/io/_test_common.ts index 7c2fb2fa2..a3eca231a 100644 --- a/io/_test_common.ts +++ b/io/_test_common.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import type { Reader } from "./types.d.ts"; +import type { Reader } from "./types.ts"; export const MIN_READ_BUFFER_SIZE = 16; export const bufsizes: number[] = [ diff --git a/io/buf_reader.ts b/io/buf_reader.ts index 57b95fa1d..112109145 100644 --- a/io/buf_reader.ts +++ b/io/buf_reader.ts @@ -8,7 +8,7 @@ import { assert } from "../assert/assert.ts"; import { copy } from "../bytes/copy.ts"; -import type { Reader } from "./types.d.ts"; +import type { Reader } from "./types.ts"; const DEFAULT_BUF_SIZE = 4096; const MIN_BUF_SIZE = 16; diff --git a/io/buf_reader_test.ts b/io/buf_reader_test.ts index aabda41fd..36d5d5cf9 100644 --- a/io/buf_reader_test.ts +++ b/io/buf_reader_test.ts @@ -7,7 +7,7 @@ import { BufferFullError, BufReader, PartialReadError } from "./buf_reader.ts"; import { StringReader } from "./string_reader.ts"; import { bufsizes, MIN_READ_BUFFER_SIZE } from "./_test_common.ts"; import { Buffer } from "./buffer.ts"; -import type { Reader } from "./types.d.ts"; +import type { Reader } from "./types.ts"; import { copy } from "../bytes/copy.ts"; /** OneByteReader returns a Reader that implements diff --git a/io/buf_writer.ts b/io/buf_writer.ts index 108f15ce1..e10f4ddda 100644 --- a/io/buf_writer.ts +++ b/io/buf_writer.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { copy } from "../bytes/copy.ts"; -import type { Writer, WriterSync } from "./types.d.ts"; +import type { Writer, WriterSync } from "./types.ts"; const DEFAULT_BUF_SIZE = 4096; diff --git a/io/buf_writer_test.ts b/io/buf_writer_test.ts index 6a7da9469..fc4d273a3 100644 --- a/io/buf_writer_test.ts +++ b/io/buf_writer_test.ts @@ -7,7 +7,7 @@ import { BufWriter, BufWriterSync } from "./buf_writer.ts"; import { Buffer } from "./buffer.ts"; import { StringWriter } from "./string_writer.ts"; import { bufsizes } from "./_test_common.ts"; -import type { Writer, WriterSync } from "./types.d.ts"; +import type { Writer, WriterSync } from "./types.ts"; Deno.test("bufioWriter", async function () { const data = new Uint8Array(8192); diff --git a/io/buffer.ts b/io/buffer.ts index 3d95667d5..94b95cb32 100644 --- a/io/buffer.ts +++ b/io/buffer.ts @@ -3,7 +3,7 @@ import { assert } from "../assert/assert.ts"; import { copy } from "../bytes/copy.ts"; -import type { Reader, ReaderSync } from "./types.d.ts"; +import type { Reader, ReaderSync } from "./types.ts"; // MIN_READ is the minimum ArrayBuffer size passed to a read call by // buffer.ReadFrom. As long as the Buffer has at least MIN_READ bytes beyond diff --git a/io/copy_n.ts b/io/copy_n.ts index e50e02618..28bf0de93 100644 --- a/io/copy_n.ts +++ b/io/copy_n.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { assert } from "../assert/assert.ts"; -import type { Reader, Writer } from "./types.d.ts"; +import type { Reader, Writer } from "./types.ts"; const DEFAULT_BUFFER_SIZE = 32 * 1024; diff --git a/io/limited_reader.ts b/io/limited_reader.ts index c9c553bd3..84292111e 100644 --- a/io/limited_reader.ts +++ b/io/limited_reader.ts @@ -7,7 +7,7 @@ * `read` returns `null` when `limit` <= `0` or * when the underlying `reader` returns `null`. */ -import type { Reader } from "./types.d.ts"; +import type { Reader } from "./types.ts"; /** * @deprecated (will be removed after 1.0.0) Use the [Web Streams API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Streams_API} instead. diff --git a/io/multi_reader.ts b/io/multi_reader.ts index b8ed9d0d7..2fe5ec8ee 100644 --- a/io/multi_reader.ts +++ b/io/multi_reader.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import type { Reader } from "./types.d.ts"; +import type { Reader } from "./types.ts"; /** * Reader utility for combining multiple readers diff --git a/io/read_delim.ts b/io/read_delim.ts index 4b7d0d0f2..a8b712080 100644 --- a/io/read_delim.ts +++ b/io/read_delim.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { concat } from "../bytes/concat.ts"; -import type { Reader } from "./types.d.ts"; +import type { Reader } from "./types.ts"; /** Generate longest proper prefix which is also suffix array. */ function createLPS(pat: Uint8Array): Uint8Array { diff --git a/io/read_lines.ts b/io/read_lines.ts index af4c24e16..b1c1b0f7a 100644 --- a/io/read_lines.ts +++ b/io/read_lines.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import { type Reader } from "./types.d.ts"; +import { type Reader } from "./types.ts"; import { BufReader } from "./buf_reader.ts"; import { concat } from "../bytes/concat.ts"; diff --git a/io/read_range.ts b/io/read_range.ts index 1d29d0328..1feb0ddb0 100644 --- a/io/read_range.ts +++ b/io/read_range.ts @@ -2,7 +2,7 @@ import { copy as copyBytes } from "../bytes/copy.ts"; import { assert } from "../assert/assert.ts"; -import type { Reader, ReaderSync } from "./types.d.ts"; +import type { Reader, ReaderSync } from "./types.ts"; const DEFAULT_BUFFER_SIZE = 32 * 1024; diff --git a/io/read_range_test.ts b/io/read_range_test.ts index 970f0cf0a..cbe567cbc 100644 --- a/io/read_range_test.ts +++ b/io/read_range_test.ts @@ -8,7 +8,7 @@ import { assertThrows, } from "../assert/mod.ts"; import { readRange, readRangeSync } from "./read_range.ts"; -import type { Closer, Reader, ReaderSync } from "./types.d.ts"; +import type { Closer, Reader, ReaderSync } from "./types.ts"; // N controls how many iterations of certain checks are performed. const N = 100; diff --git a/io/read_string_delim.ts b/io/read_string_delim.ts index 059ad9470..64d7cf719 100644 --- a/io/read_string_delim.ts +++ b/io/read_string_delim.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import { type Reader } from "./types.d.ts"; +import { type Reader } from "./types.ts"; import { readDelim } from "./read_delim.ts"; /** diff --git a/io/string_writer.ts b/io/string_writer.ts index c9f4b176a..4b6698dec 100644 --- a/io/string_writer.ts +++ b/io/string_writer.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import type { Writer, WriterSync } from "./types.d.ts"; +import type { Writer, WriterSync } from "./types.ts"; const decoder = new TextDecoder(); diff --git a/io/types.d.ts b/io/types.d.ts index f84430a61..b132a5cd4 100644 --- a/io/types.d.ts +++ b/io/types.d.ts @@ -4,15 +4,13 @@ /** * See the Contributing > Types section in the README for an explanation of this file. * - * @deprecate (will be removed in 1.0.0) Use the - * [Streams API]{@linkcode https://developer.mozilla.org/en-US/docs/Web/API/Streams_API} - * instead. + * @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/io/types.ts} instead. */ /** * An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously. * - * @deprecated (will be removed in 1.0.0) Use {@linkcode ReadableStream} instead. + * @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/io/types.ts} instead. */ export interface Reader { /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of @@ -43,7 +41,7 @@ export interface Reader { /** * An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously. * - * @deprecated (will be removed in 1.0.0) Use {@linkcode ReadableStream} instead. + * @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/io/types.ts} instead. */ export interface ReaderSync { /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number @@ -73,7 +71,7 @@ export interface ReaderSync { /** * An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously. * - * @deprecated (will be removed in 1.0.0) Use {@linkcode WritableStream} instead. + * @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/io/types.ts} instead. */ export interface Writer { /** Writes `p.byteLength` bytes from `p` to the underlying data stream. It @@ -90,7 +88,7 @@ export interface Writer { /** * An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously. * - * @deprecated (will be removed in 1.0.0) Use {@linkcode WritableStream} instead. + * @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/io/types.ts} instead. */ export interface WriterSync { /** Writes `p.byteLength` bytes from `p` to the underlying data @@ -108,7 +106,7 @@ export interface WriterSync { /** * An abstract interface which when implemented provides an interface to close files/resources that were previously opened. * - * @deprecated (will be removed in 1.0.0) Use {@linkcode ReadableStream} and {@linkcode WritableStream} instead. + * @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/io/types.ts} instead. */ export interface Closer { /** Closes the resource, "freeing" the backing file/resource. */ diff --git a/io/types.ts b/io/types.ts new file mode 100644 index 000000000..f84430a61 --- /dev/null +++ b/io/types.ts @@ -0,0 +1,116 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. + +/** + * See the Contributing > Types section in the README for an explanation of this file. + * + * @deprecate (will be removed in 1.0.0) Use the + * [Streams API]{@linkcode https://developer.mozilla.org/en-US/docs/Web/API/Streams_API} + * instead. + */ + +/** + * An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously. + * + * @deprecated (will be removed in 1.0.0) Use {@linkcode ReadableStream} instead. + */ +export interface Reader { + /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of + * bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error + * encountered. Even if `read()` resolves to `n` < `p.byteLength`, it may + * use all of `p` as scratch space during the call. If some data is + * available but not `p.byteLength` bytes, `read()` conventionally resolves + * to what is available instead of waiting for more. + * + * When `read()` encounters end-of-file condition, it resolves to EOF + * (`null`). + * + * When `read()` encounters an error, it rejects with an error. + * + * Callers should always process the `n` > `0` bytes returned before + * considering the EOF (`null`). Doing so correctly handles I/O errors that + * happen after reading some bytes and also both of the allowed EOF + * behaviors. + * + * Implementations should not retain a reference to `p`. + * + * Use iterateReader() from https://deno.land/std@$STD_VERSION/streams/iterate_reader.ts to turn a Reader into an + * AsyncIterator. + */ + read(p: Uint8Array): Promise; +} + +/** + * An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously. + * + * @deprecated (will be removed in 1.0.0) Use {@linkcode ReadableStream} instead. + */ +export interface ReaderSync { + /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number + * of bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error + * encountered. Even if `read()` returns `n` < `p.byteLength`, it may use + * all of `p` as scratch space during the call. If some data is available + * but not `p.byteLength` bytes, `read()` conventionally returns what is + * available instead of waiting for more. + * + * When `readSync()` encounters end-of-file condition, it returns EOF + * (`null`). + * + * When `readSync()` encounters an error, it throws with an error. + * + * Callers should always process the `n` > `0` bytes returned before + * considering the EOF (`null`). Doing so correctly handles I/O errors that happen + * after reading some bytes and also both of the allowed EOF behaviors. + * + * Implementations should not retain a reference to `p`. + * + * Use iterateReaderSync() from https://deno.land/std@$STD_VERSION/streams/iterate_reader.ts to turn a ReaderSync + * into an Iterator. + */ + readSync(p: Uint8Array): number | null; +} + +/** + * An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously. + * + * @deprecated (will be removed in 1.0.0) Use {@linkcode WritableStream} instead. + */ +export interface Writer { + /** Writes `p.byteLength` bytes from `p` to the underlying data stream. It + * resolves to the number of bytes written from `p` (`0` <= `n` <= + * `p.byteLength`) or reject with the error encountered that caused the + * write to stop early. `write()` must reject with a non-null error if + * would resolve to `n` < `p.byteLength`. `write()` must not modify the + * slice data, even temporarily. + * + * Implementations should not retain a reference to `p`. + */ + write(p: Uint8Array): Promise; +} +/** + * An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously. + * + * @deprecated (will be removed in 1.0.0) Use {@linkcode WritableStream} instead. + */ +export interface WriterSync { + /** Writes `p.byteLength` bytes from `p` to the underlying data + * stream. It returns the number of bytes written from `p` (`0` <= `n` + * <= `p.byteLength`) and any error encountered that caused the write to + * stop early. `writeSync()` must throw a non-null error if it returns `n` < + * `p.byteLength`. `writeSync()` must not modify the slice data, even + * temporarily. + * + * Implementations should not retain a reference to `p`. + */ + writeSync(p: Uint8Array): number; +} + +/** + * An abstract interface which when implemented provides an interface to close files/resources that were previously opened. + * + * @deprecated (will be removed in 1.0.0) Use {@linkcode ReadableStream} and {@linkcode WritableStream} instead. + */ +export interface Closer { + /** Closes the resource, "freeing" the backing file/resource. */ + close(): void; +} diff --git a/streams/copy.ts b/streams/copy.ts index bf80c0570..fff276655 100644 --- a/streams/copy.ts +++ b/streams/copy.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { DEFAULT_BUFFER_SIZE } from "./_common.ts"; -import type { Reader, Writer } from "../io/types.d.ts"; +import type { Reader, Writer } from "../io/types.ts"; /** * Copies from `src` to `dst` until either EOF (`null`) is read from `src` or diff --git a/streams/iterate_reader.ts b/streams/iterate_reader.ts index a47593214..f97a8de46 100644 --- a/streams/iterate_reader.ts +++ b/streams/iterate_reader.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { DEFAULT_BUFFER_SIZE } from "./_common.ts"; -import type { Reader, ReaderSync } from "../io/types.d.ts"; +import type { Reader, ReaderSync } from "../io/types.ts"; export type { Reader, ReaderSync }; diff --git a/streams/iterate_reader_test.ts b/streams/iterate_reader_test.ts index 3f001a447..130327ee3 100644 --- a/streams/iterate_reader_test.ts +++ b/streams/iterate_reader_test.ts @@ -4,7 +4,7 @@ import { assertEquals } from "../assert/mod.ts"; import { iterateReader, iterateReaderSync } from "./iterate_reader.ts"; import { readerFromIterable } from "./reader_from_iterable.ts"; import { delay } from "../async/delay.ts"; -import type { Reader, ReaderSync } from "../io/types.d.ts"; +import type { Reader, ReaderSync } from "../io/types.ts"; Deno.test("iterateReader", async () => { // ref: https://github.com/denoland/deno/issues/2330 diff --git a/streams/read_all.ts b/streams/read_all.ts index 6d40f2307..42c6a2cd3 100644 --- a/streams/read_all.ts +++ b/streams/read_all.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { Buffer } from "../io/buffer.ts"; -import type { Reader, ReaderSync } from "../io/types.d.ts"; +import type { Reader, ReaderSync } from "../io/types.ts"; /** * Read {@linkcode Reader} `r` until EOF (`null`) and resolve to the content as diff --git a/streams/readable_stream_from_reader.ts b/streams/readable_stream_from_reader.ts index d3139bb7e..e825823db 100644 --- a/streams/readable_stream_from_reader.ts +++ b/streams/readable_stream_from_reader.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { DEFAULT_CHUNK_SIZE } from "./_common.ts"; -import type { Closer, Reader } from "../io/types.d.ts"; +import type { Closer, Reader } from "../io/types.ts"; export type { Closer }; function isCloser(value: unknown): value is Closer { diff --git a/streams/readable_stream_from_reader_test.ts b/streams/readable_stream_from_reader_test.ts index 7f0adc131..5b712a223 100644 --- a/streams/readable_stream_from_reader_test.ts +++ b/streams/readable_stream_from_reader_test.ts @@ -5,7 +5,7 @@ import { readableStreamFromReader } from "./readable_stream_from_reader.ts"; import { Buffer } from "../io/buffer.ts"; import { concat } from "../bytes/concat.ts"; import { copy } from "../bytes/copy.ts"; -import type { Closer, Reader } from "../io/types.d.ts"; +import type { Closer, Reader } from "../io/types.ts"; class MockReaderCloser implements Reader, Closer { chunks: Uint8Array[] = []; diff --git a/streams/reader_from_iterable.ts b/streams/reader_from_iterable.ts index 82f06f031..a79355d89 100644 --- a/streams/reader_from_iterable.ts +++ b/streams/reader_from_iterable.ts @@ -3,7 +3,7 @@ import { Buffer } from "../io/buffer.ts"; import { writeAll } from "./write_all.ts"; -import { Reader } from "../io/types.d.ts"; +import { Reader } from "../io/types.ts"; /** * Create a {@linkcode Reader} from an iterable of {@linkcode Uint8Array}s. diff --git a/streams/reader_from_stream_reader.ts b/streams/reader_from_stream_reader.ts index 56988664a..617dfc032 100644 --- a/streams/reader_from_stream_reader.ts +++ b/streams/reader_from_stream_reader.ts @@ -3,7 +3,7 @@ import { Buffer } from "../io/buffer.ts"; import { writeAll } from "./write_all.ts"; -import type { Reader } from "../io/types.d.ts"; +import type { Reader } from "../io/types.ts"; /** * Create a {@linkcode Reader} from a {@linkcode ReadableStreamDefaultReader}. diff --git a/streams/writable_stream_from_writer.ts b/streams/writable_stream_from_writer.ts index d072d1c3c..b82ed7f8a 100644 --- a/streams/writable_stream_from_writer.ts +++ b/streams/writable_stream_from_writer.ts @@ -2,7 +2,7 @@ // This module is browser compatible. import { writeAll } from "./write_all.ts"; -import type { Closer, Writer } from "../io/types.d.ts"; +import type { Closer, Writer } from "../io/types.ts"; function isCloser(value: unknown): value is Closer { return typeof value === "object" && value !== null && value !== undefined && diff --git a/streams/writable_stream_from_writer_test.ts b/streams/writable_stream_from_writer_test.ts index 31cca9aff..555db1b60 100644 --- a/streams/writable_stream_from_writer_test.ts +++ b/streams/writable_stream_from_writer_test.ts @@ -2,7 +2,7 @@ import { assertEquals } from "../assert/mod.ts"; import { writableStreamFromWriter } from "./writable_stream_from_writer.ts"; -import type { Closer, Writer } from "../io/types.d.ts"; +import type { Closer, Writer } from "../io/types.ts"; class MockWriterCloser implements Writer, Closer { chunks: Uint8Array[] = []; diff --git a/streams/write_all.ts b/streams/write_all.ts index 2b27a0290..20a107598 100644 --- a/streams/write_all.ts +++ b/streams/write_all.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import type { Writer, WriterSync } from "../io/types.d.ts"; +import type { Writer, WriterSync } from "../io/types.ts"; export type { Writer, WriterSync }; /** diff --git a/streams/writer_from_stream_writer.ts b/streams/writer_from_stream_writer.ts index 9592d9467..cfa284e5a 100644 --- a/streams/writer_from_stream_writer.ts +++ b/streams/writer_from_stream_writer.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import type { Writer } from "../io/types.d.ts"; +import type { Writer } from "../io/types.ts"; /** * Create a {@linkcode Writer} from a {@linkcode WritableStreamDefaultWriter}.