@types/callback-to-async-iterator
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/callback-to-async-iterator

Weekly Downloads

406

Version

1.1.7

License

MIT

Unpacked Size

3.78 kB

Total Files

5

Last publish

Collaborators

  • types