import { Compilation, type Compiler } from '@rspack/core'; import type { DevOptions } from '../../../types.js'; import { type ImportedModuleReader, type LiteralLookup, type ResolvedLiteral } from './source-literals.js'; export type { ImportedModuleReader } from './source-literals.js'; type LoadContext = 'importScripts' | 'injected' | 'getURL' | 'html'; type TracedLoad = 'classic' | 'by-shape'; type TracedFormat = 'module' | 'classic'; export type TracedFilePlan = { kind: 'copy'; sourcePath: string; emitPath: string; } | { kind: 'compile'; sourcePath: string; emitPath: string; format: TracedFormat; spelledAs?: string; } | { kind: 'skip'; reason: 'emitted' | 'public'; emitPath: string; } | { kind: 'skip'; reason: 'compiled-elsewhere'; emitPath: string; spelledAs: string; } | { kind: 'missing'; emitPath: string; }; export interface CompileRequest { sourcePath: string; emitPath: string; format: TracedFormat; context: LoadContext; } export declare class TraceRuntimeLoadedFiles { readonly manifestPath: string; readonly browser: DevOptions['browser']; private readonly namingSources; constructor(options: { manifestPath: string; browser?: DevOptions['browser']; }); apply(compiler: Compiler): void; private readManifest; private traceManifestNamedFiles; private traceWorkerImportScripts; private traceFetchedFiles; private missingFileHint; private surfacePageOutputs; private relocatedPageOutputs; private folderPageOutputs; private keepAuthoredPagePaths; private traceKeptPageFetches; private webAccessibleOutputs; private traceGetURLFiles; private traceNamedFiles; private traceWebpackChunkSiblings; private traceInjectedFilePayloads; } export declare function saidNotShipped(compilation: object, assetName: string, distRel: string): boolean; export declare function compileRuntimeLoadedFiles(compilation: Compilation, compiler: Compiler, requests: CompileRequest[]): Promise; export declare function planTracedFile(opts: { manifestDir: string; sourceRel: string; distRel: string; loadsAs: TracedLoad; hasAsset: (name: string) => boolean; mayRead?: (abs: string) => boolean; }): TracedFilePlan; export declare function withEagerDynamicImports(parser: Record | undefined): Record; type LooseUse = string | { loader?: string; options?: Record; } | ((...args: unknown[]) => unknown); interface LooseRule { loader?: string; use?: LooseUse | LooseUse[]; oneOf?: LooseRule[]; rules?: LooseRule[]; [key: string]: unknown; } export declare function withoutDevRefresh(rules: LooseRule[]): LooseRule[]; export declare function compiledSourceEmittedPath(distRel: string): string | null; export declare function resolveExtensionPath(literal: string, basePath: string): string | null; export declare function extractGetURLLiterals(source: string): string[]; export declare function extractRuntimeSurfaceLiterals(source: string): string[]; type SurfaceRead = 'page' | 'image' | 'panel' | 'panelPage'; interface SurfaceReference { literal: string; reads: SurfaceRead; } export declare function extractRuntimeSurfaceReferences(source: string): SurfaceReference[]; export declare function extractCssSubresourceLiterals(css: string): string[]; export declare function splitTopLevelConditional(expression: string): [string, string] | null; export declare function stringElements(found: ResolvedLiteral, strict: boolean): string[] | null; export declare function constantStrings(lookup: LiteralLookup, expression: string, useIndex: number): string[] | null; interface PathEntry { value: string; viaConstant: boolean; } export interface RegisteredScriptGroup { text: string; viaConstant: boolean; lookup: LiteralLookup; at: number; } export declare function splitRegisteredScriptGroups(lookup: LiteralLookup, args: string, useIndex: number): RegisteredScriptGroup[]; export declare function groupPropEntries(group: RegisteredScriptGroup, prop: string): PathEntry[]; export declare function extractInjectedFileLiterals(source: string, readImported?: ImportedModuleReader): string[]; export declare function extractOwnAddressLiterals(source: string): string[]; type ReferenceForm = 'own' | 'root'; export declare function provenReferenceForms(source: string, literals: string[], surfaces?: Array<{ literal: string; form: ReferenceForm | 'unknown'; }>): Map;