@tscircuit/core 0.0.366 → 0.0.368

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
@@ -1041,6 +1041,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
1041
1041
 
1042
1042
  declare class Board extends Group<typeof boardProps> {
1043
1043
  pcb_board_id: string | null;
1044
+ _drcChecksComplete: boolean;
1044
1045
  get isSubcircuit(): boolean;
1045
1046
  get config(): {
1046
1047
  componentName: string;
@@ -1667,6 +1668,7 @@ declare class Board extends Group<typeof boardProps> {
1667
1668
  removePcbComponentRender(): void;
1668
1669
  _computePcbGlobalTransformBeforeLayout(): Matrix;
1669
1670
  doInitialPcbDesignRuleChecks(): void;
1671
+ updatePcbDesignRuleChecks(): void;
1670
1672
  }
1671
1673
 
1672
1674
  declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePorts> {
@@ -1939,6 +1941,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
1939
1941
  bypassFor: zod.ZodOptional<zod.ZodString>;
1940
1942
  bypassTo: zod.ZodOptional<zod.ZodString>;
1941
1943
  maxDecouplingTraceLength: zod.ZodOptional<zod.ZodNumber>;
1944
+ connections: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["pin1", "pin2", "pos", "neg", "anode", "cathode"]>, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
1942
1945
  }>, "strip", zod.ZodTypeAny, {
1943
1946
  name: string;
1944
1947
  capacitance: number;
@@ -2009,6 +2012,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
2009
2012
  } | undefined;
2010
2013
  children?: any;
2011
2014
  symbolName?: string | undefined;
2015
+ connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
2012
2016
  maxVoltageRating?: number | undefined;
2013
2017
  decouplingFor?: string | undefined;
2014
2018
  decouplingTo?: string | undefined;
@@ -2085,6 +2089,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
2085
2089
  } | undefined;
2086
2090
  children?: any;
2087
2091
  symbolName?: string | undefined;
2092
+ connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
2088
2093
  maxVoltageRating?: string | number | undefined;
2089
2094
  schShowRatings?: boolean | undefined;
2090
2095
  polarized?: boolean | undefined;
@@ -5006,6 +5011,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
5006
5011
  pullupTo: zod.ZodOptional<zod.ZodString>;
5007
5012
  pulldownFor: zod.ZodOptional<zod.ZodString>;
5008
5013
  pulldownTo: zod.ZodOptional<zod.ZodString>;
5014
+ connections: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["pin1", "pin2", "pos", "neg"]>, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
5009
5015
  }>, "strip", zod.ZodTypeAny, {
5010
5016
  name: string;
5011
5017
  resistance: number;
@@ -5074,6 +5080,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
5074
5080
  } | undefined;
5075
5081
  children?: any;
5076
5082
  symbolName?: string | undefined;
5083
+ connections?: Partial<Record<"pin1" | "pin2" | "pos" | "neg", string | readonly string[] | string[]>> | undefined;
5077
5084
  pullupFor?: string | undefined;
5078
5085
  pullupTo?: string | undefined;
5079
5086
  pulldownFor?: string | undefined;
@@ -5148,6 +5155,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
5148
5155
  } | undefined;
5149
5156
  children?: any;
5150
5157
  symbolName?: string | undefined;
5158
+ connections?: Partial<Record<"pin1" | "pin2" | "pos" | "neg", string | readonly string[] | string[]>> | undefined;
5151
5159
  pullupFor?: string | undefined;
5152
5160
  pullupTo?: string | undefined;
5153
5161
  pulldownFor?: string | undefined;
package/dist/index.js CHANGED
@@ -6234,6 +6234,7 @@ var Group = class extends NormalComponent {
6234
6234
  import { checkEachPcbTraceNonOverlapping as checkEachPcbTraceNonOverlapping2 } from "@tscircuit/checks";
6235
6235
  var Board = class extends Group {
6236
6236
  pcb_board_id = null;
6237
+ _drcChecksComplete = false;
6237
6238
  get isSubcircuit() {
6238
6239
  return true;
6239
6240
  }
@@ -6331,8 +6332,15 @@ var Board = class extends Group {
6331
6332
  doInitialPcbDesignRuleChecks() {
6332
6333
  if (this.root?.pcbDisabled) return;
6333
6334
  if (this.getInheritedProperty("routingDisabled")) return;
6334
- const { db } = this.root;
6335
6335
  super.doInitialPcbDesignRuleChecks();
6336
+ }
6337
+ updatePcbDesignRuleChecks() {
6338
+ if (this.root?.pcbDisabled) return;
6339
+ if (this.getInheritedProperty("routingDisabled")) return;
6340
+ const { db } = this.root;
6341
+ if (!this._areChildSubcircuitsRouted()) return;
6342
+ if (this._drcChecksComplete) return;
6343
+ this._drcChecksComplete = true;
6336
6344
  const errors = checkEachPcbTraceNonOverlapping2(db.toArray());
6337
6345
  for (const error of errors) {
6338
6346
  db.pcb_trace_error.insert(error);
@@ -6401,6 +6409,7 @@ var Capacitor = class extends NormalComponent {
6401
6409
  })
6402
6410
  );
6403
6411
  }
6412
+ this._createTracesFromConnectionsProp();
6404
6413
  }
6405
6414
  doInitialSourceRender() {
6406
6415
  const { db } = this.root;
@@ -6646,6 +6655,7 @@ var Resistor = class extends NormalComponent {
6646
6655
  })
6647
6656
  );
6648
6657
  }
6658
+ this._createTracesFromConnectionsProp();
6649
6659
  }
6650
6660
  doInitialSourceRender() {
6651
6661
  const { db } = this.root;
@@ -7431,7 +7441,7 @@ import { identity as identity4 } from "transformation-matrix";
7431
7441
  var package_default = {
7432
7442
  name: "@tscircuit/core",
7433
7443
  type: "module",
7434
- version: "0.0.365",
7444
+ version: "0.0.367",
7435
7445
  types: "dist/index.d.ts",
7436
7446
  main: "dist/index.js",
7437
7447
  module: "dist/index.js",
@@ -7488,7 +7498,7 @@ var package_default = {
7488
7498
  "@tscircuit/circuit-json-util": "^0.0.45",
7489
7499
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
7490
7500
  "@tscircuit/math-utils": "^0.0.12",
7491
- "@tscircuit/props": "^0.0.170",
7501
+ "@tscircuit/props": "^0.0.171",
7492
7502
  "@tscircuit/schematic-autolayout": "^0.0.6",
7493
7503
  "@tscircuit/soup-util": "^0.0.41",
7494
7504
  "circuit-json": "^0.0.153",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.366",
4
+ "version": "0.0.368",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "@tscircuit/circuit-json-util": "^0.0.45",
59
59
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
60
60
  "@tscircuit/math-utils": "^0.0.12",
61
- "@tscircuit/props": "^0.0.170",
61
+ "@tscircuit/props": "^0.0.171",
62
62
  "@tscircuit/schematic-autolayout": "^0.0.6",
63
63
  "@tscircuit/soup-util": "^0.0.41",
64
64
  "circuit-json": "^0.0.153",