1 | export interface FileData {
|
2 | size: number;
|
3 | coveredSize?: number;
|
4 | }
|
5 |
|
6 | export type FileDataMap = Record<string, FileData>;
|
7 |
|
8 | export interface FileSizes {
|
9 | files: FileDataMap;
|
10 | mappedBytes: number;
|
11 | unmappedBytes?: number;
|
12 | eolBytes: number;
|
13 | sourceMapCommentBytes: number;
|
14 | totalBytes: number;
|
15 | }
|
16 |
|
17 | export type ErrorCode =
|
18 | | 'Unknown'
|
19 | | 'NoBundles'
|
20 | | 'NoSourceMap'
|
21 | | 'OneSourceSourceMap'
|
22 | | 'UnmappedBytes'
|
23 | | 'InvalidMappingLine'
|
24 | | 'InvalidMappingColumn'
|
25 | | 'CannotSaveFile'
|
26 | | 'CannotCreateTempFile'
|
27 | | 'CannotOpenTempFile'
|
28 | | 'CannotOpenCoverageFile'
|
29 | | 'NoCoverageMatches';
|
30 |
|
31 | export type File = string | Buffer;
|
32 |
|
33 | export type ReplaceMap = Record<string, string>;
|
34 |
|
35 | type OutputFormat = 'json' | 'tsv' | 'html';
|
36 |
|
37 |
|
38 | export interface Bundle {
|
39 | code: File;
|
40 | map?: File;
|
41 | coverageRanges?: ColumnsRange[][];
|
42 | }
|
43 |
|
44 | export interface ExploreOptions {
|
45 |
|
46 | onlyMapped?: boolean;
|
47 |
|
48 | excludeSourceMapComment?: boolean;
|
49 |
|
50 | output?: {
|
51 | format: OutputFormat;
|
52 |
|
53 | filename?: string;
|
54 | };
|
55 |
|
56 | noRoot?: boolean;
|
57 |
|
58 | noBorderChecks?: boolean;
|
59 |
|
60 | replaceMap?: ReplaceMap;
|
61 | coverage?: string;
|
62 |
|
63 | gzip?: boolean;
|
64 |
|
65 | sort?: boolean;
|
66 | }
|
67 |
|
68 | export interface ExploreResult {
|
69 | bundles: ExploreBundleResult[];
|
70 |
|
71 | output?: string;
|
72 | errors: ExploreErrorResult[];
|
73 | }
|
74 |
|
75 | export interface ExploreBundleResult extends FileSizes {
|
76 | bundleName: string;
|
77 | }
|
78 |
|
79 | export interface ExploreErrorResult {
|
80 | bundleName: string;
|
81 | code: string;
|
82 | message: string;
|
83 | error?: NodeJS.ErrnoException;
|
84 | isWarning?: boolean;
|
85 | }
|
86 |
|
87 | export type BundlesAndFileTokens = (Bundle | string)[] | Bundle | string;
|
88 |
|
89 |
|
90 | export interface ColumnsRange {
|
91 |
|
92 | start: number;
|
93 |
|
94 | end: number;
|
95 | }
|
96 |
|
97 | export interface MappingRange extends ColumnsRange {
|
98 | source: string;
|
99 | }
|
100 |
|
101 |
|
102 | export interface Coverage {
|
103 | url: string;
|
104 | ranges: CoverageRange[];
|
105 |
|
106 | text: string;
|
107 | }
|
108 |
|
109 | export interface CoverageRange {
|
110 |
|
111 | start: number;
|
112 |
|
113 | end: number;
|
114 | }
|
115 |
|
116 |
|
117 | declare module 'source-map' {
|
118 | export interface MappingItem {
|
119 | lastGeneratedColumn: number | null;
|
120 | }
|
121 | }
|