1.1.7 • Published 6 months ago
@types/callback-to-async-iterator v1.1.7
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
// Type definitions for callback-to-async-iterator 1.1
// Project: https://github.com/withspectrum/callback-to-async-iterator#readme
// Definitions by: Zachary Svoboda <https://github.com/zacnomore>
// Affan Shahid <https://github.com/affanshahid>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.6
export interface AsyncifyOptions<T, R> {
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: Fri, 29 Oct 2021 19:31:20 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by Zachary Svoboda, and Affan Shahid.