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

1.0.2 • Public • Published

Installation

npm install --save @types/parse-gitignore

Summary

This package contains type definitions for parse-gitignore (https://github.com/jonschlinkert/parse-gitignore).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-gitignore.

index.d.ts

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

/**
 * Parse a .gitignore or .npmignore file into an array of patterns.
 */
declare function gitignore(input: string | Buffer): string[];

declare namespace gitignore {
    /**
     * Pass the contents of a .gitignore file as a string or buffer
     */
    function parse(input: string | Buffer, fn?: FormatLine): State;

    function format(section: Section): string;

    function stringify(sections: Section[], fn?: typeof format): string;

    interface State {
        patterns: string[];
        sections: Section[];
    }

    interface Section {
        readonly name: string;
        readonly patterns: string[];
    }

    interface FormatLine {
        (line: string, section?: Section, state?: State): string;
    }
}

export = gitignore;

Additional Details

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

Credits

These definitions were written by Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/parse-gitignore

Weekly Downloads

37,564

Version

1.0.2

License

MIT

Unpacked Size

4.28 kB

Total Files

5

Last publish

Collaborators

  • types