circuit-json 0.0.245 → 0.0.247
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.mts +122 -8
- package/dist/index.mjs +124 -104
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1928,67 +1928,84 @@ expectTypesMatch(
|
|
|
1928
1928
|
true
|
|
1929
1929
|
);
|
|
1930
1930
|
|
|
1931
|
-
// src/pcb/
|
|
1931
|
+
// src/pcb/external_footprint_load_error.ts
|
|
1932
1932
|
import { z as z91 } from "zod";
|
|
1933
|
-
var
|
|
1934
|
-
type: z91.literal("
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1933
|
+
var external_footprint_load_error = z91.object({
|
|
1934
|
+
type: z91.literal("external_footprint_load_error"),
|
|
1935
|
+
external_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
1936
|
+
"external_footprint_load_error"
|
|
1937
|
+
),
|
|
1938
|
+
pcb_component_id: z91.string(),
|
|
1939
|
+
source_component_id: z91.string(),
|
|
1940
|
+
pcb_group_id: z91.string().optional(),
|
|
1938
1941
|
subcircuit_id: z91.string().optional(),
|
|
1942
|
+
footprinter_string: z91.string().optional(),
|
|
1943
|
+
error_type: z91.literal("external_footprint_load_error").default("external_footprint_load_error"),
|
|
1944
|
+
message: z91.string()
|
|
1945
|
+
}).describe("Defines an error when an external footprint fails to load");
|
|
1946
|
+
expectTypesMatch(true);
|
|
1947
|
+
|
|
1948
|
+
// src/pcb/pcb_group.ts
|
|
1949
|
+
import { z as z92 } from "zod";
|
|
1950
|
+
var pcb_group = z92.object({
|
|
1951
|
+
type: z92.literal("pcb_group"),
|
|
1952
|
+
pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
|
|
1953
|
+
source_group_id: z92.string(),
|
|
1954
|
+
is_subcircuit: z92.boolean().optional(),
|
|
1955
|
+
subcircuit_id: z92.string().optional(),
|
|
1939
1956
|
width: length,
|
|
1940
1957
|
height: length,
|
|
1941
1958
|
center: point,
|
|
1942
|
-
pcb_component_ids:
|
|
1943
|
-
name:
|
|
1944
|
-
description:
|
|
1945
|
-
layout_mode:
|
|
1946
|
-
autorouter_configuration:
|
|
1959
|
+
pcb_component_ids: z92.array(z92.string()),
|
|
1960
|
+
name: z92.string().optional(),
|
|
1961
|
+
description: z92.string().optional(),
|
|
1962
|
+
layout_mode: z92.string().optional(),
|
|
1963
|
+
autorouter_configuration: z92.object({
|
|
1947
1964
|
trace_clearance: length
|
|
1948
1965
|
}).optional(),
|
|
1949
|
-
autorouter_used_string:
|
|
1966
|
+
autorouter_used_string: z92.string().optional()
|
|
1950
1967
|
}).describe("Defines a group of components on the PCB");
|
|
1951
1968
|
expectTypesMatch(true);
|
|
1952
1969
|
|
|
1953
1970
|
// src/pcb/pcb_autorouting_error.ts
|
|
1954
|
-
import { z as
|
|
1955
|
-
var pcb_autorouting_error =
|
|
1956
|
-
type:
|
|
1971
|
+
import { z as z93 } from "zod";
|
|
1972
|
+
var pcb_autorouting_error = z93.object({
|
|
1973
|
+
type: z93.literal("pcb_autorouting_error"),
|
|
1957
1974
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
|
|
1958
|
-
error_type:
|
|
1959
|
-
message:
|
|
1960
|
-
subcircuit_id:
|
|
1975
|
+
error_type: z93.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
|
|
1976
|
+
message: z93.string(),
|
|
1977
|
+
subcircuit_id: z93.string().optional()
|
|
1961
1978
|
}).describe("The autorouting has failed to route a portion of the board");
|
|
1962
1979
|
expectTypesMatch(true);
|
|
1963
1980
|
|
|
1964
1981
|
// src/pcb/pcb_manual_edit_conflict_warning.ts
|
|
1965
|
-
import { z as
|
|
1966
|
-
var pcb_manual_edit_conflict_warning =
|
|
1967
|
-
type:
|
|
1982
|
+
import { z as z94 } from "zod";
|
|
1983
|
+
var pcb_manual_edit_conflict_warning = z94.object({
|
|
1984
|
+
type: z94.literal("pcb_manual_edit_conflict_warning"),
|
|
1968
1985
|
pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
|
|
1969
1986
|
"pcb_manual_edit_conflict_warning"
|
|
1970
1987
|
),
|
|
1971
|
-
warning_type:
|
|
1972
|
-
message:
|
|
1973
|
-
pcb_component_id:
|
|
1974
|
-
pcb_group_id:
|
|
1975
|
-
subcircuit_id:
|
|
1976
|
-
source_component_id:
|
|
1988
|
+
warning_type: z94.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
|
|
1989
|
+
message: z94.string(),
|
|
1990
|
+
pcb_component_id: z94.string(),
|
|
1991
|
+
pcb_group_id: z94.string().optional(),
|
|
1992
|
+
subcircuit_id: z94.string().optional(),
|
|
1993
|
+
source_component_id: z94.string()
|
|
1977
1994
|
}).describe(
|
|
1978
1995
|
"Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
1979
1996
|
);
|
|
1980
1997
|
expectTypesMatch(true);
|
|
1981
1998
|
|
|
1982
1999
|
// src/pcb/pcb_breakout_point.ts
|
|
1983
|
-
import { z as
|
|
1984
|
-
var pcb_breakout_point =
|
|
1985
|
-
type:
|
|
2000
|
+
import { z as z95 } from "zod";
|
|
2001
|
+
var pcb_breakout_point = z95.object({
|
|
2002
|
+
type: z95.literal("pcb_breakout_point"),
|
|
1986
2003
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
1987
|
-
pcb_group_id:
|
|
1988
|
-
subcircuit_id:
|
|
1989
|
-
source_trace_id:
|
|
1990
|
-
source_port_id:
|
|
1991
|
-
source_net_id:
|
|
2004
|
+
pcb_group_id: z95.string(),
|
|
2005
|
+
subcircuit_id: z95.string().optional(),
|
|
2006
|
+
source_trace_id: z95.string().optional(),
|
|
2007
|
+
source_port_id: z95.string().optional(),
|
|
2008
|
+
source_net_id: z95.string().optional(),
|
|
1992
2009
|
x: distance,
|
|
1993
2010
|
y: distance
|
|
1994
2011
|
}).describe(
|
|
@@ -1997,60 +2014,60 @@ var pcb_breakout_point = z94.object({
|
|
|
1997
2014
|
expectTypesMatch(true);
|
|
1998
2015
|
|
|
1999
2016
|
// src/pcb/pcb_ground_plane.ts
|
|
2000
|
-
import { z as
|
|
2001
|
-
var pcb_ground_plane =
|
|
2002
|
-
type:
|
|
2017
|
+
import { z as z96 } from "zod";
|
|
2018
|
+
var pcb_ground_plane = z96.object({
|
|
2019
|
+
type: z96.literal("pcb_ground_plane"),
|
|
2003
2020
|
pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
|
|
2004
|
-
source_pcb_ground_plane_id:
|
|
2005
|
-
source_net_id:
|
|
2006
|
-
pcb_group_id:
|
|
2007
|
-
subcircuit_id:
|
|
2021
|
+
source_pcb_ground_plane_id: z96.string(),
|
|
2022
|
+
source_net_id: z96.string(),
|
|
2023
|
+
pcb_group_id: z96.string().optional(),
|
|
2024
|
+
subcircuit_id: z96.string().optional()
|
|
2008
2025
|
}).describe("Defines a ground plane on the PCB");
|
|
2009
2026
|
expectTypesMatch(true);
|
|
2010
2027
|
|
|
2011
2028
|
// src/pcb/pcb_ground_plane_region.ts
|
|
2012
|
-
import { z as
|
|
2013
|
-
var pcb_ground_plane_region =
|
|
2014
|
-
type:
|
|
2029
|
+
import { z as z97 } from "zod";
|
|
2030
|
+
var pcb_ground_plane_region = z97.object({
|
|
2031
|
+
type: z97.literal("pcb_ground_plane_region"),
|
|
2015
2032
|
pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
|
|
2016
2033
|
"pcb_ground_plane_region"
|
|
2017
2034
|
),
|
|
2018
|
-
pcb_ground_plane_id:
|
|
2019
|
-
pcb_group_id:
|
|
2020
|
-
subcircuit_id:
|
|
2035
|
+
pcb_ground_plane_id: z97.string(),
|
|
2036
|
+
pcb_group_id: z97.string().optional(),
|
|
2037
|
+
subcircuit_id: z97.string().optional(),
|
|
2021
2038
|
layer: layer_ref,
|
|
2022
|
-
points:
|
|
2039
|
+
points: z97.array(point)
|
|
2023
2040
|
}).describe("Defines a polygon region of a ground plane");
|
|
2024
2041
|
expectTypesMatch(true);
|
|
2025
2042
|
|
|
2026
2043
|
// src/pcb/pcb_thermal_spoke.ts
|
|
2027
|
-
import { z as
|
|
2028
|
-
var pcb_thermal_spoke =
|
|
2029
|
-
type:
|
|
2044
|
+
import { z as z98 } from "zod";
|
|
2045
|
+
var pcb_thermal_spoke = z98.object({
|
|
2046
|
+
type: z98.literal("pcb_thermal_spoke"),
|
|
2030
2047
|
pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
|
|
2031
|
-
pcb_ground_plane_id:
|
|
2032
|
-
shape:
|
|
2033
|
-
spoke_count:
|
|
2048
|
+
pcb_ground_plane_id: z98.string(),
|
|
2049
|
+
shape: z98.string(),
|
|
2050
|
+
spoke_count: z98.number(),
|
|
2034
2051
|
spoke_thickness: distance,
|
|
2035
2052
|
spoke_inner_diameter: distance,
|
|
2036
2053
|
spoke_outer_diameter: distance,
|
|
2037
|
-
pcb_plated_hole_id:
|
|
2038
|
-
subcircuit_id:
|
|
2054
|
+
pcb_plated_hole_id: z98.string().optional(),
|
|
2055
|
+
subcircuit_id: z98.string().optional()
|
|
2039
2056
|
}).describe("Pattern for connecting a ground plane to a plated hole");
|
|
2040
2057
|
expectTypesMatch(true);
|
|
2041
2058
|
|
|
2042
2059
|
// src/pcb/pcb_copper_pour.ts
|
|
2043
|
-
import { z as
|
|
2044
|
-
var pcb_copper_pour_base =
|
|
2045
|
-
type:
|
|
2060
|
+
import { z as z99 } from "zod";
|
|
2061
|
+
var pcb_copper_pour_base = z99.object({
|
|
2062
|
+
type: z99.literal("pcb_copper_pour"),
|
|
2046
2063
|
pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
|
|
2047
|
-
pcb_group_id:
|
|
2048
|
-
subcircuit_id:
|
|
2064
|
+
pcb_group_id: z99.string().optional(),
|
|
2065
|
+
subcircuit_id: z99.string().optional(),
|
|
2049
2066
|
layer: layer_ref,
|
|
2050
|
-
source_net_id:
|
|
2067
|
+
source_net_id: z99.string().optional()
|
|
2051
2068
|
});
|
|
2052
2069
|
var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
2053
|
-
shape:
|
|
2070
|
+
shape: z99.literal("rect"),
|
|
2054
2071
|
center: point,
|
|
2055
2072
|
width: length,
|
|
2056
2073
|
height: length,
|
|
@@ -2058,16 +2075,16 @@ var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
|
2058
2075
|
});
|
|
2059
2076
|
expectTypesMatch(true);
|
|
2060
2077
|
var pcb_copper_pour_brep = pcb_copper_pour_base.extend({
|
|
2061
|
-
shape:
|
|
2078
|
+
shape: z99.literal("brep"),
|
|
2062
2079
|
brep_shape
|
|
2063
2080
|
});
|
|
2064
2081
|
expectTypesMatch(true);
|
|
2065
2082
|
var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
|
|
2066
|
-
shape:
|
|
2067
|
-
points:
|
|
2083
|
+
shape: z99.literal("polygon"),
|
|
2084
|
+
points: z99.array(point)
|
|
2068
2085
|
});
|
|
2069
2086
|
expectTypesMatch(true);
|
|
2070
|
-
var pcb_copper_pour =
|
|
2087
|
+
var pcb_copper_pour = z99.discriminatedUnion("shape", [
|
|
2071
2088
|
pcb_copper_pour_rect,
|
|
2072
2089
|
pcb_copper_pour_brep,
|
|
2073
2090
|
pcb_copper_pour_polygon
|
|
@@ -2075,33 +2092,34 @@ var pcb_copper_pour = z98.discriminatedUnion("shape", [
|
|
|
2075
2092
|
expectTypesMatch(true);
|
|
2076
2093
|
|
|
2077
2094
|
// src/cad/cad_component.ts
|
|
2078
|
-
import { z as
|
|
2079
|
-
var cad_component =
|
|
2080
|
-
type:
|
|
2081
|
-
cad_component_id:
|
|
2082
|
-
pcb_component_id:
|
|
2083
|
-
source_component_id:
|
|
2095
|
+
import { z as z100 } from "zod";
|
|
2096
|
+
var cad_component = z100.object({
|
|
2097
|
+
type: z100.literal("cad_component"),
|
|
2098
|
+
cad_component_id: z100.string(),
|
|
2099
|
+
pcb_component_id: z100.string(),
|
|
2100
|
+
source_component_id: z100.string(),
|
|
2084
2101
|
position: point3,
|
|
2085
2102
|
rotation: point3.optional(),
|
|
2086
2103
|
size: point3.optional(),
|
|
2087
2104
|
layer: layer_ref.optional(),
|
|
2088
|
-
subcircuit_id:
|
|
2105
|
+
subcircuit_id: z100.string().optional(),
|
|
2089
2106
|
// These are all ways to generate/load the 3d model
|
|
2090
|
-
footprinter_string:
|
|
2091
|
-
model_obj_url:
|
|
2092
|
-
model_stl_url:
|
|
2093
|
-
model_3mf_url:
|
|
2094
|
-
model_gltf_url:
|
|
2095
|
-
model_glb_url:
|
|
2096
|
-
model_step_url:
|
|
2097
|
-
|
|
2107
|
+
footprinter_string: z100.string().optional(),
|
|
2108
|
+
model_obj_url: z100.string().optional(),
|
|
2109
|
+
model_stl_url: z100.string().optional(),
|
|
2110
|
+
model_3mf_url: z100.string().optional(),
|
|
2111
|
+
model_gltf_url: z100.string().optional(),
|
|
2112
|
+
model_glb_url: z100.string().optional(),
|
|
2113
|
+
model_step_url: z100.string().optional(),
|
|
2114
|
+
model_wrl_url: z100.string().optional(),
|
|
2115
|
+
model_jscad: z100.any().optional()
|
|
2098
2116
|
}).describe("Defines a component on the PCB");
|
|
2099
2117
|
expectTypesMatch(true);
|
|
2100
2118
|
|
|
2101
2119
|
// src/simulation/simulation_voltage_source.ts
|
|
2102
|
-
import { z as
|
|
2103
|
-
var wave_shape =
|
|
2104
|
-
var percentage =
|
|
2120
|
+
import { z as z101 } from "zod";
|
|
2121
|
+
var wave_shape = z101.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
2122
|
+
var percentage = z101.union([z101.string(), z101.number()]).transform((val) => {
|
|
2105
2123
|
if (typeof val === "string") {
|
|
2106
2124
|
if (val.endsWith("%")) {
|
|
2107
2125
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2110,30 +2128,30 @@ var percentage = z100.union([z100.string(), z100.number()]).transform((val) => {
|
|
|
2110
2128
|
}
|
|
2111
2129
|
return val;
|
|
2112
2130
|
}).pipe(
|
|
2113
|
-
|
|
2131
|
+
z101.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2114
2132
|
);
|
|
2115
|
-
var simulation_dc_voltage_source =
|
|
2116
|
-
type:
|
|
2133
|
+
var simulation_dc_voltage_source = z101.object({
|
|
2134
|
+
type: z101.literal("simulation_voltage_source"),
|
|
2117
2135
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
2118
2136
|
"simulation_voltage_source"
|
|
2119
2137
|
),
|
|
2120
|
-
is_dc_source:
|
|
2121
|
-
positive_source_port_id:
|
|
2122
|
-
negative_source_port_id:
|
|
2123
|
-
positive_source_net_id:
|
|
2124
|
-
negative_source_net_id:
|
|
2138
|
+
is_dc_source: z101.literal(true).optional().default(true),
|
|
2139
|
+
positive_source_port_id: z101.string().optional(),
|
|
2140
|
+
negative_source_port_id: z101.string().optional(),
|
|
2141
|
+
positive_source_net_id: z101.string().optional(),
|
|
2142
|
+
negative_source_net_id: z101.string().optional(),
|
|
2125
2143
|
voltage
|
|
2126
2144
|
}).describe("Defines a DC voltage source for simulation");
|
|
2127
|
-
var simulation_ac_voltage_source =
|
|
2128
|
-
type:
|
|
2145
|
+
var simulation_ac_voltage_source = z101.object({
|
|
2146
|
+
type: z101.literal("simulation_voltage_source"),
|
|
2129
2147
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
2130
2148
|
"simulation_voltage_source"
|
|
2131
2149
|
),
|
|
2132
|
-
is_dc_source:
|
|
2133
|
-
terminal1_source_port_id:
|
|
2134
|
-
terminal2_source_port_id:
|
|
2135
|
-
terminal1_source_net_id:
|
|
2136
|
-
terminal2_source_net_id:
|
|
2150
|
+
is_dc_source: z101.literal(false),
|
|
2151
|
+
terminal1_source_port_id: z101.string().optional(),
|
|
2152
|
+
terminal2_source_port_id: z101.string().optional(),
|
|
2153
|
+
terminal1_source_net_id: z101.string().optional(),
|
|
2154
|
+
terminal2_source_net_id: z101.string().optional(),
|
|
2137
2155
|
voltage: voltage.optional(),
|
|
2138
2156
|
frequency: frequency.optional(),
|
|
2139
2157
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -2141,14 +2159,14 @@ var simulation_ac_voltage_source = z100.object({
|
|
|
2141
2159
|
phase: rotation.optional(),
|
|
2142
2160
|
duty_cycle: percentage.optional()
|
|
2143
2161
|
}).describe("Defines an AC voltage source for simulation");
|
|
2144
|
-
var simulation_voltage_source =
|
|
2162
|
+
var simulation_voltage_source = z101.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
2145
2163
|
expectTypesMatch(true);
|
|
2146
2164
|
expectTypesMatch(true);
|
|
2147
2165
|
expectTypesMatch(true);
|
|
2148
2166
|
|
|
2149
2167
|
// src/any_circuit_element.ts
|
|
2150
|
-
import { z as
|
|
2151
|
-
var any_circuit_element =
|
|
2168
|
+
import { z as z102 } from "zod";
|
|
2169
|
+
var any_circuit_element = z102.union([
|
|
2152
2170
|
source_trace,
|
|
2153
2171
|
source_port,
|
|
2154
2172
|
any_source_component,
|
|
@@ -2179,6 +2197,7 @@ var any_circuit_element = z101.union([
|
|
|
2179
2197
|
pcb_component,
|
|
2180
2198
|
pcb_hole,
|
|
2181
2199
|
pcb_missing_footprint_error,
|
|
2200
|
+
external_footprint_load_error,
|
|
2182
2201
|
pcb_manual_edit_conflict_warning,
|
|
2183
2202
|
pcb_plated_hole,
|
|
2184
2203
|
pcb_keepout,
|
|
@@ -2245,6 +2264,7 @@ export {
|
|
|
2245
2264
|
capacitance,
|
|
2246
2265
|
current,
|
|
2247
2266
|
distance,
|
|
2267
|
+
external_footprint_load_error,
|
|
2248
2268
|
frequency,
|
|
2249
2269
|
getZodPrefixedIdWithDefault,
|
|
2250
2270
|
inductance,
|