Neoteric Plumbing Mishap

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

    0.1.2 • Public • Published

    Installation

    npm install --save @types/jsonlines

    Summary

    This package contains type definitions for jsonlines (https://github.com/LinusU/node-jsonlines#readme).

    Details

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

    index.d.ts

    // Type definitions for jsonlines 0.1
    // Project: https://github.com/LinusU/node-jsonlines#readme
    // Definitions by: Raine Revere <https://github.com/raineorshine>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <reference types="node" />
    
    import { Transform } from 'stream';
    
    export interface Options {
        emitInvalidLines?: boolean | undefined;
    }
    
    /** A transform stream that turns newline separated json into a stream of javascript values. */
    export class Parser extends Transform {
        // inherited (must re-declare since this is a class)
        on(event: 'close' | 'end' | 'pause' | 'readable' | 'resume', listener: () => void): this;
        // added 'invalid-line'
        on(event: 'error' | 'invalid-line', listener: (err: Error) => void): this;
        // changed
        on(event: 'data', listener: (data: any) => void): this;
        // inherited
        on(event: string | symbol, listener: (...args: any[]) => void): this;
    }
    
    /** A transform stream that turns javascript values into a stream of newline separated json. */
    export class Stringifier extends Transform {
        // inherited (must re-declare since this is a class)
        on(event: 'close' | 'end' | 'pause' | 'readable' | 'resume', listener: () => void): this;
        on(event: 'error', listener: (err: Error) => void): this;
        // changed
        on(event: 'data', listener: (data: any) => void): this;
        // inherited
        on(event: string | symbol, listener: (...args: any[]) => void): this;
    }
    
    /** Returns a transform stream that turns newline separated json into a stream of javascript values. */
    export function parse(options?: Options): Parser;
    
    /** Returns a transform stream that turns javascript values into a stream of newline separated json. */
    export function stringify(): Stringifier;

    Additional Details

    • Last updated: Thu, 19 May 2022 16:31:36 GMT
    • Dependencies: @types/node
    • Global values: none

    Credits

    These definitions were written by Raine Revere.

    Keywords

    none

    Install

    npm i @types/jsonlines

    DownloadsWeekly Downloads

    796

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    6.18 kB

    Total Files

    4

    Last publish

    Collaborators

    • types