import { CpuProfilerModel } from './profiler/cpuProfilerModel' ; import { DurationEvent } from './types/EventInterfaces' ; import { readFileAsync } from './utils/fileSystem' ; import { HermesCPUProfile } from './types/HermesProfile' ; import applySourceMapsToEvents from './profiler/applySourceMapsToEvents' ; import { SourceMap } from './types/SourceMap' ; param profilePath param sourceMapPath param bundleFileName return const transformer = async ( profilePath , sourceMapPath , bundleFileName ) : Promise < DurationEvent [ ] > => { const hermesProfile = await readFileAsync ( profilePath ) ; const profileChunk = CpuProfilerModel . collectProfileEvents ( hermesProfile ) ; const profiler = new CpuProfilerModel ( profileChunk ) ; const chromeEvents = profiler . createStartEndEvents ( ) ; if ( sourceMapPath ) { const sourceMap = await readFileAsync ( sourceMapPath ) ; const events = applySourceMapsToEvents ( sourceMap , chromeEvents , bundleFileName ) ; return events ; } return chromeEvents ; } ; export default transformer ; export { SourceMap } from './types/SourceMap' ;