import { n as GlassEaselAnalyzeResult } from "./types-D0FFexRF.mjs"; //#region src/analyze/components/types.d.ts type AnalyzeComponentSuggestionKind = 'move-to-subpackage' | 'split-or-async' | 'shared-subpackage-or-placeholder'; interface AnalyzeComponentSuggestion { kind: AnalyzeComponentSuggestionKind; message: string; component: string; componentPackage: string; targetPackage?: string; pagePackages: string[]; } interface AnalyzeComponentPageUsage { page: string; packageId: string; usageCount: number; } interface AnalyzeComponentUsage { component: string; componentPackage: string; totalUsageCount: number; pageUsageCount: number; pages: AnalyzeComponentPageUsage[]; suggestions: AnalyzeComponentSuggestion[]; } //#endregion //#region src/analyze/subpackages/artifacts/types.d.ts interface AnalyzeModuleOwner { name: string; version?: string; } type AnalyzeModuleCategory = 'runtime' | 'reactivity' | 'host' | 'helper' | 'application' | 'dependency' | 'unknown'; interface AnalyzeArtifactModule { source: string; package?: AnalyzeModuleOwner; category: AnalyzeModuleCategory; /** 打包器提供的模块长度,不保证等于最终 UTF-8 字节。 */ renderedLength?: number; /** 按模块长度占比分摊的最终字节估算,不是独立压缩结果。 */ estimatedBytes: number; } interface AnalyzeArtifact { file: string; packageId: string; origin: 'main' | 'independent'; type: 'chunk' | 'asset'; bytes: number; sha256?: string; role: 'runtime' | 'application' | 'dependency' | 'mixed' | 'unknown' | 'asset'; classification: 'module-ownership' | 'asset' | 'unavailable'; estimation: 'rendered-length-proportional'; modules: AnalyzeArtifactModule[]; runtimeEstimatedBytes: number; unattributedBytes: number; } interface AnalyzeArtifactAnalysis { files: AnalyzeArtifact[]; /** 各物理文件只计一次;不能再加上 runtime 或重复模块估算。 */ totalBytes: number; /** 同一模块在多个物理文件中的估算总量减去最大单份,不是可保证节省量。 */ duplicateEstimatedBytes: number; runtime: { estimatedBytes: number; /** 包含 runtime 模块的所有文件实际字节,包括混合 chunk 中的业务代码。 */ upperBoundBytes: number; unknownFiles: string[]; }; } //#endregion //#region src/analyze/subpackages/types.d.ts type PackageType = 'main' | 'subPackage' | 'independent' | 'virtual'; type ModuleSourceType = 'src' | 'plugin' | 'node_modules' | 'workspace'; type BuildOrigin = 'main' | 'independent'; interface AnalyzeBudgetConfig { totalBytes: number; mainBytes: number; subPackageBytes: number; independentBytes: number; runtimeBytes?: number; packageBytes?: Record; warningRatio: number; source: 'config' | 'default'; } interface AnalyzeHistoryMetadata { enabled: boolean; dir: string; limit: number; latestSnapshot?: string; } interface AnalyzeSubpackagesMetadata { projectName?: string; generatedAt: string; budgets: AnalyzeBudgetConfig; history: AnalyzeHistoryMetadata; } interface ModuleInFile { id: string; source: string; sourceType: ModuleSourceType; bytes?: number; originalBytes?: number; } interface PackageFileEntry { file: string; type: 'chunk' | 'asset'; from: BuildOrigin; size?: number; sha256?: string; /** 包含虚拟模块在内的打包器长度总和,用于保留无法归因的份额。 */ moduleRenderedLength?: number; gzipSize?: number; brotliSize?: number; isEntry?: boolean; imports?: string[]; dynamicImports?: string[]; modules?: ModuleInFile[]; source?: string; sourceType?: ModuleSourceType; } interface PackageReport { id: string; label: string; type: PackageType; files: PackageFileEntry[]; } interface ModuleUsage { id: string; source: string; sourceType: ModuleSourceType; packages: Array<{ packageId: string; files: string[]; }>; } interface SubPackageDescriptor { root: string; independent: boolean; name?: string; } interface AnalyzeSubpackagesResult { schemaVersion?: 2; build?: { id: string; platform: string; mode: string; }; artifacts?: AnalyzeArtifactAnalysis; budgetChecks?: AnalyzeBudgetCheckItem[]; metadata?: AnalyzeSubpackagesMetadata; packages: PackageReport[]; modules: ModuleUsage[]; subPackages: SubPackageDescriptor[]; components?: AnalyzeComponentUsage[]; glassEasel: GlassEaselAnalyzeResult; } //#endregion //#region src/analyze/subpackages/budget.d.ts interface AnalyzeBudgetCheckItem { id: string; label: string; scope: 'total' | 'runtime' | PackageType; currentBytes: number; limitBytes: number; ratio: number; status: 'ok' | 'warning' | 'exceeded' | 'unknown'; measurement: 'file-bytes' | 'upper-bound' | 'unavailable'; files: string[]; } interface AnalyzeBudgetCheckInput { packages: AnalyzeSubpackagesResult['packages']; artifacts?: AnalyzeSubpackagesResult['artifacts']; metadata?: Partial & { budgets: AnalyzeBudgetConfig; }; } declare function createAnalyzeBudgetCheck(result: AnalyzeBudgetCheckInput): AnalyzeBudgetCheckItem[]; //#endregion export { AnalyzeSubpackagesResult as a, AnalyzeBudgetConfig as i, AnalyzeBudgetCheckItem as n, ModuleSourceType as o, createAnalyzeBudgetCheck as r, AnalyzeBudgetCheckInput as t };