npm.io
1.1.7 • Published 2 years ago

@types/callback-to-async-iterator

Licence
MIT
Version
1.1.7
Deps
0
Size
4 kB
Vulns
0
Weekly
0

Installation

npm install --save @types/callback-to-async-iterator

Summary

This package contains type definitions for callback-to-async-iterator (https://github.com/withspectrum/callback-to-async-iterator#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/callback-to-async-iterator.

index.d.ts

export interface AsyncifyOptions<T, R> {
    // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
    onClose?: ((arg: R) => void | T) | undefined;
    onError?: (() => Error) | undefined;
    buffering?: boolean | undefined;
}

export default function callbackToAsyncIterator<T, R = void>(
    listener: (callback: (message: T) => void) => Promise<R>,
    options?: AsyncifyOptions<T, R>,
): AsyncIterableIterator<T>;

Additional Details

  • Last updated: Wed, 22 Nov 2023 0048 GMT
  • Dependencies: none

Credits

These definitions were written by Zachary Svoboda, and Affan Shahid.