@tscircuit/props 0.0.609 → 0.0.610

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,6 +45,12 @@ export interface AutorouterDefinition {
45
45
  ) => AutorouterInstance | Promise<AutorouterInstance>
46
46
  }
47
47
 
48
+ export interface LocalCacheEngine {
49
+ getItem(key: string): string | Promise<string | null> | null
50
+ setItem(key: string, value: string): void | Promise<void>
51
+ removeItem?(key: string): void | Promise<void>
52
+ }
53
+
48
54
  /** e.g. "kicad", this is the prefix used to reference libraries in footprinter strings e.g. kicad:Resistor_0402 **/
49
55
  type FootprintLibraryPrefix = string
50
56
 
@@ -72,8 +78,14 @@ export interface PlatformConfig {
72
78
  */
73
79
  allowLegacyAutorouters?: boolean
74
80
 
75
- // TODO this follows a subset of the localStorage interface
76
- localCacheEngine?: any
81
+ /** A localStorage-compatible cache used by render phases and engines. */
82
+ localCacheEngine?: LocalCacheEngine
83
+
84
+ /**
85
+ * Analyze rendered and supplier footprints so manufacturing exporters can
86
+ * align their semantic pin 1 orientations.
87
+ */
88
+ enablePartOrientationAnalysis?: boolean
77
89
 
78
90
  registryApiUrl?: string
79
91
 
@@ -205,6 +217,16 @@ const platformFetch = z
205
217
  .custom<typeof fetch>((value) => typeof value === "function")
206
218
  .describe("A fetch-like function to use for platform requests")
207
219
 
220
+ const localCacheEngine = z.custom<LocalCacheEngine>(
221
+ (value) =>
222
+ typeof value === "object" &&
223
+ value !== null &&
224
+ "getItem" in value &&
225
+ typeof value.getItem === "function" &&
226
+ "setItem" in value &&
227
+ typeof value.setItem === "function",
228
+ )
229
+
208
230
  export const platformConfig = z.object({
209
231
  partsEngine: partsEngine.optional(),
210
232
  autorouter: autorouterProp.optional(),
@@ -231,7 +253,8 @@ export const platformConfig = z.object({
231
253
  .optional(),
232
254
  defaultSpiceEngine: defaultSpiceEngine.optional(),
233
255
  unitPreference: z.enum(["mm", "in", "mil"]).optional(),
234
- localCacheEngine: z.any().optional(),
256
+ localCacheEngine: localCacheEngine.optional(),
257
+ enablePartOrientationAnalysis: z.boolean().optional(),
235
258
  pcbDisabled: z.boolean().optional(),
236
259
  routingDisabled: z.boolean().optional(),
237
260
  schematicDisabled: z.boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.609",
3
+ "version": "0.0.610",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",