• Version 1.7.4
  • Published
  • 4.88 kB
  • 3 dependencies
  • MIT license


npm i @types/istanbul-lib-instrument
yarn add @types/istanbul-lib-instrument
pnpm add @types/istanbul-lib-instrument


TypeScript definitions for istanbul-lib-instrument



function createInstrumenter

createInstrumenter: (options?: Partial<InstrumenterOptions>) => Instrumenter;

    function programVisitor

    programVisitor: (
    types: any,
    sourceFilePath?: string,
    opts?: Partial<VisitorOptions>
    ) => Visitor;

      function readInitialCoverage

      readInitialCoverage: (code: string) => InitialCoverage;


        class Instrumenter

        class Instrumenter {}


          constructor(options?: Partial<InstrumenterOptions>);

            property fileCoverage

            fileCoverage: FileCoverage;

              property opts

              opts: InstrumenterOptions;

                property sourceMap

                sourceMap: any;

                  method instrument

                  instrument: (
                  code: string,
                  filenameOrCallback: string | InstrumenterCallback,
                  callback?: InstrumenterCallback,
                  inputSourceMap?: RawSourceMap
                  ) => void;

                    method instrumentSync

                    instrumentSync: (
                    code: string,
                    filename: string,
                    inputSourceMap?: RawSourceMap
                    ) => string;

                      method lastFileCoverage

                      lastFileCoverage: () => FileCoverageData;

                        method lastSourceMap

                        lastSourceMap: () => RawSourceMap;

                          method normalizeOpts

                          normalizeOpts: (options?: Partial<InstrumenterOptions>) => InstrumenterOptions;


                            interface InitialCoverage

                            interface InitialCoverage {}

                              property coverageData

                              coverageData: any;

                                property gcv

                                gcv: any;

                                  property hash

                                  hash: string;

                                    property path

                                    path: string;

                                      interface InstrumenterOptions

                                      interface InstrumenterOptions {}

                                        property autoWrap

                                        autoWrap: boolean;

                                          property compact

                                          compact: boolean;

                                            property coverageVariable

                                            coverageVariable: string;

                                              property debug

                                              debug: boolean;

                                                property esModules

                                                esModules: boolean;

                                                  property preserveComments

                                                  preserveComments: boolean;

                                                    property produceSourceMap

                                                    produceSourceMap: boolean;

                                                      method sourceMapUrlCallback

                                                      sourceMapUrlCallback: (filename: string, url: string) => void;

                                                        interface Visitor

                                                        interface Visitor {}

                                                          method enter

                                                          enter: (path: string) => void;

                                                            method exit

                                                            exit: (path: string) => { fileCoverage: FileCoverage; sourceMappingURL: string };

                                                              interface VisitorOptions

                                                              interface VisitorOptions {}

                                                                property coverageVariable

                                                                coverageVariable: string;

                                                                  property inputSourceMap

                                                                  inputSourceMap: RawSourceMap;

                                                                    Type Aliases

                                                                    type InstrumenterCallback

                                                                    type InstrumenterCallback = (error: Error | null, code: string) => void;

                                                                      Package Files (1)

                                                                      Dependencies (3)

                                                                      Dev Dependencies (0)

                                                                      No dev dependencies.

                                                                      Peer Dependencies (0)

                                                                      No peer dependencies.


                                                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/istanbul-lib-instrument.

                                                                      • Markdown
                                                                      • HTML
                                                                        <a href="https://www.jsdocs.io/package/@types/istanbul-lib-instrument"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>