1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

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.
This commit is contained in:
Asher Gomez 2023-12-14 04:55:39 +11:00 committed by GitHub
parent 6ebe4c2997
commit a3fc93a4cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1624,6 +1624,9 @@ declare namespace Deno {
* An abstract interface which when implemented provides an interface to read
* bytes into an array buffer asynchronously.
*
* @deprecated Use {@linkcode ReadableStream} instead. {@linkcode Reader}
* will be removed in v2.0.0.
*
* @category I/O */
export interface Reader {
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of
@ -1658,6 +1661,9 @@ declare namespace Deno {
* An abstract interface which when implemented provides an interface to read
* bytes into an array buffer synchronously.
*
* @deprecated Use {@linkcode ReadableStream} instead. {@linkcode ReaderSync}
* will be removed in v2.0.0.
*
* @category I/O */
export interface ReaderSync {
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number
@ -1692,6 +1698,9 @@ declare namespace Deno {
* An abstract interface which when implemented provides an interface to write
* bytes from an array buffer to a file/resource asynchronously.
*
* @deprecated Use {@linkcode WritableStream} instead. {@linkcode Writer}
* will be removed in v2.0.0.
*
* @category I/O */
export interface Writer {
/** Writes `p.byteLength` bytes from `p` to the underlying data stream. It
@ -1716,6 +1725,9 @@ declare namespace Deno {
* An abstract interface which when implemented provides an interface to write
* bytes from an array buffer to a file/resource synchronously.
*
* @deprecated Use {@linkcode WritableStream} instead. {@linkcode WriterSync}
* will be removed in v2.0.0.
*
* @category I/O */
export interface WriterSync {
/** Writes `p.byteLength` bytes from `p` to the underlying data
@ -1734,6 +1746,9 @@ declare namespace Deno {
* An abstract interface which when implemented provides an interface to close
* files/resources that were previously opened.
*
* @deprecated Use {@linkcode ReadableStream} and {@linkcode WritableStream}
* instead. {@linkcode Closer} will be removed in v2.0.0.
*
* @category I/O */
export interface Closer {
/** Closes the resource, "freeing" the backing file/resource. */