-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a set of new functions added in Node 16.7. As the types are now 16.7.1, we can add them. NodeJS docs: https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html#webstreams_utility_consumers
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Duplicates of interface in lib.dom.ts. | ||
// Duplicated here rather than referencing lib.dom.ts because doing so causes lib.dom.ts to be loaded for "test-all" | ||
// Which in turn causes tests to pass that shouldn't pass. | ||
// | ||
// This interface is not, and should not be, exported. | ||
interface Blob { | ||
readonly size: number; | ||
readonly type: string; | ||
arrayBuffer(): Promise<ArrayBuffer>; | ||
slice(start?: number, end?: number, contentType?: string): Blob; | ||
stream(): NodeJS.ReadableStream; | ||
text(): Promise<string>; | ||
} | ||
|
||
declare module 'stream/consumers' { | ||
import { Readable } from 'node:stream'; | ||
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>; | ||
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>; | ||
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>; | ||
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Blob>; | ||
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>; | ||
} | ||
declare module 'node:stream/consumers' { | ||
export * from 'stream/consumers'; | ||
} |
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