index.d.ts 662 B

123456789101112131415161718192021222324
  1. /// <reference types="node" />
  2. import { Profiler } from 'inspector'
  3. import { CoverageMapData } from 'istanbul-lib-coverage'
  4. import { RawSourceMap } from 'source-map'
  5. declare type Sources =
  6. | {
  7. source: string
  8. }
  9. | {
  10. source: string
  11. originalSource: string
  12. sourceMap: { sourcemap: RawSourceMap }
  13. }
  14. declare class V8ToIstanbul {
  15. load(): Promise<void>
  16. applyCoverage(blocks: ReadonlyArray<Profiler.FunctionCoverage>): void
  17. toIstanbul(): CoverageMapData
  18. }
  19. declare function v8ToIstanbul(scriptPath: string, wrapperLength?: number, sources?: Sources, excludePath?: (path: string) => boolean): V8ToIstanbul
  20. export = v8ToIstanbul