import type { RawSourceMap } from 'source-map'; import type { SourceLocation } from './LocationManager'; /** * Unifies access to source files across the whole project */ export declare class SourceMapManager { private logger; /** * Store all paths in lower case since Roku is case-insensitive. * If the file existed, but something failed during parsing, this will be set to null. * So take that into consideration when deciding to use falsey checking */ private cache; /** * Does a source map exist at the specified path? * Checks the local cache first to prevent hitting the file system, * then falls back to the file system if not in the cache */ sourceMapExists(sourceMapPath: string): boolean; /** * Get a parsed source map, with all of its paths already resolved */ getSourceMap(sourceMapPath: string): Promise; /** * Update the in-memory cache for a specific source map, * and resolve the sources list to absolute paths */ set(sourceMapPath: string, sourceMap: string): void; /** * Get the path to the sourcemap for a given file, either from a sourceMappingURL comment or by assuming a co-located .map file. * * Returns undefined if no source map is found. * @param stagingFilePath * @returns */ getSourceMapPath(stagingFilePath: string): Promise; private sourceMapPathCache; /** * Get the source location of a position using a source map. If no source map is found, undefined is returned * @param filePath - the absolute path to the file * @param currentLineNumber - the 1-based line number of the current location. * @param currentColumnIndex - the 0-based column number of the current location. */ getOriginalLocation(filePath: string, currentLineNumber: number, currentColumnIndex?: number): Promise; private sourceMapConsumerCache; private getSourceMapConsumer; /** * Given a source location, find the generated location using source maps */ getGeneratedLocations(sourceMapPaths: string[], sourceLocation: SourceLocation): Promise; destroy(): Promise; }