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

4.2.36 • Public • Published

Installation

npm install --save @types/byline

Summary

This package contains type definitions for byline (https://github.com/jahewson/node-byline).

Details

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

index.d.ts

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

import stream = require("stream");
declare function bl(): bl.LineStream;
declare function bl(stream: NodeJS.ReadableStream, options?: bl.LineStreamOptions): bl.LineStream;

declare namespace bl {
    export interface LineStreamOptions extends stream.TransformOptions {
        keepEmptyLines?: boolean | undefined;
    }

    export interface LineStream extends stream.Transform {
    }

    export interface LineStreamCreatable extends LineStream {
        new(options?: LineStreamOptions): LineStream;
    }

    // TODO is it possible to declare static factory functions without name (directly on the module)
    //
    // JS:
    // // convinience API
    // module.exports = function(readStream, options) {
    //      return module.exports.createStream(readStream, options);
    // };
    //
    // TS:
    // ():LineStream; // same as createStream():LineStream
    // (stream:stream.Stream, options?:LineStreamOptions):LineStream; // same as createStream(stream, options?):LineStream

    export function createStream(): LineStream;
    export function createStream(stream: NodeJS.ReadableStream, options?: LineStreamOptions): LineStream;

    export var LineStream: LineStreamCreatable;
}

export = bl;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Stefan Steinhart.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/byline

Weekly Downloads

14,906

Version

4.2.36

License

MIT

Unpacked Size

5.09 kB

Total Files

5

Last publish

Collaborators

  • types