Socket
Socket
Sign inDemoInstall

@types/from2

Package Overview
Dependencies
2
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/from2

TypeScript definitions for from2


Version published
Weekly downloads
5.1K
decreased by-2.4%
Maintainers
1
Install size
3.82 MB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/from2

Summary

This package contains type definitions for from2 (https://github.com/hughsk/from2).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/from2.

index.d.ts

/// <reference types="node" />
import * as stream from "stream";

export = from2;

declare function from2(read: from2.ReadInput): from2.Stream;
declare function from2(opts: from2.ObjectModeOptions, read: from2.ReadObjectInput): from2.Stream;
declare function from2(opts: from2.Options, read: from2.ReadInput): from2.Stream;

declare namespace from2 {
    interface Stream extends NodeJS.ReadableStream {
        readonly destroyed: boolean;
        destroy: (err?: Error) => void;
    }
    function obj(read: ReadObjectInput): Stream;
    function obj(opts: { objectMode?: true | undefined } & stream.ReadableOptions, read: ReadObjectInput): Stream;

    function ctor(opts?: Options): From2Ctor<ReadInput>;
    function ctor(opts: ObjectModeOptions): From2Ctor<ReadObjectInput>;

    type ObjectModeOptions = { objectMode: true } & stream.ReadableOptions;
    type Options = { objectMode?: false | undefined } & stream.ReadableOptions;

    type From2Ctor<R extends ReadInput | ReadObjectInput> = new(read: R) => Stream;

    type ReadObjectInput = ReadCallback<NextObjectCallback> | any[];
    type ReadInput = ReadCallback<NextCallback> | Chunk[];
    type ReadCallback<N extends NextCallback | NextObjectCallback> = (size: number, next: N) => void;
    type NextCallback = (err: any | undefined, chunk: Chunk) => void;
    type NextObjectCallback = (err: any | undefined, chunk: any) => void;
    type Chunk = string | Buffer | Uint8Array | null;
}

Additional Details

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

Credits

These definitions were written by BendingBender.

FAQs

Last updated on 07 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc