@tscircuit/core 0.0.931 → 0.0.933

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/dist/index.d.ts CHANGED
@@ -10,10 +10,10 @@ import { z, ZodType } from 'zod';
10
10
  import { symbols, SchSymbol, BaseSymbolName } from 'schematic-symbols';
11
11
  import { Matrix } from 'transformation-matrix';
12
12
  import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
13
- import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
14
- import { GraphicsObject } from 'graphics-debug';
15
13
  import { PackSolver2 } from 'calculate-packing';
16
14
  import { AutoroutingPipelineSolver, AssignableViaAutoroutingPipelineSolver } from '@tscircuit/capacity-autorouter';
15
+ import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
16
+ import { GraphicsObject } from 'graphics-debug';
17
17
 
18
18
  declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SchematicPrimitiveRender", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SimulationSpiceEngineRender"];
19
19
  type RenderPhase = (typeof orderedRenderPhases)[number];
@@ -123,6 +123,13 @@ interface BoardI {
123
123
  pcb_board_id?: string | null;
124
124
  }
125
125
 
126
+ declare const SOLVERS: {
127
+ PackSolver2: typeof PackSolver2;
128
+ AutoroutingPipelineSolver: typeof AutoroutingPipelineSolver;
129
+ AssignableViaAutoroutingPipelineSolver: typeof AssignableViaAutoroutingPipelineSolver;
130
+ };
131
+ type SolverName = keyof typeof SOLVERS;
132
+
126
133
  type SimplifiedPcbTrace = {
127
134
  type: "pcb_trace";
128
135
  pcb_trace_id: string;
@@ -234,8 +241,8 @@ interface PackingErrorEvent {
234
241
  }
235
242
  interface SolverStartedEvent {
236
243
  type: "solver:started";
237
- solverName: string;
238
- solverParams: unknown;
244
+ solverName: keyof typeof SOLVERS;
245
+ solverParams: any;
239
246
  componentName: string;
240
247
  }
241
248
  interface DebugLogOutputEvent {
@@ -700,11 +707,22 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
700
707
  x: string | number;
701
708
  y: string | number;
702
709
  }>, z.ZodString]>, "many">>;
710
+ pcbPaths: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodObject<{
711
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
712
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
713
+ }, "strip", z.ZodTypeAny, {
714
+ x: number;
715
+ y: number;
716
+ }, {
717
+ x: string | number;
718
+ y: string | number;
719
+ }>, z.ZodString]>, "many">, "many">>;
703
720
  pcbStraightLine: z.ZodOptional<z.ZodBoolean>;
704
721
  schDisplayLabel: z.ZodOptional<z.ZodString>;
705
722
  schStroke: z.ZodOptional<z.ZodString>;
706
723
  highlightColor: z.ZodOptional<z.ZodString>;
707
724
  maxLength: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
725
+ connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
708
726
  } & {
709
727
  path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<{
710
728
  getPortSelector: () => string;
@@ -720,6 +738,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
720
738
  width?: number | undefined;
721
739
  thickness?: number | undefined;
722
740
  maxLength?: number | undefined;
741
+ connectsTo?: string | string[] | undefined;
723
742
  schematicRouteHints?: {
724
743
  x: number;
725
744
  y: number;
@@ -736,6 +755,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
736
755
  x: number;
737
756
  y: number;
738
757
  })[] | undefined;
758
+ pcbPaths?: (string | {
759
+ x: number;
760
+ y: number;
761
+ })[][] | undefined;
739
762
  pcbStraightLine?: boolean | undefined;
740
763
  schDisplayLabel?: string | undefined;
741
764
  schStroke?: string | undefined;
@@ -748,6 +771,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
748
771
  width?: string | number | undefined;
749
772
  thickness?: string | number | undefined;
750
773
  maxLength?: string | number | undefined;
774
+ connectsTo?: string | string[] | undefined;
751
775
  schematicRouteHints?: {
752
776
  x: string | number;
753
777
  y: string | number;
@@ -766,6 +790,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
766
790
  x: string | number;
767
791
  y: string | number;
768
792
  })[] | undefined;
793
+ pcbPaths?: (string | {
794
+ x: string | number;
795
+ y: string | number;
796
+ })[][] | undefined;
769
797
  pcbStraightLine?: boolean | undefined;
770
798
  schDisplayLabel?: string | undefined;
771
799
  schStroke?: string | undefined;
@@ -823,11 +851,22 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
823
851
  x: string | number;
824
852
  y: string | number;
825
853
  }>, z.ZodString]>, "many">>;
854
+ pcbPaths: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodObject<{
855
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
856
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
857
+ }, "strip", z.ZodTypeAny, {
858
+ x: number;
859
+ y: number;
860
+ }, {
861
+ x: string | number;
862
+ y: string | number;
863
+ }>, z.ZodString]>, "many">, "many">>;
826
864
  pcbStraightLine: z.ZodOptional<z.ZodBoolean>;
827
865
  schDisplayLabel: z.ZodOptional<z.ZodString>;
828
866
  schStroke: z.ZodOptional<z.ZodString>;
829
867
  highlightColor: z.ZodOptional<z.ZodString>;
830
868
  maxLength: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
869
+ connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
831
870
  } & {
832
871
  from: z.ZodUnion<[z.ZodString, z.ZodType<{
833
872
  getPortSelector: () => string;
@@ -851,6 +890,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
851
890
  width?: number | undefined;
852
891
  thickness?: number | undefined;
853
892
  maxLength?: number | undefined;
893
+ connectsTo?: string | string[] | undefined;
854
894
  schematicRouteHints?: {
855
895
  x: number;
856
896
  y: number;
@@ -867,6 +907,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
867
907
  x: number;
868
908
  y: number;
869
909
  })[] | undefined;
910
+ pcbPaths?: (string | {
911
+ x: number;
912
+ y: number;
913
+ })[][] | undefined;
870
914
  pcbStraightLine?: boolean | undefined;
871
915
  schDisplayLabel?: string | undefined;
872
916
  schStroke?: string | undefined;
@@ -882,6 +926,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
882
926
  width?: string | number | undefined;
883
927
  thickness?: string | number | undefined;
884
928
  maxLength?: string | number | undefined;
929
+ connectsTo?: string | string[] | undefined;
885
930
  schematicRouteHints?: {
886
931
  x: string | number;
887
932
  y: string | number;
@@ -900,6 +945,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
900
945
  x: string | number;
901
946
  y: string | number;
902
947
  })[] | undefined;
948
+ pcbPaths?: (string | {
949
+ x: string | number;
950
+ y: string | number;
951
+ })[][] | undefined;
903
952
  pcbStraightLine?: boolean | undefined;
904
953
  schDisplayLabel?: string | undefined;
905
954
  schStroke?: string | undefined;
@@ -13528,6 +13577,7 @@ declare class Interconnect extends NormalComponent<typeof interconnectProps> {
13528
13577
  }>>>;
13529
13578
  } & {
13530
13579
  standard: zod.ZodOptional<zod.ZodEnum<["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]>>;
13580
+ internallyConnectedPins: zod.ZodOptional<zod.ZodArray<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">, "many">>;
13531
13581
  }, "strip", zod.ZodTypeAny, {
13532
13582
  name: string;
13533
13583
  symbol?: _tscircuit_props.SymbolProp | undefined;
@@ -13730,6 +13780,7 @@ declare class Interconnect extends NormalComponent<typeof interconnectProps> {
13730
13780
  doNotPlace?: boolean | undefined;
13731
13781
  obstructsWithinBounds?: boolean | undefined;
13732
13782
  showAsTranslucentModel?: boolean | undefined;
13783
+ internallyConnectedPins?: (string | number)[][] | undefined;
13733
13784
  standard?: "0603" | "0805" | "1206" | "TSC0001_36P_XALT_2025_11" | undefined;
13734
13785
  }, {
13735
13786
  name: string;
@@ -13935,6 +13986,7 @@ declare class Interconnect extends NormalComponent<typeof interconnectProps> {
13935
13986
  doNotPlace?: boolean | undefined;
13936
13987
  obstructsWithinBounds?: boolean | undefined;
13937
13988
  showAsTranslucentModel?: boolean | undefined;
13989
+ internallyConnectedPins?: (string | number)[][] | undefined;
13938
13990
  standard?: "0603" | "0805" | "1206" | "TSC0001_36P_XALT_2025_11" | undefined;
13939
13991
  }>;
13940
13992
  shouldRenderAsSchematicBox: boolean;
@@ -44548,13 +44600,6 @@ declare const applySchematicEditEventsToManualEditsFile: ({ circuitJson, editEve
44548
44600
  manualEditsFile: z.infer<typeof manual_edits_file>;
44549
44601
  }) => z.infer<typeof manual_edits_file>;
44550
44602
 
44551
- declare const SOLVERS: {
44552
- PackSolver2: typeof PackSolver2;
44553
- AutoroutingPipelineSolver: typeof AutoroutingPipelineSolver;
44554
- AssignableViaAutoroutingPipelineSolver: typeof AssignableViaAutoroutingPipelineSolver;
44555
- };
44556
- type SolverName = keyof typeof SOLVERS;
44557
-
44558
44603
  interface TscircuitElements {
44559
44604
  resistor: _tscircuit_props.ResistorProps;
44560
44605
  capacitor: _tscircuit_props.CapacitorProps;
package/dist/index.js CHANGED
@@ -9556,6 +9556,20 @@ import {
9556
9556
 
9557
9557
  // lib/utils/autorouting/CapacityMeshAutorouter.ts
9558
9558
  import * as CapacityAutorouter from "@tscircuit/capacity-autorouter";
9559
+
9560
+ // lib/solvers.ts
9561
+ import { PackSolver2 } from "calculate-packing";
9562
+ import {
9563
+ AutoroutingPipelineSolver,
9564
+ AssignableViaAutoroutingPipelineSolver
9565
+ } from "@tscircuit/capacity-autorouter";
9566
+ var SOLVERS = {
9567
+ PackSolver2,
9568
+ AutoroutingPipelineSolver,
9569
+ AssignableViaAutoroutingPipelineSolver
9570
+ };
9571
+
9572
+ // lib/utils/autorouting/CapacityMeshAutorouter.ts
9559
9573
  var CapacityMeshAutorouter = class {
9560
9574
  input;
9561
9575
  isRouting = false;
@@ -9581,14 +9595,15 @@ var CapacityMeshAutorouter = class {
9581
9595
  AutoroutingPipelineSolver: AutoroutingPipelineSolver2,
9582
9596
  AssignableViaAutoroutingPipelineSolver: AssignableViaAutoroutingPipelineSolver2
9583
9597
  } = CapacityAutorouter;
9584
- const SolverClass = useAssignableViaSolver ? AssignableViaAutoroutingPipelineSolver2 : AutoroutingPipelineSolver2;
9598
+ const solverName = useAssignableViaSolver ? "AssignableViaAutoroutingPipelineSolver" : "AutoroutingPipelineSolver";
9599
+ const SolverClass = SOLVERS[solverName];
9585
9600
  this.solver = new SolverClass(input, {
9586
9601
  capacityDepth,
9587
9602
  targetMinCapacity,
9588
9603
  cacheProvider: null
9589
9604
  });
9590
9605
  onSolverStarted?.({
9591
- solverName: SolverClass.name,
9606
+ solverName,
9592
9607
  solverParams: {
9593
9608
  input,
9594
9609
  options: {
@@ -11920,7 +11935,7 @@ function getPresetAutoroutingConfig(autorouterConfig) {
11920
11935
 
11921
11936
  // lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/Group_doInitialPcbLayoutPack.ts
11922
11937
  import {
11923
- PackSolver2,
11938
+ PackSolver2 as PackSolver22,
11924
11939
  convertCircuitJsonToPackOutput,
11925
11940
  convertPackOutputToPackInput,
11926
11941
  getGraphicsFromPackOutput
@@ -12426,10 +12441,10 @@ var Group_doInitialPcbLayoutPack = (group) => {
12426
12441
  }
12427
12442
  let packOutput;
12428
12443
  try {
12429
- const solver = new PackSolver2(packInput);
12444
+ const solver = new PackSolver22(packInput);
12430
12445
  group.root?.emit("solver:started", {
12431
12446
  type: "solver:started",
12432
- solverName: solver.constructor.name,
12447
+ solverName: "PackSolver2",
12433
12448
  solverParams: solver.getConstructorParams(),
12434
12449
  componentName: group.getString()
12435
12450
  });
@@ -19645,7 +19660,7 @@ import { identity as identity5 } from "transformation-matrix";
19645
19660
  var package_default = {
19646
19661
  name: "@tscircuit/core",
19647
19662
  type: "module",
19648
- version: "0.0.930",
19663
+ version: "0.0.932",
19649
19664
  types: "dist/index.d.ts",
19650
19665
  main: "dist/index.js",
19651
19666
  module: "dist/index.js",
@@ -19689,7 +19704,7 @@ var package_default = {
19689
19704
  "@tscircuit/math-utils": "^0.0.29",
19690
19705
  "@tscircuit/miniflex": "^0.0.4",
19691
19706
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
19692
- "@tscircuit/props": "^0.0.429",
19707
+ "@tscircuit/props": "^0.0.432",
19693
19708
  "@tscircuit/schematic-autolayout": "^0.0.6",
19694
19709
  "@tscircuit/schematic-match-adapt": "^0.0.16",
19695
19710
  "@tscircuit/schematic-trace-solver": "^v0.0.45",
@@ -20175,18 +20190,6 @@ var sel = new Proxy(
20175
20190
  }
20176
20191
  );
20177
20192
 
20178
- // lib/solvers.ts
20179
- import { PackSolver2 as PackSolver22 } from "calculate-packing";
20180
- import {
20181
- AutoroutingPipelineSolver,
20182
- AssignableViaAutoroutingPipelineSolver
20183
- } from "@tscircuit/capacity-autorouter";
20184
- var SOLVERS = {
20185
- PackSolver2: PackSolver22,
20186
- AutoroutingPipelineSolver,
20187
- AssignableViaAutoroutingPipelineSolver
20188
- };
20189
-
20190
20193
  // lib/index.ts
20191
20194
  import { createElement } from "react";
20192
20195
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.931",
4
+ "version": "0.0.933",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -45,7 +45,7 @@
45
45
  "@tscircuit/math-utils": "^0.0.29",
46
46
  "@tscircuit/miniflex": "^0.0.4",
47
47
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
48
- "@tscircuit/props": "^0.0.429",
48
+ "@tscircuit/props": "^0.0.432",
49
49
  "@tscircuit/schematic-autolayout": "^0.0.6",
50
50
  "@tscircuit/schematic-match-adapt": "^0.0.16",
51
51
  "@tscircuit/schematic-trace-solver": "^v0.0.45",