@types/pipes-and-filters
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Installation

npm install --save @types/pipes-and-filters

Summary

This package contains type definitions for pipes-and-filters (https://github.com/slashdotdash/node-pipes-and-filters).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pipes-and-filters.

index.d.ts

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

import { EventEmitter } from "events";

export type NextFunction<TOutput> = (err?: Error | null, result?: TOutput) => void;
export type Filter<TInput = any, TOutput = any> = (input: TInput, next: NextFunction<TOutput>) => void;
export type Predicate<TInput = any> = (input: TInput) => boolean;

export class Pipeline<TInput, TOutput> extends EventEmitter {
    static break: any;
    static breakIf(predicate: Predicate): Filter;

    use(filter: Filter, context?: any): Pipeline<TInput, TOutput>;
    breakIf(predicate: Predicate): Pipeline<TInput, TOutput>;
    execute(input: TInput, done: NextFunction<TOutput>): void;
    wireupEvents(done: NextFunction<TOutput>): void;
}

// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function create<TInput, TOutput>(name: string): Pipeline<TInput, TOutput>;
export function breakIf(predicate: Predicate): Filter;

Additional Details

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

Credits

These definitions were written by Alvaro Nicoli, and Federico Banchero.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/pipes-and-filters

Weekly Downloads

15

Version

0.0.5

License

MIT

Unpacked Size

4.73 kB

Total Files

5

Last publish

Collaborators

  • types