UNPKG

2.64 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
11import { Node, ReportBase } from "istanbul-lib-report";
12
13export function create<T extends keyof ReportOptions>(name: T, options?: Partial<ReportOptions[T]>): ReportBase;
14
15export interface FileOptions {
16 file: string;
17}
18
19export interface ProjectOptions {
20 projectRoot: string;
21}
22
23export interface ReportOptions {
24 clover: CloverOptions;
25 cobertura: CoberturaOptions;
26 "html-spa": HtmlSpaOptions;
27 html: HtmlOptions;
28 json: JsonOptions;
29 "json-summary": JsonSummaryOptions;
30 lcov: LcovOptions;
31 lcovonly: LcovOnlyOptions;
32 none: never;
33 teamcity: TeamcityOptions;
34 text: TextOptions;
35 "text-lcov": TextLcovOptions;
36 "text-summary": TextSummaryOptions;
37}
38
39export type ReportType = keyof ReportOptions;
40
41export interface CloverOptions extends FileOptions, ProjectOptions {}
42
43export interface CoberturaOptions extends FileOptions, ProjectOptions {}
44
45export interface HtmlSpaOptions extends HtmlOptions {
46 metricsToShow: Array<"lines" | "branches" | "functions" | "statements">;
47}
48export interface HtmlOptions {
49 verbose: boolean;
50 skipEmpty: boolean;
51 subdir: string;
52 linkMapper: LinkMapper;
53}
54
55export type JsonOptions = FileOptions;
56export type JsonSummaryOptions = FileOptions;
57
58export interface LcovOptions extends FileOptions, ProjectOptions {}
59export interface LcovOnlyOptions extends FileOptions, ProjectOptions {}
60
61export interface TeamcityOptions extends FileOptions {
62 blockName: string;
63}
64
65export interface TextOptions extends FileOptions {
66 maxCols: number;
67 skipEmpty: boolean;
68 skipFull: boolean;
69}
70export type TextLcovOptions = ProjectOptions;
71export type TextSummaryOptions = FileOptions;
72
73export interface LinkMapper {
74 getPath(node: string | Node): string;
75 relativePath(source: string | Node, target: string | Node): string;
76 assetPath(node: Node, name: string): string;
77}
78
79````
80
81### Additional Details
82 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
83 * Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report)
84
85# Credits
86These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Elena Shcherbakova](https://github.com/not-a-doctor).
87
\No newline at end of file