@tscircuit/props 0.0.262 → 0.0.263

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.
@@ -1,24 +1,12 @@
1
- import { distance } from "circuit-json"
2
- import { type Point, point } from "lib/common/point"
3
1
  import { expectTypesMatch } from "lib/typecheck"
4
2
  import { z } from "zod"
5
3
  import { subcircuitGroupProps, type SubcircuitGroupProps } from "./group"
6
4
 
7
5
  export interface BoardProps extends Omit<SubcircuitGroupProps, "subcircuit"> {
8
- width?: number | string
9
- height?: number | string
10
- outline?: Point[]
11
- outlineOffsetX?: number | string
12
- outlineOffsetY?: number | string
13
6
  material?: "fr4" | "fr1"
14
7
  }
15
8
 
16
9
  export const boardProps = subcircuitGroupProps.extend({
17
- width: distance.optional(),
18
- height: distance.optional(),
19
- outline: z.array(point).optional(),
20
- outlineOffsetX: distance.optional(),
21
- outlineOffsetY: distance.optional(),
22
10
  material: z.enum(["fr4", "fr1"]).default("fr4"),
23
11
  })
24
12
 
@@ -1,10 +1,11 @@
1
- import { layer_ref, length } from "circuit-json"
1
+ import { layer_ref, length, distance } from "circuit-json"
2
2
  import type { Distance } from "lib/common/distance"
3
3
  import {
4
4
  type CommonLayoutProps,
5
5
  commonLayoutProps,
6
6
  type SupplierPartNumbers,
7
7
  } from "lib/common/layout"
8
+ import { type Point, point } from "lib/common/point"
8
9
  import { expectTypesMatch } from "lib/typecheck"
9
10
  import { z } from "zod"
10
11
  import type { AnySourceComponent, PcbTrace } from "circuit-json"
@@ -218,6 +219,19 @@ export interface SubcircuitGroupProps extends BaseGroupProps {
218
219
  schTraceAutoLabelEnabled?: boolean
219
220
 
220
221
  partsEngine?: PartsEngine
222
+
223
+ /** When autosizing, the board will be made square */
224
+ square?: boolean
225
+ /** Desired empty area of the board e.g. "22mm^2" or "20%" */
226
+ emptyArea?: string
227
+ /** Desired filled area of the board e.g. "22mm^2" or "20%" */
228
+ filledArea?: string
229
+
230
+ width?: number | string
231
+ height?: number | string
232
+ outline?: Point[]
233
+ outlineOffsetX?: number | string
234
+ outlineOffsetY?: number | string
221
235
  }
222
236
 
223
237
  export interface SubcircuitGroupPropsWithBool extends SubcircuitGroupProps {
@@ -264,6 +278,14 @@ export const subcircuitGroupProps = baseGroupProps.extend({
264
278
  partsEngine: partsEngine.optional(),
265
279
  pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),
266
280
  autorouter: autorouterProp.optional(),
281
+ square: z.boolean().optional(),
282
+ emptyArea: z.string().optional(),
283
+ filledArea: z.string().optional(),
284
+ width: distance.optional(),
285
+ height: distance.optional(),
286
+ outline: z.array(point).optional(),
287
+ outlineOffsetX: distance.optional(),
288
+ outlineOffsetY: distance.optional(),
267
289
  })
268
290
 
269
291
  export const subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.262",
3
+ "version": "0.0.263",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",