UNPKG

1.05 kBTypeScriptView Raw
1import { CoverageMap } from "istanbul-lib-coverage";
2import { RawSourceMap } from "source-map";
3
4export function createSourceMapStore(options?: Partial<MapStoreOptions>): MapStore;
5
6export interface MapStoreOptions {
7 verbose: boolean;
8 baseDir: string;
9 sourceStore: "memory" | "file";
10 tmpdir: string;
11}
12
13export interface MapStore {
14 baseDir: string | null;
15 verbose: boolean;
16 sourceStore: SourceStore;
17 data: {
18 [filepath: string]: {
19 type: string;
20 data: any;
21 };
22 };
23
24 registerURL(transformedFilePath: string, sourceMapUrl: string): void;
25 registerMap(filename: string, sourceMap: RawSourceMap): void;
26 getSourceMapSync(filePath: string): any;
27 addInputSourceMapsSync(coverageData: any): void;
28 sourceFinder(filePath: string): string;
29 transformCoverage(coverageMap: CoverageMap): Promise<CoverageMap>;
30 dispose(): void;
31}
32
33export class SourceStore {
34 getSource(filepath: string): string | null;
35 registerSource(filepath: string, sourceText: string): void;
36}