import { resolveTargetSettings } from "../config/loader.js"; import { FigmaClient } from "../figma/client.js"; import { type IndexedItem, type LogicalDimensions } from "../indexer/index.js"; import { PluginAssetDownloader, type PluginDownloadTask } from "../export/plugin-downloader.js"; import { SvgOptimizer } from "../optimize/svg.js"; import { type SvgExportMode, type SvgExportRisk } from "../svg/safety.js"; import { RestSvgImageFillRepairer, type SvgImageFillRepairPlan } from "../svg/rest-image-fill-repair.js"; import { BridgeClient } from "../source/bridge-client.js"; import type { AssetFormat, ResolvedSourceConfig, ResolvedTargetConfig, SourceExportConfig } from "../types/config.js"; import type { DiffResult, ItemState } from "../types/state.js"; import type { SourceSnapshot } from "../source/types.js"; type ParsedArgs = { command: "sync" | "clean" | "init" | "validate-config" | "report" | "probe-motion" | "help" | "version"; values: Map; flags: Set; }; type ScopeMeta = { scopeId: string; sourceId: string; targetId: string; item: IndexedItem; canonicalName: string; outputPath: string; outputRelPath: string; downloadPath: string; downloadFormat: AssetFormat; svgExportMode: SvgExportMode; settings: NonNullable>; fileKey: string; fileVersion: string; stateItem: ItemState; }; export type PlannedExportReportMeta = { item: { nodeId: string; logicalDimensions?: LogicalDimensions; svgImageFillRepairPlan?: SvgImageFillRepairPlan; }; canonicalName: string; svgExportMode: SvgExportMode; settings: { motion?: { enabled?: boolean; }; sourceExport: SourceExportConfig; }; }; export type PlannedExportReport = { sourceExport: { rest: number; plugin: Array<{ nodeId: string; name: string; transport: "plugin"; sourceFormat: SourceExportConfig["format"]; constraint: SourceExportConfig["constraint"] | null; logicalDimensions: LogicalDimensions | null; }>; }; svgExport: { embeddedPng: Array<{ nodeId: string; name: string; rasterBacked: true; transport: SourceExportConfig["transport"]; sourceFormat: SourceExportConfig["format"]; constraint: SourceExportConfig["constraint"] | null; logicalDimensions: LogicalDimensions | null; }>; repairedImageFills: Array<{ nodeId: string; name: string; representation: "embedded-image-fills-v1"; imageRegions: number; }>; }; }; export declare function runCli(argv?: string[]): Promise; export declare function parseArgs(argv: string[]): ParsedArgs; export declare function hydrateMcpRestMetadata(args: { sources: readonly ResolvedSourceConfig[]; targets: readonly ResolvedTargetConfig[]; sourceItems: Map; sourceSnapshots: Map; figmaClient: Pick; figmaTokenAvailable: boolean; }): Promise; export type UnsafeSvgPreflightCandidate = { targetId: string; sourceId: string; nodeId: string; nodeName: string; mode: Exclude; risks: SvgExportRisk[]; transport: "rest" | "plugin"; sourceFormat: "png" | "jpg"; constraint: ScopeMeta["settings"]["sourceExport"]["constraint"]; logicalDimensions?: IndexedItem["logicalDimensions"]; sourceMode: ResolvedSourceConfig["mode"]; repairPlan: SvgImageFillRepairPlan; fontEnabled: boolean; sfSymbolsEnabled: boolean; }; export declare function preflightUnsafeSvgExports(candidates: readonly UnsafeSvgPreflightCandidate[]): void; export declare function formatUnsafeSvgDryRunLines(candidates: readonly UnsafeSvgPreflightCandidate[]): string[]; /** The per-scope report's source and SVG export sections for the assets planned for download. */ export declare function buildPlannedExportReport(plannedMetas: readonly PlannedExportReportMeta[]): PlannedExportReport; export type PluginExportPreflightCandidate = { targetId: string; sourceId: string; expectedFileKey?: string; task: Omit; }; export declare function preflightPluginExports(args: { bridgeClient: Pick; pluginDownloader: Pick; candidates: PluginExportPreflightCandidate[]; }): Promise; export declare function applyCompletedDiffMutations(args: { diff: Pick; downloadedNodeIds: ReadonlySet; currentOutputPaths: ReadonlySet; workspaceRoot?: string; }): Promise; export declare function formatPluginExportDryRunLines(scopeId: string, assets: ReadonlyArray<{ canonicalName: string; item: { nodeId: string; }; }>): string[]; export declare function buildPlannedDownloadNodeIds(diff: DiffResult, workspaceRoot?: string): Set; export declare function assertSupportedSourceExport(targetId: string, nodeId: string, settings: ScopeMeta["settings"]): void; /** * Writes one static SVG output: an embedded full-node PNG (`embed-png`), a REST SVG with repaired * IMAGE fills (`repair-image-fills`, repaired and optimized through temporary files), or the * optimized native SVG. */ export declare function processStaticSvgAsset(args: { optimizer: Pick; repairer: Pick; mode: SvgExportMode; inputPath: string; outputPath: string; logicalDimensions?: IndexedItem["logicalDimensions"]; fileKey: string; fileVersion: string; repairPlan: SvgImageFillRepairPlan; quality: number; qualitySize: string | null; }): Promise; /** * Moves staged files over their outputs as one unit: existing outputs are backed up first, and * any failure restores them. Returns backups that could not be removed after a successful publish. */ export declare function publishStagedFiles(files: readonly { stagedPath: string; outputPath: string; }[]): Promise; export {};