Skip to content

Commit

Permalink
feat: adds TypeScript definitions
Browse files Browse the repository at this point in the history
fixes bcoe#195
  • Loading branch information
Toxicable authored Feb 9, 2020
1 parent 8dd26cd commit f85918e
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports.Report = require('./lib/report')
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
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 f85918e

Please sign in to comment.