@tscircuit/props 0.0.285 → 0.0.287

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,4 +1,4 @@
1
- import { length } from "circuit-json"
1
+ import { layer_ref, length } from "circuit-json"
2
2
  import { pcbLayoutProps } from "lib/common/layout"
3
3
  import { ninePointAnchor } from "lib/common/ninePointAnchor"
4
4
  import { z } from "zod"
@@ -8,5 +8,6 @@ export const silkscreenTextProps = pcbLayoutProps.extend({
8
8
  anchorAlignment: ninePointAnchor.default("center"),
9
9
  font: z.enum(["tscircuit2024"]).optional(),
10
10
  fontSize: length.optional(),
11
+ layers: z.array(layer_ref).optional(),
11
12
  })
12
13
  export type SilkscreenTextProps = z.input<typeof silkscreenTextProps>
@@ -0,0 +1,28 @@
1
+ import { frequency, rotation, voltage } from "circuit-json"
2
+ import {
3
+ type CommonComponentProps,
4
+ commonComponentProps,
5
+ } from "lib/common/layout"
6
+ import { expectTypesMatch } from "lib/typecheck"
7
+ import { z } from "zod"
8
+
9
+ export type WaveShape = "sinewave" | "square" | "triangle" | "sawtooth"
10
+
11
+ export interface VoltageSourceProps extends CommonComponentProps {
12
+ voltage?: number | string
13
+ frequency?: number | string
14
+ peakToPeakVoltage?: number | string
15
+ waveShape?: WaveShape
16
+ phase?: number | string
17
+ }
18
+
19
+ export const voltageSourceProps = commonComponentProps.extend({
20
+ voltage: voltage.optional(),
21
+ frequency: frequency.optional(),
22
+ peakToPeakVoltage: voltage.optional(),
23
+ waveShape: z.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
24
+ phase: rotation.optional(),
25
+ })
26
+
27
+ type InferredVoltageSourceProps = z.input<typeof voltageSourceProps>
28
+ expectTypesMatch<VoltageSourceProps, InferredVoltageSourceProps>(true)
package/lib/index.ts CHANGED
@@ -57,6 +57,7 @@ export * from "./components/testpoint"
57
57
  export * from "./components/breakoutpoint"
58
58
  export * from "./components/pcb-keepout"
59
59
  export * from "./components/power-source"
60
+ export * from "./components/voltagesource"
60
61
  export * from "./components/schematic-box"
61
62
  export * from "./components/schematic-line"
62
63
  export * from "./components/schematic-text"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.285",
3
+ "version": "0.0.287",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",