import { type PantoneMatch, type ThreadRef } from "./threads"; export type EmbroideryType = "flat" | "puff"; /** Real-world size of a decoration zone + the landmark it's measured from. */ export type ZonePhysical = { widthIn: number; heightIn: number; /** Where the zone center sits, e.g. "5″ below collar seam, centered". */ anchor: string; /** Shop shorthand for the zone (FF, FB, LS…) — see PLACEMENT_CODE_NAMES. */ code?: string; }; /** A decoratable region: 3D size (scene units) + physical size (inches). */ export type DecorationZoneSpec = { id: string; label: string; size: [number, number]; physical: ZonePhysical; }; export type PlacementTransform = { offsetX: number; offsetY: number; rotation: number; scale: number; }; /** One dominant art color and its share of the covered pixels. */ export type ArtPaletteEntry = { hex: string; share: number; }; /** Source-art facts for print-method validation (DPI, separations, inks). */ export type ArtFacts = { pixelWidth: number; isVector: boolean; colorCount: number; /** Dominant colors (largest share first) — drives ink PMS references. */ palette?: ArtPaletteEntry[]; /** SVG contains live — fonts must be outlined before production. */ svgLiveText?: boolean; }; export declare const fitDesignIn: (zone: DecorationZoneSpec, aspect: number, scale: number) => { height: number; width: number; }; export type DesignDimensions = { widthIn: number; heightIn: number; widthMm: number; heightMm: number; /** Offset of design center from zone center, inches (right/up positive). */ offsetXIn: number; offsetYIn: number; }; export declare const designDimensions: (zone: DecorationZoneSpec, aspect: number, scale: number, offsetX: number, offsetY: number) => DesignDimensions; /** * Coverage-based stitch estimate for quoting. Real counts come from * digitizing — this mirrors how estimator tools quote from raw art. */ export declare const estimateStitches: (dims: Pick, coverage: number) => number; export declare const formatInches: (dims: DesignDimensions) => string; export declare const formatStitches: (count: number) => string; export type EmbroideryRates = { /** Handling base per piece. */ base: number; /** Price per 1,000 estimated stitches. */ per1k: number; }; export declare const DEFAULT_EMBROIDERY_RATES: EmbroideryRates; /** Per-piece embroidery price for an estimated stitch count. */ export declare const embroideryUnitPrice: (estimatedStitches: number, rates?: EmbroideryRates) => number; /** Coarse tier from the physical design size (widest edge), for labeling. */ export declare const stitchTierFor: (dims: Pick) => "left-chest" | "standard" | "large"; type EstimateInput = { zone: DecorationZoneSpec; aspect: number; coverage: number; transform: { offsetX: number; offsetY: number; scale: number; }; }; /** Dimensions + stitch estimate for one placement (pricing + specs). */ export declare const placementEstimate: ({ zone, aspect, coverage, transform, }: EstimateInput) => { dims: DesignDimensions; stitches: number; }; /** Smallest round hoop that fits the design with margin. */ export declare const suggestHoop: (dims: Pick) => string; /** An ink to mix/load: dominant art color → nearest Pantone Solid Coated. */ export type InkColor = { hex: string; /** Fraction of covered art pixels this ink accounts for. */ share: number; /** Nearest PMS reference (screen approximation), e.g. "PMS 186 C". */ pms: string | null; pmsHex: string | null; pmsMatch: "exact" | "close" | "approximate" | null; }; /** Screen-print press facts: screens, mesh, halftones, ink system, order. */ export type ScreenPrintFacts = { inks: InkColor[]; underbase: boolean; /** Underbase gets flash-cured before colors print wet-on-dry on top. */ flashAfterUnderbase: boolean; meshUnderbase: string | null; meshColors: string; /** Raster art past the spot limit runs as halftones/simulated process. */ halftones: boolean; lpi: number | null; halftoneAngleDeg: number | null; inkSystem: string; inkSystemNote: string | null; /** Screen order on press: underbase → flash → colors light-to-dark. */ printOrder: string[]; /** Final cure — under-cured plastisol passes visual QC, fails in the wash. */ cureSpec: string; }; /** DTG press facts: pretreat, white ink, substrate suitability, cure. */ export type DtgFacts = { /** Dark garments are pretreated so the white underbase sits on top. */ pretreat: boolean; whiteInk: boolean; colorProfile: "sRGB"; fabricNote: string | null; /** Pretreat dry + post-print cure — DTG ink is wet until cured. */ cureSpec: string; }; /** Cut-vinyl / HTV facts: mirror, layers, material, press, weeding limits. */ export type VinylFacts = { /** HTV cuts from the adhesive back — always mirrored. */ mirror: boolean; /** One cut + one press per color, applied bottom-up. */ layers: InkColor[]; material: string; pressSpec: string; minDetail: string; }; /** DTF transfer facts: mirrored film print, white behind CMYK, press. */ export type DtfFacts = { mirror: boolean; whiteUnderbase: boolean; pressSpec: string; /** Gang-sheet convention for the film run. */ filmNote: string; }; /** Sublimation facts: poly/light-garment gates, mirrored transfer, press. */ export type SublimationFacts = { mirror: boolean; /** Dye only bonds to polyester (≥65%, 100% ideal). */ polyOk: boolean; /** No white sublimation ink — white areas = garment color. */ lightGarment: boolean; pressSpec: string; }; /** Print-method production facts (screen / DTG / vinyl / DTF / sublimation). */ export type PrintSpec = { /** Effective raster DPI at the printed size (null for vector art). */ dpiAtSize: number | null; isVector: boolean; /** Distinct spot colors detected in the art. */ colorCount: number; /** Screen count for screen print (colors + underbase screen). */ screens: number | null; /** Light ink on a dark garment needs an underbase (screen print). */ underbase: boolean; /** Dominant art colors with nearest-PMS references (all print methods). */ inks: InkColor[]; screenPrint: ScreenPrintFacts | null; dtg: DtgFacts | null; vinyl: VinylFacts | null; dtf: DtfFacts | null; sublimation: SublimationFacts | null; warnings: string[]; }; /** Dark garments need underbase/pretreat — shared with app-side pricing. */ export declare const garmentIsDark: (hex: string) => boolean; export declare const buildPrintSpec: (method: string, art: ArtFacts | undefined, dims: DesignDimensions, garmentHex: string, fabric?: string) => PrintSpec | null; /** Shop shorthand → spoken name. Always print both — the codes are * ubiquitous decorator convention, not a governed standard. */ export declare const PLACEMENT_CODE_NAMES: Record; /** * Placement code for a design: the zone's code, refined to LC/RC when a * small design sits off-center on a full-front zone (+X = wearer's left). */ export declare const placementCode: (zone: DecorationZoneSpec, dims: DesignDimensions) => string | null; export declare const placementCodeLabel: (code: string | null) => string | null; export type GangSheetPlan = { filmWidthIn: number; /** Linear film length to order/print, inches (rounded up). */ lengthIn: number; pieces: number; rows: number; /** Printed-area fraction of the film used (0–1). */ utilization: number; }; /** * Shelf-pack DTF designs onto a film roll (22″ standard width, gaps between * pieces). Row-based packing — a slight overestimate, which is the right * direction for ordering film. */ export declare const gangSheetPlan: (designs: { widthIn: number; heightIn: number; count: number; }[], filmWidthIn?: number, gapIn?: number) => GangSheetPlan; export type PlacementSpec = { zoneId: string; zoneLabel: string; /** Decorator shorthand for the spot (LC, FB…), when derivable. */ code: string | null; artwork: string; artworkUrl: string | null; anchor: string; dimensions: DesignDimensions; rotationDeg: number; embroideryType: EmbroideryType; stitchTier: string | null; estimatedStitches: number | null; threads: ThreadRef[]; hoop: string | null; note: string | null; pantone: PantoneMatch | null; /** Raw brand-color request for print methods, e.g. "PMS 186 C". */ pmsRequest: string | null; print: PrintSpec | null; }; export type ItemSpec = { product: string; productId: string; method: string; methodLabel: string; garmentColor: { name: string; hex: string; }; size: string; quantity: number; names: string[]; fabric: string; backing: string; placements: PlacementSpec[]; }; /** Ground truth read from the digitized machine file (vs our estimates). */ export type MachineFileFacts = { stitches: number; colorChanges: number; widthMm: number; heightMm: number; label: string; filename: string; /** Which uploaded artwork this file was digitized from (multi-design orders). */ artworkUrl?: string | null; }; export type OrderProductionSpec = { version: 1; generatedAt: string; items: ItemSpec[]; notes: string[]; /** Legacy single-file slot — read when machineFiles is absent. */ machineFile?: MachineFileFacts; /** Parsed machine files, one per digitized design (keyed by artworkUrl). */ machineFiles?: MachineFileFacts[]; }; /** All parsed machine files on a spec (legacy single slot included). */ export declare const specMachineFiles: (spec: OrderProductionSpec) => MachineFileFacts[]; /** The machine file digitized from a placement's artwork, if attached. */ export declare const machineFileFor: (spec: OrderProductionSpec, place: Pick) => MachineFileFacts | undefined; /** Total estimated stitches across all embroidery placements. */ export declare const totalEstimatedStitches: (spec: OrderProductionSpec) => number; export type DecorationPlacementInput = { zone: DecorationZoneSpec; zoneId: string; zoneLabel: string; artwork: string; artworkUrl: string | null; transform?: PlacementTransform; aspect?: number; coverage?: number; threads?: ThreadRef[]; embroideryType?: EmbroideryType; note?: string; pantone?: PantoneMatch | null; /** Customer's brand-color callout for print methods ("PMS 186 C"). */ pmsRequest?: string | null; art?: ArtFacts; /** App-resolved tier label (e.g. "Left chest"); null for print methods. */ stitchTierLabel?: string | null; /** Override the round-hoop suggestion (e.g. "Cap frame"). */ hoopOverride?: string; }; export type DecorationItemInput = { product: string; productId: string; method: string; methodLabel: string; usesStitchSize: boolean; garmentColor: { name: string; hex: string; }; size: string; quantity: number; names: string[]; fabric: string; backing: string; placements: DecorationPlacementInput[]; }; export declare const buildOrderProductionSpec: (items: DecorationItemInput[], generatedAt: string) => OrderProductionSpec; export declare const threadSequenceText: (spec: OrderProductionSpec) => string; export declare const printSheetText: (spec: OrderProductionSpec) => string; /** Order-level facts for the work-order header (all optional/legacy-safe). */ export type WorkOrderHeader = { customerEmail?: string | null; placedAt?: string | null; dueDate?: string | null; /** 'pickup' | 'ship' — how the finished run leaves the shop. */ fulfillment?: string | null; proofStatus?: string | null; sewoutStatus?: string | null; }; export declare const workOrderMarkdown: (spec: OrderProductionSpec, orderRef: string, header?: WorkOrderHeader) => string; export {};