UNPKG

@oaklean/profiler-core

Version:

Part of the @oaklean suite. It provides all basic functions to work with the `.oak` file format. It allows parsing the `.oak` file format as well as tools for analyzing the measurement values. It also provides all necessary capabilities required for prec

49 lines (48 loc) 2.98 kB
import { InspectorNotification } from 'node:inspector'; import { GlobalIndex } from '../model/indices/GlobalIndex'; import { SourceMap } from '../model/SourceMap'; import { UnifiedPath } from '../system/UnifiedPath'; import { NodeModule } from '../model/NodeModule'; import { ProgramStructureTree } from '../model/ProgramStructureTree'; import { IExternalResourceHelper, UnifiedPath_string, ScriptID_string, ProgramStructureTreeType } from '../types'; import { ICpuProfileRaw } from '../../lib/vscode-js-profile-core/src/cpu/types'; export type ExternalResourceFileInfo = { sourceCode: string; sourceMap?: SourceMap | null; cucc?: boolean; }; export declare class ExternalResourceHelper { private _frozen; private _rootDir; private fileInfoPerScriptID; private fileInfoPerPath; private nodeModules; private _uncommittedFiles; constructor(rootDir: UnifiedPath); get rootDir(): UnifiedPath; get isFrozen(): boolean; get scriptIDs(): ScriptID_string[]; get loadedFilePaths(): UnifiedPath_string[]; get uncommittedFiles(): UnifiedPath_string[] | null | undefined; trackUncommittedFiles(rootDir: UnifiedPath, globalIndex: GlobalIndex): boolean | null; connect(): Promise<void>; storeToFile(filePath: UnifiedPath, kind: 'pretty-json' | 'json'): void; static loadFromFile(rootDir: UnifiedPath, filePath: UnifiedPath): ExternalResourceHelper | undefined; toJSON(): IExternalResourceHelper; static fromJSON(rootDir: UnifiedPath, json: string | IExternalResourceHelper): ExternalResourceHelper; inspectorNotification(message: InspectorNotification<object>): Promise<void>; private _boundInspectorNotification; listen(): Promise<void>; disconnect(): Promise<void>; fillSourceMapsFromCPUProfile(profile: ICpuProfileRaw): Promise<void>; fileInfoFromPath(relativePath: UnifiedPath | UnifiedPath_string, filePath: UnifiedPath | UnifiedPath_string): ExternalResourceFileInfo | null; sourceCodeFromPath(relativePath: UnifiedPath | UnifiedPath_string, filePath: UnifiedPath | UnifiedPath_string): string | null; sourceMapFromPath(relativePath: UnifiedPath | UnifiedPath_string, filePath: UnifiedPath): Promise<SourceMap | null>; parseFile(relativePath: UnifiedPath | UnifiedPath_string, filePath: UnifiedPath | UnifiedPath_string): ProgramStructureTree<ProgramStructureTreeType.Root> | null; fileInfoFromScriptID(scriptID: ScriptID_string, filePath?: UnifiedPath): Promise<ExternalResourceFileInfo | null>; sourceCodeFromScriptID(scriptID: ScriptID_string): Promise<string | null>; sourceMapFromScriptID(scriptID: ScriptID_string, filePath: UnifiedPath): Promise<SourceMap | null>; nodeModuleFromPath(relativeNodeModulePath: UnifiedPath): NodeModule | null; replaceSourceMapByScriptID(scriptID: ScriptID_string, newSourceMap: SourceMap): Promise<void>; replaceSourceMapByLoadedFile(relativePath: UnifiedPath, newSourceMap: SourceMap): Promise<void>; }