UNPKG

3.02 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/istanbul-reports`
3
4# Summary
5This package contains type definitions for istanbul-reports (https://github.com/istanbuljs/istanbuljs).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports/index.d.ts)
10````ts
11// Type definitions for istanbul-reports 3.0
12// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
13// Definitions by: Jason Cheatham <https://github.com/jason0x43>
14// Elena Shcherbakova <https://github.com/not-a-doctor>
15// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16// TypeScript Version: 2.4
17
18import { Node, ReportBase } from 'istanbul-lib-report';
19
20export function create<T extends keyof ReportOptions>(name: T, options?: Partial<ReportOptions[T]>): ReportBase;
21
22export interface FileOptions {
23 file: string;
24}
25
26export interface ProjectOptions {
27 projectRoot: string;
28}
29
30export interface ReportOptions {
31 clover: CloverOptions;
32 cobertura: CoberturaOptions;
33 'html-spa': HtmlSpaOptions;
34 html: HtmlOptions;
35 json: JsonOptions;
36 'json-summary': JsonSummaryOptions;
37 lcov: LcovOptions;
38 lcovonly: LcovOnlyOptions;
39 none: never;
40 teamcity: TeamcityOptions;
41 text: TextOptions;
42 'text-lcov': TextLcovOptions;
43 'text-summary': TextSummaryOptions;
44}
45
46export type ReportType = keyof ReportOptions;
47
48export interface CloverOptions extends FileOptions, ProjectOptions {}
49
50export interface CoberturaOptions extends FileOptions, ProjectOptions {}
51
52export interface HtmlSpaOptions extends HtmlOptions {
53 metricsToShow: Array<'lines' | 'branches' | 'functions' | 'statements'>;
54}
55export interface HtmlOptions {
56 verbose: boolean;
57 skipEmpty: boolean;
58 subdir: string;
59 linkMapper: LinkMapper;
60}
61
62export type JsonOptions = FileOptions;
63export type JsonSummaryOptions = FileOptions;
64
65export interface LcovOptions extends FileOptions, ProjectOptions {}
66export interface LcovOnlyOptions extends FileOptions, ProjectOptions {}
67
68export interface TeamcityOptions extends FileOptions {
69 blockName: string;
70}
71
72export interface TextOptions extends FileOptions {
73 maxCols: number;
74 skipEmpty: boolean;
75 skipFull: boolean;
76}
77export type TextLcovOptions = ProjectOptions;
78export type TextSummaryOptions = FileOptions;
79
80export interface LinkMapper {
81 getPath(node: string | Node): string;
82 relativePath(source: string | Node, target: string | Node): string;
83 assetPath(node: Node, name: string): string;
84}
85
86````
87
88### Additional Details
89 * Last updated: Tue, 01 Jun 2021 21:02:19 GMT
90 * Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report)
91 * Global values: none
92
93# Credits
94These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Elena Shcherbakova](https://github.com/not-a-doctor).
95
\No newline at end of file