@tscircuit/props 0.0.463 → 0.0.465
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.
- package/README.md +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +2 -0
- package/lib/platformConfig.ts +6 -0
- package/package.json +1 -1
package/lib/components/group.ts
CHANGED
|
@@ -446,6 +446,7 @@ export interface SubcircuitGroupProps extends BaseGroupProps {
|
|
|
446
446
|
schMaxTraceDistance?: Distance
|
|
447
447
|
|
|
448
448
|
partsEngine?: PartsEngine
|
|
449
|
+
_subcircuitCachingEnabled?: boolean
|
|
449
450
|
|
|
450
451
|
/** When autosizing, the board will be made square */
|
|
451
452
|
square?: boolean
|
|
@@ -581,6 +582,7 @@ export const subcircuitGroupProps = baseGroupProps.extend({
|
|
|
581
582
|
minTraceWidth: length.optional(),
|
|
582
583
|
nominalTraceWidth: length.optional(),
|
|
583
584
|
partsEngine: partsEngine.optional(),
|
|
585
|
+
_subcircuitCachingEnabled: z.boolean().optional(),
|
|
584
586
|
pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),
|
|
585
587
|
autorouter: autorouterProp.optional(),
|
|
586
588
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
package/lib/platformConfig.ts
CHANGED
|
@@ -94,6 +94,7 @@ export interface PlatformConfig {
|
|
|
94
94
|
|
|
95
95
|
resolveProjectStaticFileImportUrl?: (path: string) => Promise<string>
|
|
96
96
|
nodeModulesResolver?: (modulePath: string) => Promise<string | null>
|
|
97
|
+
platformFetch?: typeof fetch
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
const unvalidatedCircuitJson = z.array(z.any()).describe("Circuit JSON")
|
|
@@ -166,6 +167,10 @@ const autorouterDefinition = z.object({
|
|
|
166
167
|
.describe("Create an autorouter instance"),
|
|
167
168
|
})
|
|
168
169
|
|
|
170
|
+
const platformFetch = z
|
|
171
|
+
.custom<typeof fetch>((value) => typeof value === "function")
|
|
172
|
+
.describe("A fetch-like function to use for platform requests")
|
|
173
|
+
|
|
169
174
|
export const platformConfig = z.object({
|
|
170
175
|
partsEngine: partsEngine.optional(),
|
|
171
176
|
autorouter: autorouterProp.optional(),
|
|
@@ -218,6 +223,7 @@ export const platformConfig = z.object({
|
|
|
218
223
|
"A function that returns a string URL for static files for the project",
|
|
219
224
|
)
|
|
220
225
|
.optional(),
|
|
226
|
+
platformFetch: platformFetch.optional(),
|
|
221
227
|
}) as z.ZodType<PlatformConfig>
|
|
222
228
|
|
|
223
229
|
expectTypesMatch<PlatformConfig, z.infer<typeof platformConfig>>(true)
|