import { DebugIdGenerator } from './DebugIdGenerator'; import { RawSourceMap, RawSourceMapWithDebugId } from './models/RawSourceMap'; import { ResultPromise } from './models/Result'; export interface ProcessResult { readonly debugId: string; readonly source: string; readonly sourceMap: RawSourceMapWithDebugId; } export interface ProcessResultWithPaths extends ProcessResult { readonly sourcePath: string; readonly sourceMapPath: string; } export declare class SourceProcessor { private readonly _debugIdGenerator; constructor(_debugIdGenerator: DebugIdGenerator); isSourceProcessed(source: string): boolean; isSourceMapProcessed(sourceMap: RawSourceMap): boolean; isSourceFileProcessed(sourcePath: string): ResultPromise; isSourceMapFileProcessed(sourceMapPath: string): ResultPromise; getSourceMapDebugId(sourceMap: RawSourceMap): string | undefined; getSourceMapFileDebugId(sourceMapPath: string): ResultPromise; /** * Adds required snippets and comments to source, and modifies sourcemap to include debug ID. * @param source Source content. * @param sourceMap Sourcemap object or JSON. * @param debugId Debug ID. If not provided, one will be generated from `source`. * @returns Used debug ID, new source and new sourcemap. */ processSourceAndSourceMap(source: string, sourceMap: RawSourceMap, debugId?: string): Promise; /** * Adds required snippets and comments to source, and modifies sourcemap to include debug ID. * Will write modified content to the files. * @param sourcePath Path to the source. * @param sourceMapPath Path to the sourcemap. If not specified, will try to resolve from sourceMapURL. * @param debugId Debug ID. If not provided, one will be generated from `source`. * @returns Used debug ID. */ processSourceAndSourceMapFiles(sourcePath: string, sourceMapPath?: string, debugId?: string): ResultPromise; getSourceMapPathFromSourceFile(sourcePath: string): Promise | import("./models/Result").ResultOk>; getSourceMapPathFromSource(source: string, sourcePath: string): string | undefined; addSourcesToSourceMap(sourceMap: string | RawSourceMap, sourceMapPath: string): ResultPromise; doesSourceMapHaveSources(sourceMap: RawSourceMap): boolean; offsetSourceMap(sourceMap: RawSourceMap, count: number): Promise; }