@tscircuit/props 0.0.605 → 0.0.606

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
@@ -2,7 +2,7 @@ import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import * as react from 'react';
4
4
  import { ReactElement, ReactNode } from 'react';
5
- import { LayerRef, AnyCircuitElement, LayerRefInput, SourceNet, PcbPort, SourcePort, PcbComponent, SourceComponentBase, CircuitJsonError, Point as Point$1, RouteHintPoint, PcbTrace, AnySourceComponent, VisibleLayer, RouteHintPointInput } from 'circuit-json';
5
+ import { LayerRef, AnyCircuitElement, LayerRefInput, SourceNet, PcbPort, SourcePort, PcbComponent, SourceComponentBase, CircuitJsonError, Point as Point$1, RouteHintPoint, PcbTrace, AnySourceComponent, InsertionDirectionInput, VisibleLayer, RouteHintPointInput } from 'circuit-json';
6
6
 
7
7
  declare const direction: z.ZodEnum<["up", "down", "left", "right"]>;
8
8
  type Direction = "up" | "down" | "left" | "right";
@@ -104990,8 +104990,18 @@ declare const differentialPairProps: z.ZodObject<{
104990
104990
  maxLengthSkew?: number | undefined;
104991
104991
  }>;
104992
104992
 
104993
- type FootprintInsertionDirection = "from_above" | "from_left" | "from_right" | "from_front" | "from_back";
104994
- declare const footprintInsertionDirection: z.ZodEnum<["from_above", "from_left", "from_right", "from_front", "from_back"]>;
104993
+ /**
104994
+ * Direction a cable or mating part is attached from, named for the side of the
104995
+ * footprint it approaches from.
104996
+ *
104997
+ * Aliased to Circuit JSON's input union so the two cannot drift apart. Both the
104998
+ * named spellings and their Cartesian equivalents are accepted here, as are the
104999
+ * deprecated `from_front` (now `from_top`) and `from_back` (now `from_bottom`).
105000
+ * Core normalizes them to the six named values before writing
105001
+ * `pcb_component.insertion_direction`.
105002
+ */
105003
+ type FootprintInsertionDirection = InsertionDirectionInput;
105004
+ declare const footprintInsertionDirection: z.ZodEnum<["from_left", "from_right", "from_top", "from_bottom", "from_above", "from_below", "from_x_neg", "from_x_pos", "from_y_pos", "from_y_neg", "from_z_pos", "from_z_neg", "from_front", "from_back"]>;
104995
105005
  interface FootprintProps {
104996
105006
  children?: any;
104997
105007
  name?: string;
@@ -105015,8 +105025,21 @@ interface FootprintProps {
105015
105025
  */
105016
105026
  src?: FootprintProp;
105017
105027
  /**
105018
- * Direction a cable or mating part is inserted into this footprint in its
105019
- * unrotated orientation.
105028
+ * Direction a cable or mating part is attached from, in the footprint's own
105029
+ * frame -- the same frame its pads are drawn in. Directions are named for the
105030
+ * footprint as drawn in the 2D PCB view: `from_top` is +Y, `from_bottom` -Y,
105031
+ * `from_left` -X, `from_right` +X, `from_above` +Z and `from_below` -Z.
105032
+ * Cartesian spellings such as `from_y_pos` are also accepted.
105033
+ *
105034
+ * This names a side, not a motion. A receptacle on the +Y edge is `from_top`
105035
+ * because that is the side the plug comes from, even though the plug itself
105036
+ * moves in -Y as it seats.
105037
+ *
105038
+ * This is a property of the part, so it is authored without regard to where
105039
+ * the part is placed. Rotating or flipping the component rotates this with it,
105040
+ * and `pcb_component.insertion_direction` reports the result in board
105041
+ * coordinates. The two frames coincide for an unrotated top-layer part, which
105042
+ * makes the distinction easy to miss.
105020
105043
  */
105021
105044
  insertionDirection?: FootprintInsertionDirection;
105022
105045
  }
@@ -105034,14 +105057,14 @@ declare const footprintProps: z.ZodObject<{
105034
105057
  }>>>;
105035
105058
  circuitJson: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
105036
105059
  src: z.ZodOptional<z.ZodType<FootprintProp, z.ZodTypeDef, FootprintProp>>;
105037
- insertionDirection: z.ZodOptional<z.ZodEnum<["from_above", "from_left", "from_right", "from_front", "from_back"]>>;
105060
+ insertionDirection: z.ZodOptional<z.ZodEnum<["from_left", "from_right", "from_top", "from_bottom", "from_above", "from_below", "from_x_neg", "from_x_pos", "from_y_pos", "from_y_neg", "from_z_pos", "from_z_neg", "from_front", "from_back"]>>;
105038
105061
  }, "strip", z.ZodTypeAny, {
105039
105062
  name?: string | undefined;
105040
105063
  children?: any;
105041
105064
  circuitJson?: any[] | undefined;
105042
105065
  originalLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8" | undefined;
105043
105066
  src?: FootprintProp | undefined;
105044
- insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
105067
+ insertionDirection?: "from_left" | "from_right" | "from_top" | "from_bottom" | "from_above" | "from_below" | "from_x_neg" | "from_x_pos" | "from_y_pos" | "from_y_neg" | "from_z_pos" | "from_z_neg" | "from_front" | "from_back" | undefined;
105045
105068
  }, {
105046
105069
  name?: string | undefined;
105047
105070
  children?: any;
@@ -105050,7 +105073,7 @@ declare const footprintProps: z.ZodObject<{
105050
105073
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8";
105051
105074
  } | undefined;
105052
105075
  src?: FootprintProp | undefined;
105053
- insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
105076
+ insertionDirection?: "from_left" | "from_right" | "from_top" | "from_bottom" | "from_above" | "from_below" | "from_x_neg" | "from_x_pos" | "from_y_pos" | "from_y_neg" | "from_z_pos" | "from_z_neg" | "from_front" | "from_back" | undefined;
105054
105077
  }>;
105055
105078
  type FootprintPropsInput = z.input<typeof footprintProps>;
105056
105079
 
package/dist/index.js CHANGED
@@ -17405,12 +17405,24 @@ var differentialPairProps = z72.object({
17405
17405
  expectTypesMatch(true);
17406
17406
 
17407
17407
  // lib/components/footprint.ts
17408
- import { layer_ref as layer_ref6 } from "circuit-json";
17408
+ import {
17409
+ layer_ref as layer_ref6
17410
+ } from "circuit-json";
17409
17411
  import { z as z73 } from "zod";
17410
17412
  var footprintInsertionDirection = z73.enum([
17411
- "from_above",
17412
17413
  "from_left",
17413
17414
  "from_right",
17415
+ "from_top",
17416
+ "from_bottom",
17417
+ "from_above",
17418
+ "from_below",
17419
+ "from_x_neg",
17420
+ "from_x_pos",
17421
+ "from_y_pos",
17422
+ "from_y_neg",
17423
+ "from_z_pos",
17424
+ "from_z_neg",
17425
+ // Deprecated, accepted so existing sources keep type-checking.
17414
17426
  "from_front",
17415
17427
  "from_back"
17416
17428
  ]);
@@ -17422,7 +17434,7 @@ var footprintProps = z73.object({
17422
17434
  circuitJson: z73.array(z73.any()).optional(),
17423
17435
  src: footprintProp.describe("Can be a footprint or kicad string").optional(),
17424
17436
  insertionDirection: footprintInsertionDirection.optional().describe(
17425
- "Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
17437
+ "Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
17426
17438
  )
17427
17439
  });
17428
17440
  expectTypesMatch(true);