summaryrefslogtreecommitdiff
path: root/ext/webidl/internal.d.ts
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-11-15 15:54:28 +0100
committerGitHub <noreply@github.com>2024-11-15 15:54:28 +0100
commitb8cf2599242a9d85d03b57d3649ccdf8bce1530e (patch)
tree87a6288f2174aa6d22730a9ec020292b778c9dca /ext/webidl/internal.d.ts
parent3f26310728ef2d56ace7370a555eb9a862295983 (diff)
feat(fetch): accept async iterables for body (#26882)
Reland of #24623, but with a fix for `String` objects. Co-authored-by: crowlkats <crowlkats@toaxl.com>
Diffstat (limited to 'ext/webidl/internal.d.ts')
-rw-r--r--ext/webidl/internal.d.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/webidl/internal.d.ts b/ext/webidl/internal.d.ts
index 1ce45463e..375d548d3 100644
--- a/ext/webidl/internal.d.ts
+++ b/ext/webidl/internal.d.ts
@@ -439,6 +439,27 @@ declare module "ext:deno_webidl/00_webidl.js" {
) => T[];
/**
+ * Create a converter that converts an async iterable of the inner type.
+ */
+ function createAsyncIterableConverter<V, T>(
+ converter: (
+ v: V,
+ prefix?: string,
+ context?: string,
+ opts?: any,
+ ) => T,
+ ): (
+ v: any,
+ prefix?: string,
+ context?: string,
+ opts?: any,
+ ) => ConvertedAsyncIterable<V, T>;
+
+ interface ConvertedAsyncIterable<V, T> extends AsyncIterableIterator<T> {
+ value: V;
+ }
+
+ /**
* Create a converter that converts a Promise of the inner type.
*/
function createPromiseConverter<T>(
@@ -559,4 +580,9 @@ declare module "ext:deno_webidl/00_webidl.js" {
| "Symbol"
| "BigInt"
| "Object";
+
+ /**
+ * Check whether a value is an async iterable.
+ */
+ function isAsyncIterable(v: any): boolean;
}