Debian Codegraph @

types-istanbul-lib-source-maps/index.d.ts

raw
1 // Type definitions for istanbul-lib-source-maps 4.0
2 // Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
3 // Definitions by: Jason Cheatham <https://github.com/jason0x43>
4 // Sridhar Mallela <https://github.com/sridharmallela>
5 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6 // TypeScript Version: 2.4
7
8 import { CoverageMap } from 'istanbul-lib-coverage';
9 import { RawSourceMap } from 'source-map';
10
11 export function createSourceMapStore(options?: Partial<MapStoreOptions>): MapStore;
12
13 export interface MapStoreOptions {
14 verbose: boolean;
15 baseDir: string;
16 sourceStore: 'memory' | 'file';
17 tmpdir: string;
18 }
19
20 export interface MapStore {
21 baseDir: string | null;
22 verbose: boolean;
23 sourceStore: SourceStore;
24 data: {
25 [filepath: string]: {
26 type: string;
27 data: any;
28 };
29 };
30
31 registerURL(transformedFilePath: string, sourceMapUrl: string): void;
32 registerMap(filename: string, sourceMap: RawSourceMap): void;
33 getSourceMapSync(filePath: string): any;
34 addInputSourceMapsSync(coverageData: any): void;
35 sourceFinder(filePath: string): string;
36 transformCoverage(coverageMap: CoverageMap): Promise<CoverageMap>;
37 dispose(): void;
38 }
39
40 export class SourceStore {
41 getSource(filepath: string): string | null;
42 registerSource(filepath: string, sourceText: string): void;
43 }