denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.99k stars 5.23k forks source link

Missing `TReturn` and `TNext` generic types in `AsyncIterable<T>` #24837

Open raaymax opened 1 month ago

raaymax commented 1 month ago

current:

interface AsyncIterable<T> {
    [Symbol.asyncIterator](): AsyncIterator<T>;
}

expected type:

interface AsyncIterable<T, TReturn = any, TNext = undefined> {
    [Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
}

version:

deno 1.45.5 (release, aarch64-apple-darwin)
v8 12.7.224.13
typescript 5.5.2
raaymax commented 1 month ago

I guess we need to wait for typescript 5.6 https://github.com/microsoft/TypeScript/blob/b4732bdd6199ec353ec0873f334515f391d80d3b/src/lib/es2018.asynciterable.d.ts#L19-L21