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 00:24:48 GMT
- Dependencies: none
Credits
These definitions were written by Zachary Svoboda, and Affan Shahid.