Skip to content

Commit

Permalink
feat: adds TypeScript definitions
Browse files Browse the repository at this point in the history
fixes #195
  • Loading branch information
Toxicable committed Feb 9, 2020
1 parent 6b9af6e commit d39801b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
23 changes: 23 additions & 0 deletions index.d.ts
@@ -0,0 +1,23 @@
export type Watermark = [number, number];

export declare class Report {
constructor(opts: {
exclude?: any[],
include?: any[],
reporter: string[],
reportsDirectory?: string,
tempDirectory?: string,
watermarks?: Partial<{
statements: Watermark;
functions: Watermark;
branches: Watermark;
lines: Watermark;
}>,
omitRelative?: boolean,
wrapperLength?: number,
resolve?: string,
all?: boolean,
})

run(): Promise<void>;
}
1 change: 1 addition & 0 deletions index.js
@@ -0,0 +1 @@
exports.Report = require('./lib/report')
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -2,7 +2,8 @@
"name": "c8",
"version": "7.0.1",
"description": "output coverage reports using Node.js' built in coverage",
"main": "index.js",
"main": "./index.js",
"types": "./index.d.ts",
"bin": "./bin/c8.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -58,6 +59,8 @@
"node": ">=10.12.0"
},
"files": [
"index.js",
"index.d.ts",
"lib",
"bin",
"LICENSE"
Expand Down

0 comments on commit d39801b

Please sign in to comment.