/** * Copyright © 2026 650 Industries. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import type { BabelDecodedMap, BabelSourceMapSegment, BasicSourceMap, FBSourceFunctionMap, HermesFunctionOffsets, MetroSourceMapSegmentTuple, MixedSourceMap, VlqMap } from '@expo/metro/metro-source-map'; import type { SourceMapGeneratorOptions } from '@expo/metro/metro/DeltaBundler/Serializers/sourceMapGenerator'; import type { Module } from '@expo/metro/metro/DeltaBundler/types'; export type { BabelDecodedMap, BabelSourceMapSegment, BasicSourceMap, FBSourceFunctionMap, HermesFunctionOffsets, MetroSourceMapSegmentTuple, MixedSourceMap, SourceMapGeneratorOptions, VlqMap, }; export interface ComposableSourceMap { version: number; file?: string; mappings: string; names: string[]; sources: (string | null)[]; sourcesContent?: (string | null)[]; sourceRoot?: string; ignoreList?: number[]; x_google_ignoreList?: number[]; x_hermes_function_offsets?: HermesFunctionOffsets; } /** An indexed source map, as Metro emits for bundles */ export interface IndexedSourceMap { version: number; file?: string; sections: { offset: { line: number; column: number; }; map: ComposableSourceMap | IndexedSourceMap; }[]; } /** * Flattens an indexed source map into a single `mappings` string, and returns a flat map unchanged. * Metro emits indexed bundle maps, but some consumers (like `@jridgewell/remapping`) only accept * flat ones. */ export declare function flattenSourceMap(map: ComposableSourceMap | IndexedSourceMap): ComposableSourceMap; /** An encoded source map's `mappings` and `names`, such as a minifier's output */ export interface EncodedMappings { mappings: string; names: readonly string[]; } /** * Encodes a module's compact `VlqMap` from Babel's `decodedMap`. Like Metro's transform worker, * a generated-only mapping terminates the map one past the last column of `code`, so * out-of-bounds lookups resolve to nothing rather than aliasing the last real mapping. */ export declare function vlqMapFromDecodedMap(decodedMap: BabelDecodedMap | null | undefined, code: string): { lineCount: number; map: VlqMap; }; /** Encodes a module's compact `VlqMap` from an encoded source map, such as a minifier's output. */ export declare function vlqMapFromEncodedMap(encoded: EncodedMappings, code: string): { lineCount: number; map: VlqMap; }; export interface ExpoSourceMapOptions extends SourceMapGeneratorOptions { debugId?: string; } export declare function appendDebugIdToSourceMap(sourceMap: string, debugId: string): string; export declare function sourceMapString(modules: readonly Module[], options: ExpoSourceMapOptions): string; export declare function sourceMapStringNonBlocking(modules: readonly Module[], options: ExpoSourceMapOptions): Promise; export declare function composeSourceMaps(maps: readonly (ComposableSourceMap | IndexedSourceMap)[]): ComposableSourceMap; export interface EncodedTransformerSourceMap { version: 3; file?: string; mappings: string; names: string[]; sources: string[]; sourcesContent?: (string | null)[]; } export declare function rawMappingsToEncodedMap(opts: { filename: string; source: string; rawMappings: readonly BabelSourceMapSegment[]; }): EncodedTransformerSourceMap;