summaryrefslogtreecommitdiff
path: root/typings
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2021-06-16 12:44:22 -0700
committerJames M Snell <jasnell@gmail.com>2021-06-30 12:54:41 -0700
commitfa0c6883a65737e0135b107f5e886acbdfb89ec5 (patch)
tree76a40cafaf4c99703d7040a62ca95ba29eeca4a1 /typings
parent52d32bdfbd88d7abd19365daad07b7e7c9f423fd (diff)
downloadnode-new-fa0c6883a65737e0135b107f5e886acbdfb89ec5.tar.gz
stream: implement WHATWG streams
Experimental implementation of the WHATWG streams standard. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/39062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'typings')
-rw-r--r--typings/primordials.d.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/typings/primordials.d.ts b/typings/primordials.d.ts
index 0436e92b1d..beed1d7b83 100644
--- a/typings/primordials.d.ts
+++ b/typings/primordials.d.ts
@@ -1,3 +1,5 @@
+import { AsyncIterator } from "internal/webstreams/util";
+
type UncurryThis<T extends (this: unknown, ...args: unknown[]) => unknown> =
(self: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
type UncurryThisStaticApply<T extends (this: unknown, ...args: unknown[]) => unknown> =
@@ -9,15 +11,15 @@ type StaticApply<T extends (this: unknown, ...args: unknown[]) => unknown> =
* Primordials are a way to safely use globals without fear of global mutation
* Generally, this means removing `this` parameter usage and instead using
* a regular parameter:
- *
+ *
* @example
- *
+ *
* ```js
* 'thing'.startsWith('hello');
* ```
- *
+ *
* becomes
- *
+ *
* ```js
* primordials.StringPrototypeStartsWith('thing', 'hello')
* ```
@@ -142,6 +144,7 @@ declare namespace primordials {
export const ArrayBufferPrototype: typeof ArrayBuffer.prototype
export const ArrayBufferIsView: typeof ArrayBuffer.isView
export const ArrayBufferPrototypeSlice: UncurryThis<typeof ArrayBuffer.prototype.slice>
+ export const AsyncIteratorPrototype: UncurryThis<typeof AsyncIterator>
export const BigInt: typeof globalThis.BigInt;
export const BigIntLength: typeof BigInt.length
export const BigIntName: typeof BigInt.name
@@ -522,5 +525,5 @@ declare namespace primordials {
export const PromiseAny: typeof Promise.any
export const PromisePrototypeThen: UncurryThis<typeof Promise.prototype.then>
export const PromisePrototypeCatch: UncurryThis<typeof Promise.prototype.catch>
- export const PromisePrototypeFinally: UncurryThis<typeof Promise.prototype.finally>
+ export const PromisePrototypeFinally: UncurryThis<typeof Promise.prototype.finally>
}