circuit-json 0.0.267 → 0.0.269
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/README.md +85 -6
- package/dist/index.d.mts +207 -22
- package/dist/index.mjs +92 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2242,36 +2242,54 @@ var pcb_component_outside_board_error = z105.object({
|
|
|
2242
2242
|
);
|
|
2243
2243
|
expectTypesMatch(true);
|
|
2244
2244
|
|
|
2245
|
-
// src/
|
|
2245
|
+
// src/pcb/pcb_via_clearance_error.ts
|
|
2246
2246
|
import { z as z106 } from "zod";
|
|
2247
|
-
var
|
|
2248
|
-
type: z106.literal("
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2247
|
+
var pcb_via_clearance_error = z106.object({
|
|
2248
|
+
type: z106.literal("pcb_via_clearance_error"),
|
|
2249
|
+
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
2250
|
+
error_type: z106.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),
|
|
2251
|
+
message: z106.string(),
|
|
2252
|
+
pcb_via_ids: z106.array(z106.string()).min(2),
|
|
2253
|
+
minimum_clearance: distance.optional(),
|
|
2254
|
+
actual_clearance: distance.optional(),
|
|
2255
|
+
pcb_center: z106.object({
|
|
2256
|
+
x: z106.number().optional(),
|
|
2257
|
+
y: z106.number().optional()
|
|
2258
|
+
}).optional(),
|
|
2259
|
+
subcircuit_id: z106.string().optional()
|
|
2260
|
+
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
2261
|
+
expectTypesMatch(true);
|
|
2262
|
+
|
|
2263
|
+
// src/cad/cad_component.ts
|
|
2264
|
+
import { z as z107 } from "zod";
|
|
2265
|
+
var cad_component = z107.object({
|
|
2266
|
+
type: z107.literal("cad_component"),
|
|
2267
|
+
cad_component_id: z107.string(),
|
|
2268
|
+
pcb_component_id: z107.string(),
|
|
2269
|
+
source_component_id: z107.string(),
|
|
2252
2270
|
position: point3,
|
|
2253
2271
|
rotation: point3.optional(),
|
|
2254
2272
|
size: point3.optional(),
|
|
2255
2273
|
layer: layer_ref.optional(),
|
|
2256
|
-
subcircuit_id:
|
|
2274
|
+
subcircuit_id: z107.string().optional(),
|
|
2257
2275
|
// These are all ways to generate/load the 3d model
|
|
2258
|
-
footprinter_string:
|
|
2259
|
-
model_obj_url:
|
|
2260
|
-
model_stl_url:
|
|
2261
|
-
model_3mf_url:
|
|
2262
|
-
model_gltf_url:
|
|
2263
|
-
model_glb_url:
|
|
2264
|
-
model_step_url:
|
|
2265
|
-
model_wrl_url:
|
|
2266
|
-
model_unit_to_mm_scale_factor:
|
|
2267
|
-
model_jscad:
|
|
2276
|
+
footprinter_string: z107.string().optional(),
|
|
2277
|
+
model_obj_url: z107.string().optional(),
|
|
2278
|
+
model_stl_url: z107.string().optional(),
|
|
2279
|
+
model_3mf_url: z107.string().optional(),
|
|
2280
|
+
model_gltf_url: z107.string().optional(),
|
|
2281
|
+
model_glb_url: z107.string().optional(),
|
|
2282
|
+
model_step_url: z107.string().optional(),
|
|
2283
|
+
model_wrl_url: z107.string().optional(),
|
|
2284
|
+
model_unit_to_mm_scale_factor: z107.number().optional(),
|
|
2285
|
+
model_jscad: z107.any().optional()
|
|
2268
2286
|
}).describe("Defines a component on the PCB");
|
|
2269
2287
|
expectTypesMatch(true);
|
|
2270
2288
|
|
|
2271
2289
|
// src/simulation/simulation_voltage_source.ts
|
|
2272
|
-
import { z as
|
|
2273
|
-
var wave_shape =
|
|
2274
|
-
var percentage =
|
|
2290
|
+
import { z as z108 } from "zod";
|
|
2291
|
+
var wave_shape = z108.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
2292
|
+
var percentage = z108.union([z108.string(), z108.number()]).transform((val) => {
|
|
2275
2293
|
if (typeof val === "string") {
|
|
2276
2294
|
if (val.endsWith("%")) {
|
|
2277
2295
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2280,30 +2298,30 @@ var percentage = z107.union([z107.string(), z107.number()]).transform((val) => {
|
|
|
2280
2298
|
}
|
|
2281
2299
|
return val;
|
|
2282
2300
|
}).pipe(
|
|
2283
|
-
|
|
2301
|
+
z108.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2284
2302
|
);
|
|
2285
|
-
var simulation_dc_voltage_source =
|
|
2286
|
-
type:
|
|
2303
|
+
var simulation_dc_voltage_source = z108.object({
|
|
2304
|
+
type: z108.literal("simulation_voltage_source"),
|
|
2287
2305
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
2288
2306
|
"simulation_voltage_source"
|
|
2289
2307
|
),
|
|
2290
|
-
is_dc_source:
|
|
2291
|
-
positive_source_port_id:
|
|
2292
|
-
negative_source_port_id:
|
|
2293
|
-
positive_source_net_id:
|
|
2294
|
-
negative_source_net_id:
|
|
2308
|
+
is_dc_source: z108.literal(true).optional().default(true),
|
|
2309
|
+
positive_source_port_id: z108.string().optional(),
|
|
2310
|
+
negative_source_port_id: z108.string().optional(),
|
|
2311
|
+
positive_source_net_id: z108.string().optional(),
|
|
2312
|
+
negative_source_net_id: z108.string().optional(),
|
|
2295
2313
|
voltage
|
|
2296
2314
|
}).describe("Defines a DC voltage source for simulation");
|
|
2297
|
-
var simulation_ac_voltage_source =
|
|
2298
|
-
type:
|
|
2315
|
+
var simulation_ac_voltage_source = z108.object({
|
|
2316
|
+
type: z108.literal("simulation_voltage_source"),
|
|
2299
2317
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
2300
2318
|
"simulation_voltage_source"
|
|
2301
2319
|
),
|
|
2302
|
-
is_dc_source:
|
|
2303
|
-
terminal1_source_port_id:
|
|
2304
|
-
terminal2_source_port_id:
|
|
2305
|
-
terminal1_source_net_id:
|
|
2306
|
-
terminal2_source_net_id:
|
|
2320
|
+
is_dc_source: z108.literal(false),
|
|
2321
|
+
terminal1_source_port_id: z108.string().optional(),
|
|
2322
|
+
terminal2_source_port_id: z108.string().optional(),
|
|
2323
|
+
terminal1_source_net_id: z108.string().optional(),
|
|
2324
|
+
terminal2_source_net_id: z108.string().optional(),
|
|
2307
2325
|
voltage: voltage.optional(),
|
|
2308
2326
|
frequency: frequency.optional(),
|
|
2309
2327
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -2311,51 +2329,63 @@ var simulation_ac_voltage_source = z107.object({
|
|
|
2311
2329
|
phase: rotation.optional(),
|
|
2312
2330
|
duty_cycle: percentage.optional()
|
|
2313
2331
|
}).describe("Defines an AC voltage source for simulation");
|
|
2314
|
-
var simulation_voltage_source =
|
|
2332
|
+
var simulation_voltage_source = z108.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
2315
2333
|
expectTypesMatch(true);
|
|
2316
2334
|
expectTypesMatch(true);
|
|
2317
2335
|
expectTypesMatch(true);
|
|
2318
2336
|
|
|
2319
2337
|
// src/simulation/simulation_experiment.ts
|
|
2320
|
-
import { z as
|
|
2321
|
-
var experiment_type =
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2338
|
+
import { z as z109 } from "zod";
|
|
2339
|
+
var experiment_type = z109.union([
|
|
2340
|
+
z109.literal("spice_dc_sweep"),
|
|
2341
|
+
z109.literal("spice_dc_operating_point"),
|
|
2342
|
+
z109.literal("spice_transient_analysis"),
|
|
2343
|
+
z109.literal("spice_ac_analysis")
|
|
2326
2344
|
]);
|
|
2327
|
-
var simulation_experiment =
|
|
2328
|
-
type:
|
|
2345
|
+
var simulation_experiment = z109.object({
|
|
2346
|
+
type: z109.literal("simulation_experiment"),
|
|
2329
2347
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
2330
2348
|
"simulation_experiment"
|
|
2331
2349
|
),
|
|
2332
|
-
name:
|
|
2350
|
+
name: z109.string(),
|
|
2333
2351
|
experiment_type
|
|
2334
2352
|
}).describe("Defines a simulation experiment configuration");
|
|
2335
2353
|
expectTypesMatch(true);
|
|
2336
2354
|
|
|
2337
2355
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
2338
|
-
import { z as
|
|
2339
|
-
var simulation_transient_voltage_graph =
|
|
2340
|
-
type:
|
|
2356
|
+
import { z as z110 } from "zod";
|
|
2357
|
+
var simulation_transient_voltage_graph = z110.object({
|
|
2358
|
+
type: z110.literal("simulation_transient_voltage_graph"),
|
|
2341
2359
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
2342
2360
|
"simulation_transient_voltage_graph"
|
|
2343
2361
|
),
|
|
2344
|
-
simulation_experiment_id:
|
|
2345
|
-
timestamps_ms:
|
|
2346
|
-
voltage_levels:
|
|
2347
|
-
schematic_voltage_probe_id:
|
|
2348
|
-
subcircuit_connecivity_map_key:
|
|
2349
|
-
time_per_step:
|
|
2350
|
-
start_time_ms:
|
|
2351
|
-
end_time_ms:
|
|
2352
|
-
name:
|
|
2362
|
+
simulation_experiment_id: z110.string(),
|
|
2363
|
+
timestamps_ms: z110.array(z110.number()).optional(),
|
|
2364
|
+
voltage_levels: z110.array(z110.number()),
|
|
2365
|
+
schematic_voltage_probe_id: z110.string().optional(),
|
|
2366
|
+
subcircuit_connecivity_map_key: z110.string().optional(),
|
|
2367
|
+
time_per_step: z110.number(),
|
|
2368
|
+
start_time_ms: z110.number(),
|
|
2369
|
+
end_time_ms: z110.number(),
|
|
2370
|
+
name: z110.string().optional()
|
|
2353
2371
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
2354
2372
|
expectTypesMatch(true);
|
|
2355
2373
|
|
|
2374
|
+
// src/simulation/simulation_switch.ts
|
|
2375
|
+
import { z as z111 } from "zod";
|
|
2376
|
+
var simulation_switch = z111.object({
|
|
2377
|
+
type: z111.literal("simulation_switch"),
|
|
2378
|
+
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
2379
|
+
closes_at: time.optional(),
|
|
2380
|
+
opens_at: time.optional(),
|
|
2381
|
+
starts_closed: z111.boolean().optional(),
|
|
2382
|
+
switching_frequency: frequency.optional()
|
|
2383
|
+
}).describe("Defines a switch for simulation timing control");
|
|
2384
|
+
expectTypesMatch(true);
|
|
2385
|
+
|
|
2356
2386
|
// src/any_circuit_element.ts
|
|
2357
|
-
import { z as
|
|
2358
|
-
var any_circuit_element =
|
|
2387
|
+
import { z as z112 } from "zod";
|
|
2388
|
+
var any_circuit_element = z112.union([
|
|
2359
2389
|
source_trace,
|
|
2360
2390
|
source_port,
|
|
2361
2391
|
any_source_component,
|
|
@@ -2412,6 +2442,7 @@ var any_circuit_element = z110.union([
|
|
|
2412
2442
|
pcb_placement_error,
|
|
2413
2443
|
pcb_port_not_matched_error,
|
|
2414
2444
|
pcb_port_not_connected_error,
|
|
2445
|
+
pcb_via_clearance_error,
|
|
2415
2446
|
pcb_fabrication_note_path,
|
|
2416
2447
|
pcb_fabrication_note_text,
|
|
2417
2448
|
pcb_autorouting_error,
|
|
@@ -2523,6 +2554,7 @@ export {
|
|
|
2523
2554
|
pcb_trace_route_point_via,
|
|
2524
2555
|
pcb_trace_route_point_wire,
|
|
2525
2556
|
pcb_via,
|
|
2557
|
+
pcb_via_clearance_error,
|
|
2526
2558
|
point,
|
|
2527
2559
|
point3,
|
|
2528
2560
|
point_with_bulge,
|
|
@@ -2562,6 +2594,7 @@ export {
|
|
|
2562
2594
|
simulation_ac_voltage_source,
|
|
2563
2595
|
simulation_dc_voltage_source,
|
|
2564
2596
|
simulation_experiment,
|
|
2597
|
+
simulation_switch,
|
|
2565
2598
|
simulation_transient_voltage_graph,
|
|
2566
2599
|
simulation_voltage_source,
|
|
2567
2600
|
size,
|