@types/map-stream

TypeScript definitions for map-stream

  • Types
  • ESM
  • CJS
License
MIT
Install Size
4.1 kB(2.5 MB)
Vulns
0
Published

Get started

$npm install @types/map-stream
$pnpm add @types/map-stream
$yarn add @types/map-stream
$bun add @types/map-stream
$deno add npm:@types/map-stream
$vlt install @types/map-stream
$vp add @types/map-stream
# Usually installed as a dev dependency
$npm install -D @types/map-stream
$pnpm add -D @types/map-stream
$yarn add -D @types/map-stream
$bun add -d @types/map-stream
$deno add -D npm:@types/map-stream
$vlt install -D @types/map-stream
$vp add -D @types/map-stream

Weekly DownloadsAcross all versions

Versions

View all versions
0.0.3
latestts4.5ts4.6ts4.7ts4.8ts4.9ts5.0ts5.1ts5.2ts5.3ts5.4ts5.5ts5.6ts5.7ts5.8ts5.9ts6.0

Readme

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.