Skip to content

Commit a3fc93a

Browse files
authored
chore: deprecate Deno.Reader, Deno.ReaderSync, Deno.Writer, Deno.WriterSync and Deno.Closer (#21465)
This change deprecates `Deno.Reader`, `Deno.ReaderSync`, `Deno.Writer`, `Deno.WriterSync` and `Deno.Closer` in favour of the [Web Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API). After discussing with Yoshiya, we both thought now might be the right time to deprecate these interfaces with v2 getting closer.
1 parent 6ebe4c2 commit a3fc93a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cli/tsc/dts/lib.deno.ns.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,9 @@ declare namespace Deno {
16241624
* An abstract interface which when implemented provides an interface to read
16251625
* bytes into an array buffer asynchronously.
16261626
*
1627+
* @deprecated Use {@linkcode ReadableStream} instead. {@linkcode Reader}
1628+
* will be removed in v2.0.0.
1629+
*
16271630
* @category I/O */
16281631
export interface Reader {
16291632
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of
@@ -1658,6 +1661,9 @@ declare namespace Deno {
16581661
* An abstract interface which when implemented provides an interface to read
16591662
* bytes into an array buffer synchronously.
16601663
*
1664+
* @deprecated Use {@linkcode ReadableStream} instead. {@linkcode ReaderSync}
1665+
* will be removed in v2.0.0.
1666+
*
16611667
* @category I/O */
16621668
export interface ReaderSync {
16631669
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number
@@ -1692,6 +1698,9 @@ declare namespace Deno {
16921698
* An abstract interface which when implemented provides an interface to write
16931699
* bytes from an array buffer to a file/resource asynchronously.
16941700
*
1701+
* @deprecated Use {@linkcode WritableStream} instead. {@linkcode Writer}
1702+
* will be removed in v2.0.0.
1703+
*
16951704
* @category I/O */
16961705
export interface Writer {
16971706
/** Writes `p.byteLength` bytes from `p` to the underlying data stream. It
@@ -1716,6 +1725,9 @@ declare namespace Deno {
17161725
* An abstract interface which when implemented provides an interface to write
17171726
* bytes from an array buffer to a file/resource synchronously.
17181727
*
1728+
* @deprecated Use {@linkcode WritableStream} instead. {@linkcode WriterSync}
1729+
* will be removed in v2.0.0.
1730+
*
17191731
* @category I/O */
17201732
export interface WriterSync {
17211733
/** Writes `p.byteLength` bytes from `p` to the underlying data
@@ -1734,6 +1746,9 @@ declare namespace Deno {
17341746
* An abstract interface which when implemented provides an interface to close
17351747
* files/resources that were previously opened.
17361748
*
1749+
* @deprecated Use {@linkcode ReadableStream} and {@linkcode WritableStream}
1750+
* instead. {@linkcode Closer} will be removed in v2.0.0.
1751+
*
17371752
* @category I/O */
17381753
export interface Closer {
17391754
/** Closes the resource, "freeing" the backing file/resource. */

0 commit comments

Comments
 (0)