/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noformat * @oncall react_native * @generated SignedSource<> * * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js * Original file: packages/metro-symbolicate/src/Symbolication.js * To regenerate, run: * js1 build metro-ts-defs (internal) OR * yarn run build-ts-defs (OSS) */ import type {ChromeHeapSnapshot} from './ChromeHeapSnapshot'; import type {HermesFunctionOffsets, MixedSourceMap} from 'metro-source-map'; import type {Writable} from 'stream'; import GoogleIgnoreListConsumer from './GoogleIgnoreListConsumer'; import SourceMetadataMapConsumer from './SourceMetadataMapConsumer'; import {type SourceMapConsumer as $$IMPORT_TYPEOF_1$$} from 'source-map'; type SourceMapConsumer = typeof $$IMPORT_TYPEOF_1$$; type SingleMapModuleIds = { segmentId: number; localId: null | undefined | number; }; type ContextOptionsInput = { readonly nameSource?: 'function_names' | 'identifier_names'; readonly inputLineStart?: number; readonly inputColumnStart?: number; readonly outputLineStart?: number; readonly outputColumnStart?: number; }; type SizeAttributionMap = { location: { file: null | undefined | string; filename?: string; bytecodeSize?: number; virtualOffset?: number; line: null | undefined | number; column: null | undefined | number; }; }; type HermesMinidumpCrashInfo = { readonly callstack: ReadonlyArray< HermesMinidumpStackFrame | NativeCodeStackFrame >; }; type HermesMinidumpStackFrame = Readonly<{ ByteCodeOffset: number; FunctionID: number; CJSModuleOffset?: number; SegmentID?: number; SourceURL: string; StackFrameRegOffs: string; SourceLocation?: string; }>; type HermesCoverageInfo = { readonly executedFunctions: ReadonlyArray; }; type HermesCoverageStackFrame = Readonly<{ line: number; column: number; SourceURL: null | undefined | string; }>; type NativeCodeStackFrame = Readonly<{ NativeCode: true; StackFrameRegOffs: string; }>; type SymbolicatedStackTrace = ReadonlyArray< SymbolicatedStackFrame | NativeCodeStackFrame >; type SymbolicatedStackFrame = Readonly<{ line: null | undefined | number; column: null | undefined | number; source: null | undefined | string; functionName: null | undefined | string; name: null | undefined | string; isIgnored: boolean; }>; declare class SymbolicationContext { readonly options: { readonly nameSource: 'function_names' | 'identifier_names'; readonly inputLineStart: number; readonly inputColumnStart: number; readonly outputLineStart: number; readonly outputColumnStart: number; }; constructor(options: ContextOptionsInput); symbolicate(stackTrace: string): string; symbolicateProfilerMap(mapFile: string): string; symbolicateAttribution(obj: SizeAttributionMap): void; symbolicateChromeTrace( traceFile: string, $$PARAM_1$$: {stdout: Writable; stderr: Writable}, ): void; getOriginalPositionFor( lineNumber: null | undefined | number, columnNumber: null | undefined | number, moduleIds: null | undefined | ModuleIdsT, ): { line: null | undefined | number; column: null | undefined | number; source: null | undefined | string; name: null | undefined | string; }; symbolicateHermesMinidumpTrace( crashInfo: HermesMinidumpCrashInfo, ): SymbolicatedStackTrace; /** * Symbolicates heap alloction stacks in a Chrome-formatted heap * snapshot/timeline. * Line and column offsets in options (both input and output) are _ignored_, * because this format has a well-defined convention (1-based lines and * columns). */ symbolicateHeapSnapshot( snapshotContents: string | ChromeHeapSnapshot, ): ChromeHeapSnapshot; symbolicateHermesCoverageTrace( coverageInfo: HermesCoverageInfo, ): SymbolicatedStackTrace; getOriginalPositionDetailsFor( lineNumber: null | undefined | number, columnNumber: null | undefined | number, moduleIds: null | undefined | ModuleIdsT, ): SymbolicatedStackFrame; parseFileName(str: string): ModuleIdsT; } declare class SingleMapSymbolicationContext extends SymbolicationContext { readonly _segments: { readonly [id: string]: { readonly consumer: SourceMapConsumer; readonly moduleOffsets: ReadonlyArray; readonly sourceFunctionsConsumer: | null | undefined | SourceMetadataMapConsumer; readonly hermesOffsets: null | undefined | HermesFunctionOffsets; readonly googleIgnoreListConsumer: GoogleIgnoreListConsumer; }; }; readonly _legacyFormat: boolean; readonly _SourceMapConsumer: SourceMapConsumer; constructor( SourceMapConsumer: SourceMapConsumer, sourceMapContent: string | MixedSourceMap, options?: ContextOptionsInput, ); _initSegment(map: MixedSourceMap): void; symbolicateHermesMinidumpTrace( crashInfo: HermesMinidumpCrashInfo, ): SymbolicatedStackTrace; symbolicateHermesCoverageTrace( coverageInfo: HermesCoverageInfo, ): SymbolicatedStackTrace; getOriginalPositionDetailsFor( lineNumber: null | undefined | number, columnNumber: null | undefined | number, moduleIds: null | undefined | SingleMapModuleIds, ): SymbolicatedStackFrame; parseFileName(str: string): SingleMapModuleIds; } declare class DirectorySymbolicationContext extends SymbolicationContext { readonly _fileMaps: Map; readonly _rootDir: string; readonly _SourceMapConsumer: SourceMapConsumer; constructor( SourceMapConsumer: SourceMapConsumer, rootDir: string, options?: ContextOptionsInput, ); _loadMap(mapFilename: string): SingleMapSymbolicationContext; getOriginalPositionDetailsFor( lineNumber: null | undefined | number, columnNumber: null | undefined | number, filename: null | undefined | string, ): SymbolicatedStackFrame; parseFileName(str: string): string; } declare function parseSingleMapFileName(str: string): SingleMapModuleIds; declare function createContext( SourceMapConsumer: SourceMapConsumer, sourceMapContent: string | MixedSourceMap, options?: ContextOptionsInput, ): SingleMapSymbolicationContext; declare function unstable_createDirectoryContext( SourceMapConsumer: SourceMapConsumer, rootDir: string, options?: ContextOptionsInput, ): DirectorySymbolicationContext; declare function getOriginalPositionFor( lineNumber: null | undefined | number, columnNumber: null | undefined | number, moduleIds: null | undefined | ModuleIdsT, context: SymbolicationContext, ): { line: null | undefined | number; column: null | undefined | number; source: null | undefined | string; name: null | undefined | string; }; declare function symbolicate( stackTrace: string, context: SymbolicationContext, ): string; declare function symbolicateProfilerMap( mapFile: string, context: SymbolicationContext, ): string; declare function symbolicateAttribution( obj: SizeAttributionMap, context: SymbolicationContext, ): void; declare function symbolicateChromeTrace( traceFile: string, $$PARAM_1$$: {stdout: Writable; stderr: Writable}, context: SymbolicationContext, ): void; export { createContext, unstable_createDirectoryContext, getOriginalPositionFor, parseSingleMapFileName as parseFileName, symbolicate, symbolicateProfilerMap, symbolicateAttribution, symbolicateChromeTrace, SourceMetadataMapConsumer, };