iterator-helper
Version:
Provide helpers that polyfill all methods defined in [iterator helpers proposal](https://github.com/tc39/proposal-iterator-helpers), both for `Iterator` and `AsyncIterator`, and even more.
6 lines (5 loc) • 415 B
TypeScript
import { HIterator } from './iterator';
import { HAsyncIterator } from './async-iterator';
import { Parameters } from './types';
export declare function wrap<It, T, R>(func: (...args: Parameters<T, R>) => R): (this: any, ...args: any) => HIterator<It, any, undefined>;
export declare function awrap<It, T, R>(func: (...args: Parameters<T, R>) => R): (this: any, ...args: any) => HAsyncIterator<It, any, undefined>;