From b8cf2599242a9d85d03b57d3649ccdf8bce1530e Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 15 Nov 2024 15:54:28 +0100 Subject: feat(fetch): accept async iterables for body (#26882) Reland of #24623, but with a fix for `String` objects. Co-authored-by: crowlkats --- ext/webidl/internal.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ext/webidl/internal.d.ts') 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 @@ -438,6 +438,27 @@ declare module "ext:deno_webidl/00_webidl.js" { opts?: any, ) => T[]; + /** + * Create a converter that converts an async iterable of the inner type. + */ + function createAsyncIterableConverter( + converter: ( + v: V, + prefix?: string, + context?: string, + opts?: any, + ) => T, + ): ( + v: any, + prefix?: string, + context?: string, + opts?: any, + ) => ConvertedAsyncIterable; + + interface ConvertedAsyncIterable extends AsyncIterableIterator { + value: V; + } + /** * Create a converter that converts a Promise of the inner type. */ @@ -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; } -- cgit v1.2.3