import type { SourceMapManager } from './SourceMapManager'; /** * Find original source locations based on debugger/staging locations. */ export declare class LocationManager { private sourceMapManager; constructor(sourceMapManager: SourceMapManager); /** * Given a debugger/staging location, convert that to a source location */ getSourceLocation(options: GetSourceLocationOptions): Promise; /** * Given a source location, compute its locations in staging. You should call this for the main app (rootDir, rootDir+sourceDirs), * and also once for each component library. * There is a possibility of a single source location mapping to multiple staging locations (i.e. merging a function into two different files), * So this will return an array of locations. */ getStagingLocations(sourceFilePath: string, sourceLineNumber: number, sourceColumnIndex: number, sourceDirs: string[], stagingDir: string, fileMappings: Array<{ src: string; dest: string; }>): Promise<{ type: 'fileMap' | 'sourceDirs' | 'sourceMap'; locations: SourceLocation[]; }>; } export interface GetSourceLocationOptions { /** * The absolute path to the staging folder */ stagingDir: string; /** * The absolute path to the file in the staging folder */ stagingFilePath: string; /** * The absolute path to the root directory */ rootDir: string; /** * An array of sourceDir paths */ sourceDirs?: string[]; /** * The result of rokuDeploy.getFilePaths(). This is passed in so it can be cached on the outside in order to improve performance */ fileMappings: { src: string; dest: string; }[]; /** * The debugger line number (1-based) */ lineNumber: number; /** * The debugger column index (0-based) */ columnIndex: number; /** * If true, then use source maps as part of the process */ enableSourceMaps: boolean; /** * Used to prevent circular references. This is set by the function so do not set this value yourself */ _sourceChain?: string[]; } export interface SourceLocation { /** * The path to the file in the source location */ filePath: string; /** * 1-based line number */ lineNumber: number; /** * 0-based column index */ columnIndex: number; }