@types/merge2

  • Version 1.3.0
  • Published
  • 5.26 kB
  • 1 dependency
  • MIT license

Install

npm i @types/merge2
yarn add @types/merge2
pnpm add @types/merge2

Overview

TypeScript definitions for merge2

Index

Functions

function merge2

merge2: {
(a: Streams, options?: merge2.Options): merge2.Merge2Stream;
(a: any, b: any, options?: merge2.Options): merge2.Merge2Stream;
(a: any, b: any, c: any, options?: merge2.Options): merge2.Merge2Stream;
(a: any, b: any, c: any, d: any, options?: merge2.Options): merge2.Merge2Stream;
(
a: any,
b: any,
c: any,
d: any,
e: any,
options?: merge2.Options
): merge2.Merge2Stream;
(...args: any[]): merge2.Merge2Stream;
};
  • This function takes an arbitrary number of streams and returns a Merge2Stream.

    If a DuplexOption is specified, it has to be specified last in the argument list

    Parameter args

    StreamTypes

    Parameter opts

    Optional DuplexOption to be specified last

    A merged duplex stream

    See Also

    • { https://github.com/teambition/merge2#api }

Interfaces

interface Merge2Stream

interface Merge2Stream extends PassThrough {}

    method add

    add: (...args: Streams[]) => Merge2Stream;
    • Add more streams to an existing merged stream

      Parameter args

      streams to add

      The merged stream

    method on

    on: {
    (event: 'queueDrain', listener: () => void): this;
    (event: string, listener: (...args: any[]) => void): this;
    };
    • It will emit 'queueDrain' when all streams merged. If you set end === false in options, this event give you a notice that you should add more streams to merge, or end the mergedStream.

      Parameter event

      The 'queueDrain' event

      This stream

    method once

    once: {
    (event: 'queueDrain', listener: () => void): this;
    (event: string, listener: (...args: any[]) => void): this;
    };

      interface Options

      interface Options {}

        property end

        end?: boolean;

          property objectMode

          objectMode?: boolean;

            Type Aliases

            type StreamType

            type StreamType = NodeJS.ReadableStream | Merge2Stream;

              Package Files (1)

              Dependencies (1)

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.

              Badge

              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/merge2.

              • Markdown
                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/merge2)
              • HTML
                <a href="https://www.jsdocs.io/package/@types/merge2"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>