index.d.ts 680 B

12345678910111213141516171819202122232425
  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. destroy(): void
  17. applyCoverage(blocks: ReadonlyArray<Profiler.FunctionCoverage>): void
  18. toIstanbul(): CoverageMapData
  19. }
  20. declare function v8ToIstanbul(scriptPath: string, wrapperLength?: number, sources?: Sources, excludePath?: (path: string) => boolean): V8ToIstanbul
  21. export = v8ToIstanbul