import libCoverage from "istanbul-lib-coverage"; import sourceMap from "source-map"; import { CoverageMapBuilder } from "./builder"; import { SourceStore } from "./source-store"; /** * A range in a source text identified by its `url`. */ export interface SourceLocationWithUrl extends SourceLocation { /** * URL of the file containing this location. */ readonly url: string; } /** * A (possibly empty) range in the source text. */ export interface SourceLocation { /** * Start position. */ readonly start: Position; /** * End position. */ readonly end: Position; } /** * A position in the source text. */ export interface Position { /** * 1-based line index. * * Must satisfy `line >= 1`. */ readonly line: number; /** * 0-based column index. * * Must satisfy `column >= 0`. */ readonly column: number; } /** * Adds content from a generated-file coverage using source maps. * * @param covMapBuilder Coverage map builder to use for the original coverages. * @param sourceStore Store where inlined source texts will be added. * @param generatedFileCov File coverage to process. * @param rawSourceMap Raw source map corresponding to the file to process. * @param sourceMapUrl Optional URL of the source map. */ export declare function addFromGeneratedFileCov(covMapBuilder: CoverageMapBuilder, sourceStore: SourceStore, generatedFileCov: libCoverage.FileCoverageData, rawSourceMap: sourceMap.RawSourceMap, sourceMapUrl?: string): Promise; /** * Adds the source texts embedded in the source map to the source store. * * @param sourceStore Source store where the source texts will be added. * @param smc Source map consumer to use for the extraction. * @param generatedUrl URL of the generated file. * @returns Boolean indicating of the source store was updated. */ export declare function addSourceTexts(sourceStore: SourceStore, smc: sourceMap.BasicSourceMapConsumer, generatedUrl: string): boolean; /** * Extracts the source texts embedded in the source map. * * This function can be used to extract inlined source text for example. * * @param smc Source map consumer to use for the extraction. * @param generatedUrl URL of the generated file. * @returns Iterator of `[url, sourceText]`. `url` is absolute. */ export declare function getSourceTexts(smc: sourceMap.BasicSourceMapConsumer, generatedUrl: string): IterableIterator<[string, string]>; /** * Adds the original file coverages to the provided builders map. * * @param covMapBuilder Coverage map builder to use for the original coverages. * @param smc Source map consumer to use. * @param generatedFileCov File coverage for the generated file. * @returns Boolean indicating if the builder was updated. */ export declare function addOriginalFileCovs(covMapBuilder: CoverageMapBuilder, smc: sourceMap.BasicSourceMapConsumer, generatedFileCov: libCoverage.FileCoverageData): boolean;