@types/map-stream
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Installation

npm install --save @types/map-stream

Summary

This package contains type definitions for map-stream (http://github.com/dominictarr/map-stream).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/map-stream.

index.d.ts

/// <reference types="node"/>

import { Stream } from "stream";

export = mapStream;

declare namespace mapStream {
    interface Options {
        /**
         * Continue mapping even if error occured.
         *
         * On error `map-stream` will emit `failure` event.
         *
         * @default false
         */
        failures?: boolean;
    }

    interface mapStream extends Stream {
        resume(): void;
        pause(): void;
        destroy(): void;
        end(): void;
        write(): boolean | never;
    }

    type Callback = (err: null | Error, data: unknown) => void;
}

declare function mapStream(
    mapper: (data: unknown, callback: mapStream.Callback) => void,
    opts?: mapStream.Options,
): mapStream.mapStream;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Konrad Perlicki.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/map-stream

Weekly Downloads

1,972

Version

0.0.3

License

MIT

Unpacked Size

4.15 kB

Total Files

5

Last publish

Collaborators

  • types