@tscircuit/props 0.0.616 → 0.0.618
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 +2 -1
- package/dist/index.d.ts +35 -29
- package/dist/index.js +156 -137
- package/dist/index.js.map +1 -1
- package/lib/components/capacitor.ts +4 -3
- package/lib/components/group.ts +44 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { capacitance, voltage } from "circuit-json"
|
|
1
|
+
import { capacitance, distance, voltage } from "circuit-json"
|
|
2
2
|
import { createConnectionsProp } from "lib/common/connectionsProp"
|
|
3
3
|
import {
|
|
4
4
|
type CommonComponentProps,
|
|
@@ -37,7 +37,8 @@ export interface CapacitorProps<PinLabel extends string = string>
|
|
|
37
37
|
decouplingTo?: string
|
|
38
38
|
bypassFor?: string
|
|
39
39
|
bypassTo?: string
|
|
40
|
-
|
|
40
|
+
/** Maximum allowed PCB trace length between this capacitor and the component it decouples */
|
|
41
|
+
maxDecouplingTraceLength?: number | string
|
|
41
42
|
schOrientation?: SchematicOrientation
|
|
42
43
|
schSize?: SchematicSymbolSize
|
|
43
44
|
connections?: Connections<CapacitorPinLabels>
|
|
@@ -52,7 +53,7 @@ export const capacitorProps = commonComponentProps.extend({
|
|
|
52
53
|
decouplingTo: z.string().optional(),
|
|
53
54
|
bypassFor: z.string().optional(),
|
|
54
55
|
bypassTo: z.string().optional(),
|
|
55
|
-
maxDecouplingTraceLength:
|
|
56
|
+
maxDecouplingTraceLength: distance.optional(),
|
|
56
57
|
schOrientation: schematicOrientation.optional(),
|
|
57
58
|
schSize: schematicSymbolSize.optional(),
|
|
58
59
|
connections: createConnectionsProp(capacitorPinLabels).optional(),
|
package/lib/components/group.ts
CHANGED
|
@@ -479,6 +479,39 @@ export const autorouterProp: z.ZodType<AutorouterProp> = z.union([
|
|
|
479
479
|
|
|
480
480
|
export const autorouterEffortLevel = z.enum(["1x", "2x", "5x", "10x", "100x"])
|
|
481
481
|
|
|
482
|
+
export type AutorouterVersion =
|
|
483
|
+
| "beta_pipeline1"
|
|
484
|
+
| "beta_pipeline3"
|
|
485
|
+
| "beta_pipeline4"
|
|
486
|
+
| "beta_pipeline5"
|
|
487
|
+
| "beta_pipeline7"
|
|
488
|
+
| "beta_pipeline9"
|
|
489
|
+
| "latest"
|
|
490
|
+
|
|
491
|
+
const knownAutorouterVersion = z.enum([
|
|
492
|
+
"beta_pipeline1",
|
|
493
|
+
"beta_pipeline3",
|
|
494
|
+
"beta_pipeline4",
|
|
495
|
+
"beta_pipeline5",
|
|
496
|
+
"beta_pipeline7",
|
|
497
|
+
"beta_pipeline9",
|
|
498
|
+
"latest",
|
|
499
|
+
])
|
|
500
|
+
|
|
501
|
+
const autorouterVersion = z
|
|
502
|
+
.custom<AutocompleteString<AutorouterVersion>>(
|
|
503
|
+
(value) => typeof value === "string",
|
|
504
|
+
)
|
|
505
|
+
.transform((value): AutorouterVersion => {
|
|
506
|
+
const parsedAutorouterVersion = knownAutorouterVersion.safeParse(value)
|
|
507
|
+
if (parsedAutorouterVersion.success) return parsedAutorouterVersion.data
|
|
508
|
+
|
|
509
|
+
console.warn(
|
|
510
|
+
`Unknown autorouterVersion "${value}", falling back to "latest".`,
|
|
511
|
+
)
|
|
512
|
+
return "latest"
|
|
513
|
+
})
|
|
514
|
+
|
|
482
515
|
export interface SubcircuitGroupProps
|
|
483
516
|
extends BaseGroupProps,
|
|
484
517
|
RoutingTolerances {
|
|
@@ -498,15 +531,19 @@ export interface SubcircuitGroupProps
|
|
|
498
531
|
|
|
499
532
|
autorouter?: AutorouterProp
|
|
500
533
|
autorouterEffortLevel?: "1x" | "2x" | "5x" | "10x" | "100x"
|
|
534
|
+
/**
|
|
535
|
+
* Selects the local autorouting pipeline. Unknown string values emit a
|
|
536
|
+
* warning and fall back to `latest`.
|
|
537
|
+
*/
|
|
501
538
|
autorouterVersion?:
|
|
502
|
-
| "
|
|
503
|
-
| "
|
|
504
|
-
| "
|
|
505
|
-
| "
|
|
506
|
-
| "
|
|
507
|
-
| "v6"
|
|
539
|
+
| "beta_pipeline1"
|
|
540
|
+
| "beta_pipeline3"
|
|
541
|
+
| "beta_pipeline4"
|
|
542
|
+
| "beta_pipeline5"
|
|
543
|
+
| "beta_pipeline7"
|
|
508
544
|
| "beta_pipeline9"
|
|
509
545
|
| "latest"
|
|
546
|
+
| (string & {})
|
|
510
547
|
|
|
511
548
|
/**
|
|
512
549
|
* Serialized circuit JSON describing a precompiled subcircuit
|
|
@@ -684,9 +721,7 @@ export const subcircuitGroupProps = baseGroupProps.extend({
|
|
|
684
721
|
pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),
|
|
685
722
|
autorouter: autorouterProp.optional(),
|
|
686
723
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
687
|
-
autorouterVersion:
|
|
688
|
-
.enum(["v1", "v2", "v3", "v4", "v5", "v6", "beta_pipeline9", "latest"])
|
|
689
|
-
.optional(),
|
|
724
|
+
autorouterVersion: autorouterVersion.optional(),
|
|
690
725
|
square: z.boolean().optional(),
|
|
691
726
|
emptyArea: z.string().optional(),
|
|
692
727
|
filledArea: z.string().optional(),
|