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

1.0.2 • Public • Published

Installation

npm install --save @types/lcov-parse

Summary

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

Details

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

index.d.ts

declare namespace parse {
    /**
     * Line coverage detail
     */
    interface LcovLine {
        line: number;
        hit: number;
    }
    /**
     * Function coverage detail
     */
    interface LcovFunc {
        name: string;
        line: number;
        hit: number;
    }
    /**
     * Branch coverage detail
     */
    interface LcovBranch {
        line: number;
        block: number;
        branch: number;
        taken: number;
    }
    /**
     * Code coverage for lines, functions or branches in a file
     */
    interface LcovPart<T> {
        hit: number;
        found: number;
        details: T[];
    }
    /**
     * Code coverage for a file
     */
    interface LcovFile {
        title: string;
        file: string;
        lines: LcovPart<LcovLine>;
        functions: LcovPart<LcovFunc>;
        branches: LcovPart<LcovBranch>;
    }
    /**
     * Parses an LCOV code coverage string:
     * ```
     *  parse(lcovString, function(err, data) {
     *      //process the data here
     *  });
     * ```
     *
     * @param str LCOV string to parse
     * @param cb Callback: first arg is `null` or error string,
     *                     second arg is parsed data or `undefined` if an error occurred
     */
    function source(str: string, cb: (err: null | string, data: LcovFile[] | undefined) => void): void;
}

/**
 * Parses an LCOV code coverage file:
 * ```
 *  parse('./path/to/file.info', function(err, data) {
 *      //process the data here
 *  });
 * ```
 *
 * The first argument can also be an LCOV string to parse:
 * ```
 *  parse(lcovString, function(err, data) {
 *      //process the data here
 *  });
 * ```
 *
 * @param file Path to the LCOV file or string to parse
 * @param cb Callback: first arg is `null` or error string,
 *                     second arg is parsed data or `undefined` if an error occurred
 */
declare function parse(file: string, cb: (err: null | string, data: parse.LcovFile[] | undefined) => void): void;

export = parse;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: none

Credits

These definitions were written by Rouslan Placella.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/lcov-parse

Weekly Downloads

2,183

Version

1.0.2

License

MIT

Unpacked Size

6.57 kB

Total Files

5

Last publish

Collaborators

  • types