import type { Rspack } from '@rsbuild/core'; import type { UiSourceMapData, UiSourceMapRecord } from '@lynx-js/debug-metadata'; /** * Minimal structural shape this collector needs from a module — enough to * walk `buildInfo` and recurse into a concatenated module's children. */ export interface ModuleWithUiSourceMapBuildInfo { identifier?: () => string; buildInfo?: Record; modules?: Iterable; } /** * Pull every {@link UiSourceMapRecord} the main-thread loader stashed on * `module.buildInfo[UI_SOURCE_MAP_RECORDS_BUILD_INFO]`, recursing into * concatenated modules to surface records hidden inside merged units. */ export declare function collectUiSourceMapRecordsFromModule(module: ModuleWithUiSourceMapBuildInfo): UiSourceMapRecord[]; /** * Deterministic ordering for {@link UiSourceMapRecord}s — primary by * filename (case-insensitive), then line, then column, then the * runtime-side `uiSourceMap` discriminator. Used to make snapshot output * stable across builds. */ export declare function compareUiSourceMapRecord(a: UiSourceMapRecord, b: UiSourceMapRecord): number; /** * Build the compact {@link UiSourceMapData} payload emitted under * `DebugMetadataAsset.uiSourceMap`. Records without a `filename` are * dropped (no source to anchor the entry to). */ export declare function createUiSourceMap(records: UiSourceMapRecord[]): UiSourceMapData; /** * Walk the modules contributing to `entryNames` and return every * {@link UiSourceMapRecord} produced by the main-thread loader, * de-duplicated by `(uiSourceMap, filename, line, column)` and sorted by * {@link compareUiSourceMapRecord}. */ export declare function collectUiSourceMapRecords(compilation: Rspack.Compilation, chunkGroups: Rspack.ChunkGroup[]): UiSourceMapRecord[];