/** * DeviceCatalog — versioned, validated device catalog schema. * * A DeviceCatalog is a curated library of verified device definitions used * in EasyEDA Pro projects. Each entry is a "known-good" device with stable * catalog IDs, pre-validated symbol/footprint/3D-model references, pin * mapping, electrical parameters, lifecycle and assembly hints, and cross- * references to supplier databases (LCSC, JLCPCB, Mouser, DigiKey). * * The catalog is designed to be: * 1. **Versioned** — schema version string for forward compatibility. * 2. **Validated** — cross-field refs are checked at parse time. * 3. **Extensible** — new device classes and suppliers can be added. * 4. **Reusable** — CircuitIR devices can be resolved from the catalog. * * @schema device-catalog/v1 */ import { z } from 'zod'; export declare const DEVICE_CATALOG_SCHEMA_VERSION = "device-catalog/v1"; /** * Prefix used for a `symbolRef`/`footprintRef` value when a device was * ingested but the reference could not be resolved to a real EasyEDA * library entry (e.g. `LIB_Device.getByLcscIds` found no match). Kept * non-empty so it still satisfies `DeviceEntrySchema`'s `.min(1)` * constraint, but flagged as invalid by `validateCatalog`/`validateDeviceEntry` * for any category that requires a real symbol/footprint — see * `src/catalog/validation.ts`. */ export declare const UNRESOLVED_REF_PREFIX = "UNRESOLVED:"; /** * Lifecycle status of a device. */ export declare const LifecycleStatusSchema: z.ZodEnum<{ deprecated: "deprecated"; obsolete: "obsolete"; active: "active"; new: "new"; "not-recommended": "not-recommended"; }>; export type LifecycleStatus = z.infer; /** * Assembly availability hint. */ export declare const AssemblyHintSchema: z.ZodObject<{ status: z.ZodEnum<{ unknown: "unknown"; "in-production": "in-production"; limited: "limited"; "end-of-life": "end-of-life"; "contact-factory": "contact-factory"; }>; moq: z.ZodOptional; leadTimeWeeks: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>; export type AssemblyHint = z.infer; /** * Electrical parameter entry (key-value with optional unit). */ export declare const ElectricalParamSchema: z.ZodObject<{ name: z.ZodString; value: z.ZodString; unit: z.ZodOptional; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>; export type ElectricalParam = z.infer; /** * Pin mapping entry. */ export declare const PinMappingSchema: z.ZodObject<{ pin: z.ZodString; name: z.ZodString; type: z.ZodOptional>; description: z.ZodOptional; }, z.core.$strip>; export type PinMapping = z.infer; /** * Supplier ID cross-reference. */ export declare const SupplierIdSchema: z.ZodObject<{ supplier: z.ZodString; partId: z.ZodString; url: z.ZodOptional; }, z.core.$strip>; export type SupplierId = z.infer; /** * 3D model reference — either a URL/path or an explicit missing marker. */ export declare const Model3DRefSchema: z.ZodUnion, z.ZodLiteral<"">]>; export type Model3DRef = z.infer; /** * Single device entry in the catalog. */ export declare const DeviceEntrySchema: z.ZodObject<{ id: z.ZodString; displayName: z.ZodString; category: z.ZodString; description: z.ZodOptional; subCategory: z.ZodOptional; symbolRef: z.ZodString; footprintRef: z.ZodString; model3dRef: z.ZodDefault, z.ZodLiteral<"">]>>; manufacturer: z.ZodString; mpn: z.ZodString; lcsc: z.ZodOptional; jlcpcb: z.ZodOptional; supplierIds: z.ZodDefault; }, z.core.$strip>>>; package: z.ZodString; standardPackage: z.ZodOptional; pinMapping: z.ZodDefault>; description: z.ZodOptional; }, z.core.$strip>>>; electricalParams: z.ZodDefault; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>>; lifecycleStatus: z.ZodDefault>; assemblyHint: z.ZodOptional; moq: z.ZodOptional; leadTimeWeeks: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>>; datasheetUrl: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; productPageUrl: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; metadata: z.ZodDefault>>; notes: z.ZodOptional; }, z.core.$strict>; export type DeviceEntry = z.infer; export declare const DeviceCatalogSchema: z.ZodObject<{ $schema: z.ZodDefault>; devices: z.ZodDefault; subCategory: z.ZodOptional; symbolRef: z.ZodString; footprintRef: z.ZodString; model3dRef: z.ZodDefault, z.ZodLiteral<"">]>>; manufacturer: z.ZodString; mpn: z.ZodString; lcsc: z.ZodOptional; jlcpcb: z.ZodOptional; supplierIds: z.ZodDefault; }, z.core.$strip>>>; package: z.ZodString; standardPackage: z.ZodOptional; pinMapping: z.ZodDefault>; description: z.ZodOptional; }, z.core.$strip>>>; electricalParams: z.ZodDefault; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>>; lifecycleStatus: z.ZodDefault>; assemblyHint: z.ZodOptional; moq: z.ZodOptional; leadTimeWeeks: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>>; datasheetUrl: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; productPageUrl: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; metadata: z.ZodDefault>>; notes: z.ZodOptional; }, z.core.$strict>>>; metadata: z.ZodOptional>; name: z.ZodOptional; description: z.ZodOptional; updatedAt: z.ZodOptional; deviceCount: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strict>; export type DeviceCatalog = z.infer; /** * Parse and validate an unknown input as a DeviceCatalog. * * Returns the validated DeviceCatalog on success. * Throws `CatalogError` with structured errors on failure. */ export declare function validateDeviceCatalog(input: unknown): DeviceCatalog; /** * Parse and validate an unknown input as a single DeviceEntry. * * Returns the validated DeviceEntry on success. * Throws `CatalogError` with structured errors on failure. */ export declare function validateDeviceEntry(input: unknown): DeviceEntry; /** * Type guard: check whether an unknown value is a valid DeviceCatalog. */ export declare function isDeviceCatalog(value: unknown): value is DeviceCatalog; /** * Type guard: check whether an unknown value is a valid DeviceEntry. */ export declare function isDeviceEntry(value: unknown): value is DeviceEntry;