-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecation(io): move types file #4133
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<number | null>; | ||
} | ||
|
||
/** | ||
* 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<number>; | ||
} | ||
/** | ||
* 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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: remove this and other instances if we bring back
std/io
.