File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818### Added
1919
2020* [ Python] Added collection protocol markers and interfaces for Python interop (by @dbrattli )
21+ * [ JS] Add ` AsyncIterator ` , ` AsyncGenerator ` , and ` IteratorResult ` interfaces for the AsyncIterator protocol (by @Lanayx )
2122
2223### Fixed
2324
Original file line number Diff line number Diff line change @@ -395,6 +395,22 @@ module JS =
395395 and [<AllowNullLiteral>] AsyncIterable < 'T > =
396396 inherit AsyncIterable
397397
398+ [<Emit( " $0[Symbol.asyncIterator]()" ) >]
399+ abstract asyncIterator: unit -> AsyncIterator < 'T >
400+
401+ and [<AllowNullLiteral>] IteratorResult < 'T > =
402+ abstract value: 'T with get, set
403+ abstract ``done``: bool with get, set
404+
405+ and [<AllowNullLiteral>] AsyncIterator < 'T > =
406+ abstract next: unit -> Promise < IteratorResult < 'T >>
407+ abstract ``return``: value : 'T -> Promise < IteratorResult < 'T >>
408+ abstract throw: e : obj -> Promise < IteratorResult < 'T >>
409+
410+ and [<AllowNullLiteral>] AsyncGenerator < 'T > =
411+ inherit AsyncIterator< 'T>
412+ inherit AsyncIterable< 'T>
413+
398414 and [<AllowNullLiteral>] Promise < 'T > =
399415 abstract ``then``: ? onfulfilled : ( 'T -> 'TResult ) * ? onrejected : ( obj -> 'TResult ) -> Promise < 'TResult >
400416
You can’t perform that action at this time.
0 commit comments