1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Node, ReportBase } from 'istanbul-lib-report';
|
9 |
|
10 | export function create<T extends keyof ReportOptions>(name: T, options?: Partial<ReportOptions[T]>): ReportBase;
|
11 |
|
12 | export interface FileOptions {
|
13 | file: string;
|
14 | }
|
15 |
|
16 | export interface ProjectOptions {
|
17 | projectRoot: string;
|
18 | }
|
19 |
|
20 | export interface ReportOptions {
|
21 | clover: CloverOptions;
|
22 | cobertura: CoberturaOptions;
|
23 | 'html-spa': HtmlSpaOptions;
|
24 | html: HtmlOptions;
|
25 | json: JsonOptions;
|
26 | 'json-summary': JsonSummaryOptions;
|
27 | lcov: LcovOptions;
|
28 | lcovonly: LcovOnlyOptions;
|
29 | none: never;
|
30 | teamcity: TeamcityOptions;
|
31 | text: TextOptions;
|
32 | 'text-lcov': TextLcovOptions;
|
33 | 'text-summary': TextSummaryOptions;
|
34 | }
|
35 |
|
36 | export type ReportType = keyof ReportOptions;
|
37 |
|
38 | export interface CloverOptions extends FileOptions, ProjectOptions {}
|
39 |
|
40 | export interface CoberturaOptions extends FileOptions, ProjectOptions {}
|
41 |
|
42 | export interface HtmlSpaOptions extends HtmlOptions {
|
43 | metricsToShow: Array<'lines' | 'branches' | 'functions' | 'statements'>;
|
44 | }
|
45 | export interface HtmlOptions {
|
46 | verbose: boolean;
|
47 | skipEmpty: boolean;
|
48 | subdir: string;
|
49 | linkMapper: LinkMapper;
|
50 | }
|
51 |
|
52 | export type JsonOptions = FileOptions;
|
53 | export type JsonSummaryOptions = FileOptions;
|
54 |
|
55 | export interface LcovOptions extends FileOptions, ProjectOptions {}
|
56 | export interface LcovOnlyOptions extends FileOptions, ProjectOptions {}
|
57 |
|
58 | export interface TeamcityOptions extends FileOptions {
|
59 | blockName: string;
|
60 | }
|
61 |
|
62 | export interface TextOptions extends FileOptions {
|
63 | maxCols: number;
|
64 | skipEmpty: boolean;
|
65 | skipFull: boolean;
|
66 | }
|
67 | export type TextLcovOptions = ProjectOptions;
|
68 | export type TextSummaryOptions = FileOptions;
|
69 |
|
70 | export interface LinkMapper {
|
71 | getPath(node: string | Node): string;
|
72 | relativePath(source: string | Node, target: string | Node): string;
|
73 | assetPath(node: Node, name: string): string;
|
74 | }
|