UNPKG

2.07 kBTypeScriptView Raw
1// Type definitions for gulp-istanbul v0.9.0
2// Project: https://github.com/SBoudrias/gulp-istanbul
3// Definitions by: Asana <https://asana.com>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node"/>
7
8
9declare function GulpIstanbul(opts?: GulpIstanbul.Options): NodeJS.ReadWriteStream;
10
11declare namespace GulpIstanbul {
12 export function hookRequire(): NodeJS.ReadWriteStream;
13 export function summarizeCoverage(opts?: { coverageVariable?: string | undefined }): Coverage;
14 export function writeReports(opts?: ReportOptions): NodeJS.ReadWriteStream;
15 export function enforceThresholds(opts?: ThresholdOptions): NodeJS.ReadWriteStream;
16
17 interface Options {
18 coverageVariable?: string | undefined;
19 includeUntested?: boolean | undefined;
20 embedSource?: boolean | undefined;
21 preserveComments?: boolean | undefined;
22 noCompact?: boolean | undefined;
23 noAutoWrap?: boolean | undefined;
24 codeGenerationOptions?: Object | undefined;
25 debug?: boolean | undefined;
26 walkDebug?: boolean | undefined;
27 }
28
29 interface Coverage {
30 lines: CoverageStats;
31 statements: CoverageStats;
32 functions: CoverageStats;
33 branches: CoverageStats;
34 }
35
36 interface CoverageStats {
37 total: number;
38 covered: number;
39 skipped: number;
40 pct: number;
41 }
42
43 interface ReportOptions {
44 dir?: string | undefined;
45 reporters?: string[] | undefined;
46 reportOpts?: { dir?: string | undefined } | undefined;
47 coverageVariable?: string | undefined;
48 }
49
50 interface ThresholdOptions {
51 coverageVariable?: string | undefined;
52 thresholds?: { global?: CoverageOptions | number | undefined; each?: CoverageOptions | number | undefined } | undefined;
53 }
54
55 interface CoverageOptions {
56 lines?: number | undefined;
57 statements?: number | undefined;
58 functions?: number | undefined;
59 branches?: number | undefined;
60 }
61}
62
63export = GulpIstanbul;