mapAsyncIterator.d.ts 413 B

123456789
  1. import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
  2. /**
  3. * Given an AsyncIterable and a callback function, return an AsyncIterator
  4. * which produces values mapped via calling the callback function.
  5. */
  6. export declare function mapAsyncIterator<T, U, R = undefined>(
  7. iterable: AsyncGenerator<T, R, void> | AsyncIterable<T>,
  8. callback: (value: T) => PromiseOrValue<U>,
  9. ): AsyncGenerator<U, R, void>;