diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 00000000..02c9e5c6 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,14 @@ +/// + +import { Profiler } from 'inspector' +import { CoverageMapData } from 'istanbul-lib-coverage' + +declare class V8ToIstanbul { + load(): Promise + applyCoverage(blocks: ReadonlyArray): void + toIstanbul(): CoverageMapData +} + +declare function v8ToIstanbul(scriptPath: string, wrapperLength?: number): V8ToIstanbul + +export = v8ToIstanbul diff --git a/package-lock.json b/package-lock.json index 57810cba..aee286dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -159,6 +159,17 @@ "integrity": "sha1-byTuSHMdMRaOpRBhDW3RXl/Jxv8=", "dev": true }, + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==" + }, + "@types/node": { + "version": "12.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz", + "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==", + "dev": true + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", diff --git a/package.json b/package.json index e58d5b91..1fa01645 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.1.3", "description": "convert from v8 coverage format to istanbul's format", "main": "index.js", + "types": "index.d.ts", "scripts": { "snapshot": "TAP_SNAPSHOT=1 tap test/*.js", "test": "c8 --reporter=html --reporter=text tap --no-coverage --no-esm test/*.js", @@ -26,10 +27,12 @@ "author": "Ben Coe ", "license": "ISC", "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.1", "convert-source-map": "^1.6.0", "source-map": "^0.7.3" }, "devDependencies": { + "@types/node": "^12.0.10", "c8": "^5.0.1", "coveralls": "^3.0.4", "should": "^13.2.3",