@tscircuit/internal-dynamic-import 0.0.0

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.
@@ -0,0 +1,3007 @@
1
+ import { AnyCircuitElement, SourceComponentBase, PcbComponent, CircuitJson, SchematicNetLabel, PCBTrace, PCBPort, LayerRef as LayerRef$1, NinePointAnchor, PcbRenderLayer, PcbBoard, PcbCopperPour, PcbCopperText, PcbCourtyardCircle, PcbCutout, PcbFabricationNoteDimension, PcbFabricationNotePath, PcbFabricationNoteRect, PcbFabricationNoteText, PcbHole, PCBKeepout, PcbNoteDimension, PcbNotePath, PcbNoteRect, PcbNoteText, PcbPanel, PcbPlatedHole, PcbSilkscreenCircle, PcbSilkscreenLine, PcbSilkscreenOval, PcbSilkscreenPath, PcbSilkscreenPill, PcbSilkscreenRect, PcbSilkscreenText, PcbSmtPad, PcbTrace, PcbVia, PCBVia, SimulationExperiment, SimulationTransientVoltageGraph, SimulationVoltageProbe, PcbPort, SchematicComponent } from 'circuit-json';
2
+ import { BpcGraph } from 'bpc-graph';
3
+ import { z, AnyZodObject } from 'zod';
4
+ import { CircuitJsonUtilObjects, cju } from '@tscircuit/circuit-json-util';
5
+ import { KicadSch, KicadPcb, SchematicSymbol } from 'kicadts';
6
+ import { Matrix } from 'transformation-matrix';
7
+ import { LightBurnProject } from 'lbrnts';
8
+ import { Box } from '@tscircuit/simple-3d-svg';
9
+ import { INode } from 'svgson';
10
+
11
+ type SupplierPartNumberColumn = "JLCPCB Part #";
12
+ interface BomRow {
13
+ designator: string;
14
+ comment: string;
15
+ value: string;
16
+ footprint: string;
17
+ supplier_part_number_columns?: Partial<Record<SupplierPartNumberColumn, string>>;
18
+ manufacturer_mpn_pairs?: Array<{
19
+ manufacturer: string;
20
+ mpn: string;
21
+ }>;
22
+ extra_columns?: Record<string, string>;
23
+ }
24
+ interface ResolvedPart {
25
+ part_number?: string;
26
+ footprint?: string;
27
+ comment?: string;
28
+ supplier_part_number_columns?: Record<SupplierPartNumberColumn, string>;
29
+ manufacturer_mpn_pairs?: Array<{
30
+ manufacturer: string;
31
+ mpn: string;
32
+ }>;
33
+ extra_columns?: Record<string, string>;
34
+ }
35
+ declare const convertCircuitJsonToBomRows: ({ circuitJson, resolvePart, }: {
36
+ circuitJson: AnyCircuitElement[];
37
+ resolvePart?: (part_info: {
38
+ source_component: SourceComponentBase;
39
+ pcb_component: PcbComponent;
40
+ }) => Promise<ResolvedPart | null>;
41
+ }) => Promise<BomRow[]>;
42
+ declare const convertBomRowsToCsv: (bom_rows: BomRow[]) => string;
43
+
44
+ declare const CircuitJsonToBomCsvModule_convertBomRowsToCsv: typeof convertBomRowsToCsv;
45
+ declare const CircuitJsonToBomCsvModule_convertCircuitJsonToBomRows: typeof convertCircuitJsonToBomRows;
46
+ declare namespace CircuitJsonToBomCsvModule {
47
+ export { CircuitJsonToBomCsvModule_convertBomRowsToCsv as convertBomRowsToCsv, CircuitJsonToBomCsvModule_convertCircuitJsonToBomRows as convertCircuitJsonToBomRows };
48
+ }
49
+
50
+ declare const convertCircuitJsonToBpc: (circuitJson: CircuitJson, opts?: {
51
+ inferNetLabels?: boolean;
52
+ useReadableIds?: boolean;
53
+ }) => BpcGraph;
54
+
55
+ /**
56
+ * Generate implicit net labels for schematic ports that belong to a net but
57
+ * are not connected via a trace. Existing labels are not duplicated.
58
+ */
59
+ declare const generateImplicitNetLabels: (circuitJson: CircuitJson) => SchematicNetLabel[];
60
+
61
+ declare const CircuitJsonToBpcModule_convertCircuitJsonToBpc: typeof convertCircuitJsonToBpc;
62
+ declare const CircuitJsonToBpcModule_generateImplicitNetLabels: typeof generateImplicitNetLabels;
63
+ declare namespace CircuitJsonToBpcModule {
64
+ export { CircuitJsonToBpcModule_convertCircuitJsonToBpc as convertCircuitJsonToBpc, CircuitJsonToBpcModule_generateImplicitNetLabels as generateImplicitNetLabels };
65
+ }
66
+
67
+ type NodeId = string;
68
+ declare function findConnectedNetworks(connections: Array<NodeId[]>): Record<string, string[]>;
69
+
70
+ declare class ConnectivityMap {
71
+ netMap: Record<string, string[]>;
72
+ idToNetMap: Record<string, string>;
73
+ constructor(netMap: Record<string, string[]>);
74
+ addConnections(connections: string[][]): void;
75
+ getIdsConnectedToNet(netId: string): string[];
76
+ getNetConnectedToId(id: string): string | undefined;
77
+ areIdsConnected(id1: string, id2: string): boolean;
78
+ areAllIdsConnected(ids: string[]): boolean;
79
+ }
80
+
81
+ declare const getSourcePortConnectivityMapFromCircuitJson: (circuitJson: AnyCircuitElement[]) => ConnectivityMap;
82
+
83
+ declare const getFullConnectivityMapFromCircuitJson: (circuitJson: AnyCircuitElement[]) => ConnectivityMap;
84
+
85
+ /**
86
+ * A PCB Connectivity Map is a connectivity map that has analyzed what traces and ports are actually connected on the
87
+ * PCB.
88
+ *
89
+ * This is useful for determining how to route a trace on the PCB. For example, you may want to determine where the
90
+ * nearest connected net point is to connect an unrouted pin.
91
+ */
92
+ declare class PcbConnectivityMap {
93
+ circuitJson: AnyCircuitElement[];
94
+ traceIdToElm: Map<string, PCBTrace>;
95
+ portIdToElm: Map<string, PCBPort>;
96
+ connMap: ConnectivityMap;
97
+ constructor(circuitJson?: AnyCircuitElement[]);
98
+ private _buildPortMap;
99
+ private _buildTraceMap;
100
+ private _buildTraceConnectivityMap;
101
+ addTrace(trace: PCBTrace): void;
102
+ _arePcbTracesConnected(trace1: PCBTrace, trace2: PCBTrace): boolean;
103
+ areTracesConnected(traceId1: string, traceId2: string): boolean;
104
+ getAllTracesConnectedToTrace(traceId: string): PCBTrace[];
105
+ getAllTracesConnectedToPort(portId: string): PCBTrace[];
106
+ }
107
+
108
+ type CircuitJsonToConnectivityMapModule_ConnectivityMap = ConnectivityMap;
109
+ declare const CircuitJsonToConnectivityMapModule_ConnectivityMap: typeof ConnectivityMap;
110
+ type CircuitJsonToConnectivityMapModule_PcbConnectivityMap = PcbConnectivityMap;
111
+ declare const CircuitJsonToConnectivityMapModule_PcbConnectivityMap: typeof PcbConnectivityMap;
112
+ declare const CircuitJsonToConnectivityMapModule_findConnectedNetworks: typeof findConnectedNetworks;
113
+ declare const CircuitJsonToConnectivityMapModule_getFullConnectivityMapFromCircuitJson: typeof getFullConnectivityMapFromCircuitJson;
114
+ declare const CircuitJsonToConnectivityMapModule_getSourcePortConnectivityMapFromCircuitJson: typeof getSourcePortConnectivityMapFromCircuitJson;
115
+ declare namespace CircuitJsonToConnectivityMapModule {
116
+ export { CircuitJsonToConnectivityMapModule_ConnectivityMap as ConnectivityMap, CircuitJsonToConnectivityMapModule_PcbConnectivityMap as PcbConnectivityMap, CircuitJsonToConnectivityMapModule_findConnectedNetworks as findConnectedNetworks, CircuitJsonToConnectivityMapModule_getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson, CircuitJsonToConnectivityMapModule_getSourcePortConnectivityMapFromCircuitJson as getSourcePortConnectivityMapFromCircuitJson };
117
+ }
118
+
119
+ interface ExcellonDrillCommandDef<K extends string, T extends AnyZodObject | z.ZodIntersection<any, any>> {
120
+ command_code: K;
121
+ schema: T;
122
+ stringify: (c: z.infer<T>) => string;
123
+ }
124
+
125
+ declare const excellon_drill_command_map: {
126
+ G00: ExcellonDrillCommandDef<"G00", z.ZodObject<{
127
+ command_code: z.ZodDefault<z.ZodLiteral<"G00">>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ command_code: "G00";
130
+ }, {
131
+ command_code?: "G00" | undefined;
132
+ }>>;
133
+ G01: ExcellonDrillCommandDef<"G01", z.ZodObject<{
134
+ command_code: z.ZodDefault<z.ZodLiteral<"G01">>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ command_code: "G01";
137
+ }, {
138
+ command_code?: "G01" | undefined;
139
+ }>>;
140
+ G85: ExcellonDrillCommandDef<"G85", z.ZodObject<{
141
+ command_code: z.ZodDefault<z.ZodLiteral<"G85">>;
142
+ x: z.ZodNumber;
143
+ y: z.ZodNumber;
144
+ width: z.ZodNumber;
145
+ }, "strip", z.ZodTypeAny, {
146
+ command_code: "G85";
147
+ x: number;
148
+ y: number;
149
+ width: number;
150
+ }, {
151
+ x: number;
152
+ y: number;
153
+ width: number;
154
+ command_code?: "G85" | undefined;
155
+ }>>;
156
+ M48: ExcellonDrillCommandDef<"M48", z.ZodObject<{
157
+ command_code: z.ZodDefault<z.ZodLiteral<"M48">>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ command_code: "M48";
160
+ }, {
161
+ command_code?: "M48" | undefined;
162
+ }>>;
163
+ M95: ExcellonDrillCommandDef<"M95", z.ZodObject<{
164
+ command_code: z.ZodDefault<z.ZodLiteral<"M95">>;
165
+ }, "strip", z.ZodTypeAny, {
166
+ command_code: "M95";
167
+ }, {
168
+ command_code?: "M95" | undefined;
169
+ }>>;
170
+ FMAT: ExcellonDrillCommandDef<"FMAT", z.ZodObject<{
171
+ command_code: z.ZodDefault<z.ZodLiteral<"FMAT">>;
172
+ format: z.ZodNumber;
173
+ }, "strip", z.ZodTypeAny, {
174
+ command_code: "FMAT";
175
+ format: number;
176
+ }, {
177
+ format: number;
178
+ command_code?: "FMAT" | undefined;
179
+ }>>;
180
+ unit_format: ExcellonDrillCommandDef<"unit_format", z.ZodObject<{
181
+ command_code: z.ZodDefault<z.ZodLiteral<"unit_format">>;
182
+ unit: z.ZodUnion<[z.ZodLiteral<"INCH">, z.ZodLiteral<"METRIC">]>;
183
+ lz: z.ZodDefault<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"LZ">, z.ZodLiteral<"TZ">]>>>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ command_code: "unit_format";
186
+ unit: "INCH" | "METRIC";
187
+ lz: "LZ" | "TZ" | null;
188
+ }, {
189
+ unit: "INCH" | "METRIC";
190
+ command_code?: "unit_format" | undefined;
191
+ lz?: "LZ" | "TZ" | null | undefined;
192
+ }>>;
193
+ aper_function_header: ExcellonDrillCommandDef<"aper_function_header", z.ZodObject<{
194
+ command_code: z.ZodDefault<z.ZodLiteral<"aper_function_header">>;
195
+ is_plated: z.ZodBoolean;
196
+ }, "strip", z.ZodTypeAny, {
197
+ is_plated: boolean;
198
+ command_code: "aper_function_header";
199
+ }, {
200
+ is_plated: boolean;
201
+ command_code?: "aper_function_header" | undefined;
202
+ }>>;
203
+ percent_sign: ExcellonDrillCommandDef<"percent_sign", z.ZodObject<{
204
+ command_code: z.ZodDefault<z.ZodLiteral<"percent_sign">>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ command_code: "percent_sign";
207
+ }, {
208
+ command_code?: "percent_sign" | undefined;
209
+ }>>;
210
+ T: ExcellonDrillCommandDef<"define_tool", z.ZodObject<{
211
+ command_code: z.ZodDefault<z.ZodLiteral<"define_tool">>;
212
+ tool_number: z.ZodNumber;
213
+ diameter: z.ZodNumber;
214
+ }, "strip", z.ZodTypeAny, {
215
+ command_code: "define_tool";
216
+ tool_number: number;
217
+ diameter: number;
218
+ }, {
219
+ tool_number: number;
220
+ diameter: number;
221
+ command_code?: "define_tool" | undefined;
222
+ }>>;
223
+ define_tool: ExcellonDrillCommandDef<"define_tool", z.ZodObject<{
224
+ command_code: z.ZodDefault<z.ZodLiteral<"define_tool">>;
225
+ tool_number: z.ZodNumber;
226
+ diameter: z.ZodNumber;
227
+ }, "strip", z.ZodTypeAny, {
228
+ command_code: "define_tool";
229
+ tool_number: number;
230
+ diameter: number;
231
+ }, {
232
+ tool_number: number;
233
+ diameter: number;
234
+ command_code?: "define_tool" | undefined;
235
+ }>>;
236
+ use_tool: ExcellonDrillCommandDef<"use_tool", z.ZodObject<{
237
+ command_code: z.ZodDefault<z.ZodLiteral<"use_tool">>;
238
+ tool_number: z.ZodNumber;
239
+ }, "strip", z.ZodTypeAny, {
240
+ command_code: "use_tool";
241
+ tool_number: number;
242
+ }, {
243
+ tool_number: number;
244
+ command_code?: "use_tool" | undefined;
245
+ }>>;
246
+ G90: ExcellonDrillCommandDef<"G90", z.ZodObject<{
247
+ command_code: z.ZodDefault<z.ZodLiteral<"G90">>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ command_code: "G90";
250
+ }, {
251
+ command_code?: "G90" | undefined;
252
+ }>>;
253
+ G05: ExcellonDrillCommandDef<"G05", z.ZodObject<{
254
+ command_code: z.ZodDefault<z.ZodLiteral<"G05">>;
255
+ }, "strip", z.ZodTypeAny, {
256
+ command_code: "G05";
257
+ }, {
258
+ command_code?: "G05" | undefined;
259
+ }>>;
260
+ M15: ExcellonDrillCommandDef<"M15", z.ZodObject<{
261
+ command_code: z.ZodDefault<z.ZodLiteral<"M15">>;
262
+ }, "strip", z.ZodTypeAny, {
263
+ command_code: "M15";
264
+ }, {
265
+ command_code?: "M15" | undefined;
266
+ }>>;
267
+ M16: ExcellonDrillCommandDef<"M16", z.ZodObject<{
268
+ command_code: z.ZodDefault<z.ZodLiteral<"M16">>;
269
+ }, "strip", z.ZodTypeAny, {
270
+ command_code: "M16";
271
+ }, {
272
+ command_code?: "M16" | undefined;
273
+ }>>;
274
+ M30: ExcellonDrillCommandDef<"M30", z.ZodObject<{
275
+ command_code: z.ZodDefault<z.ZodLiteral<"M30">>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ command_code: "M30";
278
+ }, {
279
+ command_code?: "M30" | undefined;
280
+ }>>;
281
+ drill_at: ExcellonDrillCommandDef<"drill_at", z.ZodObject<{
282
+ command_code: z.ZodDefault<z.ZodLiteral<"drill_at">>;
283
+ x: z.ZodNumber;
284
+ y: z.ZodNumber;
285
+ }, "strip", z.ZodTypeAny, {
286
+ command_code: "drill_at";
287
+ x: number;
288
+ y: number;
289
+ }, {
290
+ x: number;
291
+ y: number;
292
+ command_code?: "drill_at" | undefined;
293
+ }>>;
294
+ header_comment: ExcellonDrillCommandDef<"header_comment", z.ZodObject<{
295
+ command_code: z.ZodDefault<z.ZodLiteral<"header_comment">>;
296
+ text: z.ZodString;
297
+ }, "strip", z.ZodTypeAny, {
298
+ command_code: "header_comment";
299
+ text: string;
300
+ }, {
301
+ text: string;
302
+ command_code?: "header_comment" | undefined;
303
+ }>>;
304
+ header_attribute: ExcellonDrillCommandDef<"header_attribute", z.ZodObject<{
305
+ command_code: z.ZodDefault<z.ZodLiteral<"header_attribute">>;
306
+ attribute_name: z.ZodString;
307
+ attribute_value: z.ZodString;
308
+ }, "strip", z.ZodTypeAny, {
309
+ command_code: "header_attribute";
310
+ attribute_name: string;
311
+ attribute_value: string;
312
+ }, {
313
+ attribute_name: string;
314
+ attribute_value: string;
315
+ command_code?: "header_attribute" | undefined;
316
+ }>>;
317
+ rewind: ExcellonDrillCommandDef<"rewind", z.ZodObject<{
318
+ command_code: z.ZodDefault<z.ZodLiteral<"rewind">>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ command_code: "rewind";
321
+ }, {
322
+ command_code?: "rewind" | undefined;
323
+ }>>;
324
+ };
325
+ type AnyExcellonDrillCommand = z.infer<(typeof excellon_drill_command_map)[keyof typeof excellon_drill_command_map]["schema"]>;
326
+
327
+ declare const stringifyExcellonDrill: (commands: Array<AnyExcellonDrillCommand>) => string;
328
+
329
+ declare const convertSoupToExcellonDrillCommands: ({ circuitJson, is_plated, flip_y_axis, }: {
330
+ circuitJson: Array<AnyCircuitElement>;
331
+ is_plated: boolean;
332
+ flip_y_axis?: boolean;
333
+ }) => Array<AnyExcellonDrillCommand>;
334
+
335
+ declare class ExcellonDrillBuilder {
336
+ commands: Array<AnyExcellonDrillCommand>;
337
+ constructor();
338
+ add<T extends keyof typeof excellon_drill_command_map>(cmd: T, props: z.input<(typeof excellon_drill_command_map)[T]["schema"]>): ExcellonDrillBuilder;
339
+ build(): Array<AnyExcellonDrillCommand>;
340
+ }
341
+ declare const excellonDrill: () => ExcellonDrillBuilder;
342
+
343
+ interface GerberCommandDef<K extends string, T extends AnyZodObject | z.ZodIntersection<any, any>> {
344
+ command_code: K;
345
+ schema: T;
346
+ stringify: (c: z.infer<T>) => string;
347
+ }
348
+
349
+ declare const gerber_command_map: {
350
+ readonly add_attribute_on_aperture: GerberCommandDef<"TA", z.ZodObject<{
351
+ command_code: z.ZodDefault<z.ZodLiteral<"TA">>;
352
+ attribute_name: z.ZodString;
353
+ attribute_value: z.ZodString;
354
+ }, "strip", z.ZodTypeAny, {
355
+ command_code: "TA";
356
+ attribute_name: string;
357
+ attribute_value: string;
358
+ }, {
359
+ attribute_name: string;
360
+ attribute_value: string;
361
+ command_code?: "TA" | undefined;
362
+ }>>;
363
+ readonly add_attribute_on_file: GerberCommandDef<"TF", z.ZodObject<{
364
+ command_code: z.ZodDefault<z.ZodLiteral<"TF">>;
365
+ attribute_name: z.ZodString;
366
+ attribute_value: z.ZodString;
367
+ }, "strip", z.ZodTypeAny, {
368
+ command_code: "TF";
369
+ attribute_name: string;
370
+ attribute_value: string;
371
+ }, {
372
+ attribute_name: string;
373
+ attribute_value: string;
374
+ command_code?: "TF" | undefined;
375
+ }>>;
376
+ readonly add_attribute_on_object: GerberCommandDef<"TO", z.ZodObject<{
377
+ command_code: z.ZodDefault<z.ZodLiteral<"TO">>;
378
+ attribute_name: z.ZodString;
379
+ attribute_value: z.ZodString;
380
+ }, "strip", z.ZodTypeAny, {
381
+ command_code: "TO";
382
+ attribute_name: string;
383
+ attribute_value: string;
384
+ }, {
385
+ attribute_name: string;
386
+ attribute_value: string;
387
+ command_code?: "TO" | undefined;
388
+ }>>;
389
+ readonly aperture_block: GerberCommandDef<"AB", z.ZodObject<{
390
+ command_code: z.ZodDefault<z.ZodLiteral<"AB">>;
391
+ block: z.ZodString;
392
+ }, "strip", z.ZodTypeAny, {
393
+ command_code: "AB";
394
+ block: string;
395
+ }, {
396
+ block: string;
397
+ command_code?: "AB" | undefined;
398
+ }>>;
399
+ readonly comment: GerberCommandDef<"G04", z.ZodObject<{
400
+ command_code: z.ZodDefault<z.ZodLiteral<"G04">>;
401
+ comment: z.ZodString;
402
+ }, "strip", z.ZodTypeAny, {
403
+ command_code: "G04";
404
+ comment: string;
405
+ }, {
406
+ comment: string;
407
+ command_code?: "G04" | undefined;
408
+ }>>;
409
+ readonly create_arc: GerberCommandDef<"G75", z.ZodObject<{
410
+ command_code: z.ZodDefault<z.ZodLiteral<"G75">>;
411
+ }, "strip", z.ZodTypeAny, {
412
+ command_code: "G75";
413
+ }, {
414
+ command_code?: "G75" | undefined;
415
+ }>>;
416
+ readonly define_aperture: GerberCommandDef<"AD", z.ZodObject<{
417
+ command_code: z.ZodDefault<z.ZodLiteral<"AD">>;
418
+ aperture_code: z.ZodString;
419
+ }, "strip", z.ZodTypeAny, {
420
+ command_code: "AD";
421
+ aperture_code: string;
422
+ }, {
423
+ aperture_code: string;
424
+ command_code?: "AD" | undefined;
425
+ }>>;
426
+ readonly define_macro_aperture_template: GerberCommandDef<"AM", z.ZodObject<{
427
+ command_code: z.ZodDefault<z.ZodLiteral<"AM">>;
428
+ macro_name: z.ZodString;
429
+ template_code: z.ZodString;
430
+ }, "strip", z.ZodTypeAny, {
431
+ command_code: "AM";
432
+ macro_name: string;
433
+ template_code: string;
434
+ }, {
435
+ macro_name: string;
436
+ template_code: string;
437
+ command_code?: "AM" | undefined;
438
+ }>>;
439
+ readonly delete_attribute: GerberCommandDef<"TD", z.ZodObject<{
440
+ command_code: z.ZodDefault<z.ZodLiteral<"TD">>;
441
+ attribute: z.ZodOptional<z.ZodString>;
442
+ }, "strip", z.ZodTypeAny, {
443
+ command_code: "TD";
444
+ attribute?: string | undefined;
445
+ }, {
446
+ command_code?: "TD" | undefined;
447
+ attribute?: string | undefined;
448
+ }>>;
449
+ readonly end_of_file: GerberCommandDef<"M02", z.ZodObject<{
450
+ command_code: z.ZodDefault<z.ZodLiteral<"M02">>;
451
+ }, "strip", z.ZodTypeAny, {
452
+ command_code: "M02";
453
+ }, {
454
+ command_code?: "M02" | undefined;
455
+ }>>;
456
+ readonly move_operation: GerberCommandDef<"D02", z.ZodObject<{
457
+ command_code: z.ZodDefault<z.ZodLiteral<"D02">>;
458
+ x: z.ZodNumber;
459
+ y: z.ZodNumber;
460
+ }, "strip", z.ZodTypeAny, {
461
+ command_code: "D02";
462
+ x: number;
463
+ y: number;
464
+ }, {
465
+ x: number;
466
+ y: number;
467
+ command_code?: "D02" | undefined;
468
+ }>>;
469
+ readonly flash_operation: GerberCommandDef<"D03", z.ZodObject<{
470
+ command_code: z.ZodDefault<z.ZodLiteral<"D03">>;
471
+ x: z.ZodNumber;
472
+ y: z.ZodNumber;
473
+ }, "strip", z.ZodTypeAny, {
474
+ command_code: "D03";
475
+ x: number;
476
+ y: number;
477
+ }, {
478
+ x: number;
479
+ y: number;
480
+ command_code?: "D03" | undefined;
481
+ }>>;
482
+ readonly end_region_statement: GerberCommandDef<"G37", z.ZodObject<{
483
+ command_code: z.ZodDefault<z.ZodLiteral<"G37">>;
484
+ }, "strip", z.ZodTypeAny, {
485
+ command_code: "G37";
486
+ }, {
487
+ command_code?: "G37" | undefined;
488
+ }>>;
489
+ readonly format_specification: GerberCommandDef<"FS", z.ZodObject<{
490
+ command_code: z.ZodDefault<z.ZodLiteral<"FS">>;
491
+ zero_omission_mode: z.ZodDefault<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"L">, z.ZodLiteral<"T">]>>>;
492
+ coordinate_notation: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A">, z.ZodLiteral<"I">]>>;
493
+ x_integer_digits: z.ZodDefault<z.ZodNumber>;
494
+ x_decimal_digits: z.ZodDefault<z.ZodNumber>;
495
+ y_integer_digits: z.ZodDefault<z.ZodNumber>;
496
+ y_decimal_digits: z.ZodDefault<z.ZodNumber>;
497
+ }, "strip", z.ZodTypeAny, {
498
+ command_code: "FS";
499
+ zero_omission_mode: "T" | "L" | null;
500
+ coordinate_notation: "A" | "I";
501
+ x_integer_digits: number;
502
+ x_decimal_digits: number;
503
+ y_integer_digits: number;
504
+ y_decimal_digits: number;
505
+ }, {
506
+ command_code?: "FS" | undefined;
507
+ zero_omission_mode?: "T" | "L" | null | undefined;
508
+ coordinate_notation?: "A" | "I" | undefined;
509
+ x_integer_digits?: number | undefined;
510
+ x_decimal_digits?: number | undefined;
511
+ y_integer_digits?: number | undefined;
512
+ y_decimal_digits?: number | undefined;
513
+ }>>;
514
+ readonly load_rotation: GerberCommandDef<"LR", z.ZodObject<{
515
+ command_code: z.ZodDefault<z.ZodLiteral<"LR">>;
516
+ rotation_degrees: z.ZodNumber;
517
+ }, "strip", z.ZodTypeAny, {
518
+ command_code: "LR";
519
+ rotation_degrees: number;
520
+ }, {
521
+ rotation_degrees: number;
522
+ command_code?: "LR" | undefined;
523
+ }>>;
524
+ readonly plot_operation: GerberCommandDef<"D01", z.ZodObject<{
525
+ command_code: z.ZodDefault<z.ZodLiteral<"D01">>;
526
+ x: z.ZodNumber;
527
+ y: z.ZodNumber;
528
+ i: z.ZodOptional<z.ZodNumber>;
529
+ j: z.ZodOptional<z.ZodNumber>;
530
+ }, "strip", z.ZodTypeAny, {
531
+ command_code: "D01";
532
+ x: number;
533
+ y: number;
534
+ i?: number | undefined;
535
+ j?: number | undefined;
536
+ }, {
537
+ x: number;
538
+ y: number;
539
+ command_code?: "D01" | undefined;
540
+ i?: number | undefined;
541
+ j?: number | undefined;
542
+ }>>;
543
+ readonly define_aperture_template: GerberCommandDef<"ADD", z.ZodIntersection<z.ZodUnion<[z.ZodDiscriminatedUnion<"standard_template_code", [z.ZodObject<{
544
+ standard_template_code: z.ZodLiteral<"C">;
545
+ diameter: z.ZodNumber;
546
+ hole_diameter: z.ZodOptional<z.ZodNumber>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ diameter: number;
549
+ standard_template_code: "C";
550
+ hole_diameter?: number | undefined;
551
+ }, {
552
+ diameter: number;
553
+ standard_template_code: "C";
554
+ hole_diameter?: number | undefined;
555
+ }>, z.ZodObject<{
556
+ standard_template_code: z.ZodLiteral<"R">;
557
+ x_size: z.ZodNumber;
558
+ y_size: z.ZodNumber;
559
+ hole_diameter: z.ZodOptional<z.ZodNumber>;
560
+ }, "strip", z.ZodTypeAny, {
561
+ standard_template_code: "R";
562
+ x_size: number;
563
+ y_size: number;
564
+ hole_diameter?: number | undefined;
565
+ }, {
566
+ standard_template_code: "R";
567
+ x_size: number;
568
+ y_size: number;
569
+ hole_diameter?: number | undefined;
570
+ }>, z.ZodObject<{
571
+ standard_template_code: z.ZodLiteral<"O">;
572
+ x_size: z.ZodNumber;
573
+ y_size: z.ZodNumber;
574
+ hole_diameter: z.ZodOptional<z.ZodNumber>;
575
+ }, "strip", z.ZodTypeAny, {
576
+ standard_template_code: "O";
577
+ x_size: number;
578
+ y_size: number;
579
+ hole_diameter?: number | undefined;
580
+ }, {
581
+ standard_template_code: "O";
582
+ x_size: number;
583
+ y_size: number;
584
+ hole_diameter?: number | undefined;
585
+ }>, z.ZodObject<{
586
+ standard_template_code: z.ZodLiteral<"P">;
587
+ outer_diameter: z.ZodNumber;
588
+ number_of_vertices: z.ZodNumber;
589
+ rotation: z.ZodOptional<z.ZodNumber>;
590
+ hole_diameter: z.ZodOptional<z.ZodNumber>;
591
+ }, "strip", z.ZodTypeAny, {
592
+ standard_template_code: "P";
593
+ outer_diameter: number;
594
+ number_of_vertices: number;
595
+ hole_diameter?: number | undefined;
596
+ rotation?: number | undefined;
597
+ }, {
598
+ standard_template_code: "P";
599
+ outer_diameter: number;
600
+ number_of_vertices: number;
601
+ hole_diameter?: number | undefined;
602
+ rotation?: number | undefined;
603
+ }>]>, z.ZodDiscriminatedUnion<"macro_name", [z.ZodObject<{
604
+ macro_name: z.ZodLiteral<"HORZPILL">;
605
+ x_size: z.ZodNumber;
606
+ y_size: z.ZodNumber;
607
+ circle_diameter: z.ZodNumber;
608
+ circle_center_offset: z.ZodNumber;
609
+ }, "strip", z.ZodTypeAny, {
610
+ macro_name: "HORZPILL";
611
+ x_size: number;
612
+ y_size: number;
613
+ circle_diameter: number;
614
+ circle_center_offset: number;
615
+ }, {
616
+ macro_name: "HORZPILL";
617
+ x_size: number;
618
+ y_size: number;
619
+ circle_diameter: number;
620
+ circle_center_offset: number;
621
+ }>, z.ZodObject<{
622
+ macro_name: z.ZodLiteral<"VERTPILL">;
623
+ x_size: z.ZodNumber;
624
+ y_size: z.ZodNumber;
625
+ circle_diameter: z.ZodNumber;
626
+ circle_center_offset: z.ZodNumber;
627
+ }, "strip", z.ZodTypeAny, {
628
+ macro_name: "VERTPILL";
629
+ x_size: number;
630
+ y_size: number;
631
+ circle_diameter: number;
632
+ circle_center_offset: number;
633
+ }, {
634
+ macro_name: "VERTPILL";
635
+ x_size: number;
636
+ y_size: number;
637
+ circle_diameter: number;
638
+ circle_center_offset: number;
639
+ }>, z.ZodObject<{
640
+ macro_name: z.ZodLiteral<"ROUNDRECT">;
641
+ corner_radius: z.ZodNumber;
642
+ corner_1_x: z.ZodNumber;
643
+ corner_1_y: z.ZodNumber;
644
+ corner_2_x: z.ZodNumber;
645
+ corner_2_y: z.ZodNumber;
646
+ corner_3_x: z.ZodNumber;
647
+ corner_3_y: z.ZodNumber;
648
+ corner_4_x: z.ZodNumber;
649
+ corner_4_y: z.ZodNumber;
650
+ }, "strip", z.ZodTypeAny, {
651
+ macro_name: "ROUNDRECT";
652
+ corner_radius: number;
653
+ corner_1_x: number;
654
+ corner_1_y: number;
655
+ corner_2_x: number;
656
+ corner_2_y: number;
657
+ corner_3_x: number;
658
+ corner_3_y: number;
659
+ corner_4_x: number;
660
+ corner_4_y: number;
661
+ }, {
662
+ macro_name: "ROUNDRECT";
663
+ corner_radius: number;
664
+ corner_1_x: number;
665
+ corner_1_y: number;
666
+ corner_2_x: number;
667
+ corner_2_y: number;
668
+ corner_3_x: number;
669
+ corner_3_y: number;
670
+ corner_4_x: number;
671
+ corner_4_y: number;
672
+ }>]>]>, z.ZodObject<{
673
+ command_code: z.ZodDefault<z.ZodLiteral<"ADD">>;
674
+ aperture_number: z.ZodNumber;
675
+ }, "strip", z.ZodTypeAny, {
676
+ command_code: "ADD";
677
+ aperture_number: number;
678
+ }, {
679
+ aperture_number: number;
680
+ command_code?: "ADD" | undefined;
681
+ }>>>;
682
+ readonly set_movement_mode_to_clockwise_circular: GerberCommandDef<"G02", z.ZodObject<{
683
+ command_code: z.ZodDefault<z.ZodLiteral<"G02">>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ command_code: "G02";
686
+ }, {
687
+ command_code?: "G02" | undefined;
688
+ }>>;
689
+ readonly set_movement_mode_to_counterclockwise_circular: GerberCommandDef<"G03", z.ZodObject<{
690
+ command_code: z.ZodDefault<z.ZodLiteral<"G03">>;
691
+ }, "strip", z.ZodTypeAny, {
692
+ command_code: "G03";
693
+ }, {
694
+ command_code?: "G03" | undefined;
695
+ }>>;
696
+ readonly set_movement_mode_to_linear: GerberCommandDef<"G01", z.ZodObject<{
697
+ command_code: z.ZodDefault<z.ZodLiteral<"G01">>;
698
+ }, "strip", z.ZodTypeAny, {
699
+ command_code: "G01";
700
+ }, {
701
+ command_code?: "G01" | undefined;
702
+ }>>;
703
+ readonly select_aperture: GerberCommandDef<"D", z.ZodObject<{
704
+ command_code: z.ZodDefault<z.ZodLiteral<"D">>;
705
+ aperture_number: z.ZodNumber;
706
+ }, "strip", z.ZodTypeAny, {
707
+ command_code: "D";
708
+ aperture_number: number;
709
+ }, {
710
+ aperture_number: number;
711
+ command_code?: "D" | undefined;
712
+ }>>;
713
+ readonly set_unit: GerberCommandDef<"MO", z.ZodObject<{
714
+ command_code: z.ZodDefault<z.ZodLiteral<"MO">>;
715
+ unit: z.ZodEnum<["MM", "in"]>;
716
+ }, "strip", z.ZodTypeAny, {
717
+ command_code: "MO";
718
+ unit: "MM" | "in";
719
+ }, {
720
+ unit: "MM" | "in";
721
+ command_code?: "MO" | undefined;
722
+ }>>;
723
+ readonly set_layer_polarity: GerberCommandDef<"LP", z.ZodObject<{
724
+ command_code: z.ZodDefault<z.ZodLiteral<"LP">>;
725
+ polarity: z.ZodEnum<["D", "C"]>;
726
+ }, "strip", z.ZodTypeAny, {
727
+ command_code: "LP";
728
+ polarity: "C" | "D";
729
+ }, {
730
+ polarity: "C" | "D";
731
+ command_code?: "LP" | undefined;
732
+ }>>;
733
+ readonly start_region_statement: GerberCommandDef<"G36", z.ZodObject<{
734
+ command_code: z.ZodDefault<z.ZodLiteral<"G36">>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ command_code: "G36";
737
+ }, {
738
+ command_code?: "G36" | undefined;
739
+ }>>;
740
+ };
741
+ type AnyGerberCommand = z.infer<(typeof gerber_command_map)[keyof typeof gerber_command_map]["schema"]>;
742
+
743
+ declare const gerberBuilder: () => GerberBuilder;
744
+ declare class GerberBuilder {
745
+ commands: Array<AnyGerberCommand>;
746
+ constructor();
747
+ $if(condition: boolean, fn: (gb: GerberBuilder) => GerberBuilder): GerberBuilder;
748
+ add<T extends keyof typeof gerber_command_map>(cmd: T, props: z.input<(typeof gerber_command_map)[T]["schema"]>): GerberBuilder;
749
+ build(): Array<AnyGerberCommand>;
750
+ }
751
+
752
+ type LayerToGerberCommandsMap = {
753
+ F_Cu: AnyGerberCommand[];
754
+ F_SilkScreen: AnyGerberCommand[];
755
+ F_Mask: AnyGerberCommand[];
756
+ F_Paste: AnyGerberCommand[];
757
+ B_Cu: AnyGerberCommand[];
758
+ B_SilkScreen: AnyGerberCommand[];
759
+ B_Mask: AnyGerberCommand[];
760
+ B_Paste: AnyGerberCommand[];
761
+ Edge_Cuts: AnyGerberCommand[];
762
+ };
763
+ type GerberLayerName = keyof LayerToGerberCommandsMap;
764
+
765
+ declare const stringifyGerberCommandLayers: (commandLayers: Record<GerberLayerName, AnyGerberCommand[]>) => Record<GerberLayerName, string>;
766
+
767
+ declare const stringifyGerberCommand: (command: AnyGerberCommand) => string;
768
+
769
+ declare const stringifyGerberCommands: (commands: AnyGerberCommand[]) => string;
770
+
771
+ /**
772
+ * Converts tscircuit soup to arrays of Gerber commands for each layer
773
+ */
774
+ declare const convertSoupToGerberCommands: (soup: AnyCircuitElement[], opts?: {
775
+ flip_y_axis?: boolean;
776
+ }) => LayerToGerberCommandsMap;
777
+
778
+ declare const CircuitJsonToGerberModule_convertSoupToExcellonDrillCommands: typeof convertSoupToExcellonDrillCommands;
779
+ declare const CircuitJsonToGerberModule_convertSoupToGerberCommands: typeof convertSoupToGerberCommands;
780
+ declare const CircuitJsonToGerberModule_excellonDrill: typeof excellonDrill;
781
+ declare const CircuitJsonToGerberModule_gerberBuilder: typeof gerberBuilder;
782
+ declare const CircuitJsonToGerberModule_stringifyExcellonDrill: typeof stringifyExcellonDrill;
783
+ declare const CircuitJsonToGerberModule_stringifyGerberCommand: typeof stringifyGerberCommand;
784
+ declare const CircuitJsonToGerberModule_stringifyGerberCommandLayers: typeof stringifyGerberCommandLayers;
785
+ declare const CircuitJsonToGerberModule_stringifyGerberCommands: typeof stringifyGerberCommands;
786
+ declare namespace CircuitJsonToGerberModule {
787
+ export { CircuitJsonToGerberModule_convertSoupToExcellonDrillCommands as convertSoupToExcellonDrillCommands, CircuitJsonToGerberModule_convertSoupToGerberCommands as convertSoupToGerberCommands, CircuitJsonToGerberModule_excellonDrill as excellonDrill, CircuitJsonToGerberModule_gerberBuilder as gerberBuilder, CircuitJsonToGerberModule_stringifyExcellonDrill as stringifyExcellonDrill, CircuitJsonToGerberModule_stringifyGerberCommand as stringifyGerberCommand, CircuitJsonToGerberModule_stringifyGerberCommandLayers as stringifyGerberCommandLayers, CircuitJsonToGerberModule_stringifyGerberCommands as stringifyGerberCommands };
788
+ }
789
+
790
+ interface AuthHeaders extends Record<string, string> {
791
+ Authorization: string;
792
+ }
793
+ interface ConversionOptions {
794
+ format?: "gltf" | "glb";
795
+ boardTextureResolution?: number;
796
+ showPcbNotes?: boolean;
797
+ boardDrillQuality?: "high" | "fast";
798
+ drawFauxBoard?: boolean;
799
+ includeModels?: boolean;
800
+ modelCache?: Map<string, STLMesh | OBJMesh>;
801
+ backgroundColor?: string;
802
+ showBoundingBoxes?: boolean;
803
+ coordinateTransform?: CoordinateTransformConfig;
804
+ projectBaseUrl?: string;
805
+ authHeaders?: AuthHeaders;
806
+ }
807
+ interface CoordinateTransformConfig {
808
+ flipX?: number;
809
+ flipY?: number;
810
+ flipZ?: number;
811
+ axisMapping?: {
812
+ x?: "x" | "y" | "z" | "-x" | "-y" | "-z";
813
+ y?: "x" | "y" | "z" | "-x" | "-y" | "-z";
814
+ z?: "x" | "y" | "z" | "-x" | "-y" | "-z";
815
+ };
816
+ rotation?: {
817
+ x?: number;
818
+ y?: number;
819
+ z?: number;
820
+ };
821
+ }
822
+ interface Point3 {
823
+ x: number;
824
+ y: number;
825
+ z: number;
826
+ }
827
+ interface Size3 {
828
+ x: number;
829
+ y: number;
830
+ z: number;
831
+ }
832
+ interface Triangle {
833
+ vertices: [Point3, Point3, Point3];
834
+ normal: Point3;
835
+ color?: Color;
836
+ materialIndex?: number;
837
+ }
838
+ interface BoundingBox {
839
+ min: Point3;
840
+ max: Point3;
841
+ }
842
+ interface STLMesh {
843
+ triangles: Triangle[];
844
+ boundingBox: BoundingBox;
845
+ }
846
+ interface OBJMesh extends STLMesh {
847
+ materials?: Map<string, OBJMaterial>;
848
+ materialIndexMap?: Map<string, number>;
849
+ }
850
+ interface OBJMaterial {
851
+ name: string;
852
+ color?: Color;
853
+ ambient?: Color;
854
+ specular?: Color;
855
+ shininess?: number;
856
+ dissolve?: number;
857
+ }
858
+ type Color = string | [number, number, number, number];
859
+ interface Box3D {
860
+ center: Point3;
861
+ size: Size3;
862
+ rotation?: Point3;
863
+ color?: Color;
864
+ texture?: {
865
+ top?: string;
866
+ bottom?: string;
867
+ front?: string;
868
+ back?: string;
869
+ left?: string;
870
+ right?: string;
871
+ };
872
+ mesh?: STLMesh | OBJMesh;
873
+ meshUrl?: string;
874
+ meshType?: "stl" | "obj" | "glb" | "step";
875
+ label?: string;
876
+ labelColor?: Color;
877
+ isTranslucent?: boolean;
878
+ }
879
+ interface Scene3D {
880
+ boxes: Box3D[];
881
+ camera?: Camera3D;
882
+ lights?: Light3D[];
883
+ }
884
+ interface Camera3D {
885
+ position: Point3;
886
+ target: Point3;
887
+ up?: Point3;
888
+ fov?: number;
889
+ near?: number;
890
+ far?: number;
891
+ }
892
+ interface Light3D {
893
+ type: "ambient" | "directional" | "point";
894
+ color?: Color;
895
+ intensity?: number;
896
+ position?: Point3;
897
+ direction?: Point3;
898
+ }
899
+ interface GLTFExportOptions {
900
+ binary?: boolean;
901
+ trs?: boolean;
902
+ onlyVisible?: boolean;
903
+ truncateDrawRange?: boolean;
904
+ embedImages?: boolean;
905
+ animations?: any[];
906
+ forceIndices?: boolean;
907
+ includeCustomExtensions?: boolean;
908
+ }
909
+ interface CircuitTo3DOptions {
910
+ pcbColor?: Color;
911
+ componentColor?: Color;
912
+ copperColor?: Color;
913
+ boardThickness?: number;
914
+ boardDrillQuality?: "high" | "fast";
915
+ drawFauxBoard?: boolean;
916
+ defaultComponentHeight?: number;
917
+ renderBoardTextures?: boolean;
918
+ textureResolution?: number;
919
+ showPcbNotes?: boolean;
920
+ coordinateTransform?: CoordinateTransformConfig;
921
+ showBoundingBoxes?: boolean;
922
+ projectBaseUrl?: string;
923
+ authHeaders?: AuthHeaders;
924
+ }
925
+ interface BoardRenderOptions {
926
+ layer: "top" | "bottom";
927
+ resolution?: number;
928
+ backgroundColor?: string;
929
+ copperColor?: string;
930
+ silkscreenColor?: string;
931
+ padColor?: string;
932
+ drillColor?: string;
933
+ showPcbNotes?: boolean;
934
+ }
935
+
936
+ declare function renderBoardLayer(circuitJson: CircuitJson, options: BoardRenderOptions): Promise<string>;
937
+ declare function renderBoardTextures(circuitJson: CircuitJson, { resolution, showPcbNotes }: {
938
+ resolution?: number | undefined;
939
+ showPcbNotes?: boolean | undefined;
940
+ }): Promise<{
941
+ top: string;
942
+ bottom: string;
943
+ }>;
944
+
945
+ declare function convertCircuitJsonTo3D(circuitJson: CircuitJson, options?: CircuitTo3DOptions): Promise<Scene3D>;
946
+
947
+ declare function convertSceneToGLTF(scene: Scene3D, options?: GLTFExportOptions): Promise<ArrayBuffer | object>;
948
+
949
+ declare function loadGLB({ url, transform, projectBaseUrl, authHeaders, }: {
950
+ url: string;
951
+ transform?: CoordinateTransformConfig;
952
+ projectBaseUrl?: string;
953
+ authHeaders?: AuthHeaders;
954
+ }): Promise<STLMesh | OBJMesh>;
955
+ declare function clearGLBCache(): void;
956
+
957
+ declare function loadOBJ({ url, transform, projectBaseUrl, authHeaders, }: {
958
+ url: string;
959
+ transform?: CoordinateTransformConfig;
960
+ projectBaseUrl?: string;
961
+ authHeaders?: AuthHeaders;
962
+ }): Promise<OBJMesh>;
963
+ declare function clearOBJCache(): void;
964
+
965
+ declare function loadSTL({ url, transform, projectBaseUrl, authHeaders, }: {
966
+ url: string;
967
+ transform?: CoordinateTransformConfig;
968
+ projectBaseUrl?: string;
969
+ authHeaders?: AuthHeaders;
970
+ }): Promise<STLMesh>;
971
+ declare function clearSTLCache(): void;
972
+
973
+ interface CameraFitOptions {
974
+ /**
975
+ * Target-to-camera direction vector used for solved camera position.
976
+ */
977
+ direction?: readonly [number, number, number];
978
+ /**
979
+ * Vertical field of view in degrees.
980
+ */
981
+ fov?: number;
982
+ /**
983
+ * Aspect ratio (width / height) used for horizontal fit calculations.
984
+ */
985
+ aspectRatio?: number;
986
+ /**
987
+ * Focal length in millimeters. If provided with sensorHeight,
988
+ * it is used instead of fov.
989
+ */
990
+ focalLength?: number;
991
+ /**
992
+ * Sensor height in millimeters for focalLength->fov conversion.
993
+ */
994
+ sensorHeight?: number;
995
+ }
996
+ /**
997
+ * Calculate optimal camera position for PCB viewing based on circuit dimensions
998
+ */
999
+ declare function getBestCameraPosition(circuitJson: CircuitJson): {
1000
+ camPos: readonly [number, number, number];
1001
+ lookAt: readonly [number, number, number];
1002
+ fov: number;
1003
+ };
1004
+
1005
+ declare function applyCoordinateTransform(point: Point3, config: CoordinateTransformConfig): Point3;
1006
+ declare function transformTriangles(triangles: Triangle[], config: CoordinateTransformConfig): Triangle[];
1007
+ declare const COORDINATE_TRANSFORMS: {
1008
+ readonly Z_UP_TO_Y_UP: CoordinateTransformConfig;
1009
+ readonly Z_OUT_OF_TOP: CoordinateTransformConfig;
1010
+ readonly STEP_INVERTED: CoordinateTransformConfig;
1011
+ readonly USB_PORT_FIX: CoordinateTransformConfig;
1012
+ readonly Z_UP_TO_Y_UP_USB_FIX: CoordinateTransformConfig;
1013
+ readonly IDENTITY: CoordinateTransformConfig;
1014
+ readonly TEST_ROTATE_X_90: CoordinateTransformConfig;
1015
+ readonly TEST_ROTATE_X_270: CoordinateTransformConfig;
1016
+ readonly TEST_ROTATE_Y_90: CoordinateTransformConfig;
1017
+ readonly TEST_ROTATE_Y_270: CoordinateTransformConfig;
1018
+ readonly TEST_ROTATE_Z_90: CoordinateTransformConfig;
1019
+ readonly TEST_ROTATE_Z_270: CoordinateTransformConfig;
1020
+ readonly TEST_FLIP_X: CoordinateTransformConfig;
1021
+ readonly TEST_FLIP_Z: CoordinateTransformConfig;
1022
+ readonly FOOTPRINTER_MODEL_TRANSFORM: CoordinateTransformConfig;
1023
+ readonly OBJ_Z_UP_TO_Y_UP: CoordinateTransformConfig;
1024
+ };
1025
+
1026
+ declare function convertCircuitJsonToGltf(circuitJson: CircuitJson, options?: ConversionOptions): Promise<ArrayBuffer | object>;
1027
+
1028
+ interface Point {
1029
+ x: number;
1030
+ y: number;
1031
+ }
1032
+ type LayerRef = string | number;
1033
+ interface BRepShape {
1034
+ polygons: Point[][];
1035
+ is_negative?: boolean;
1036
+ }
1037
+
1038
+ type CircuitJsonToGltfModule_BRepShape = BRepShape;
1039
+ type CircuitJsonToGltfModule_BoardRenderOptions = BoardRenderOptions;
1040
+ type CircuitJsonToGltfModule_BoundingBox = BoundingBox;
1041
+ type CircuitJsonToGltfModule_Box3D = Box3D;
1042
+ declare const CircuitJsonToGltfModule_COORDINATE_TRANSFORMS: typeof COORDINATE_TRANSFORMS;
1043
+ type CircuitJsonToGltfModule_Camera3D = Camera3D;
1044
+ type CircuitJsonToGltfModule_CameraFitOptions = CameraFitOptions;
1045
+ type CircuitJsonToGltfModule_CircuitTo3DOptions = CircuitTo3DOptions;
1046
+ type CircuitJsonToGltfModule_Color = Color;
1047
+ type CircuitJsonToGltfModule_ConversionOptions = ConversionOptions;
1048
+ type CircuitJsonToGltfModule_CoordinateTransformConfig = CoordinateTransformConfig;
1049
+ type CircuitJsonToGltfModule_GLTFExportOptions = GLTFExportOptions;
1050
+ type CircuitJsonToGltfModule_LayerRef = LayerRef;
1051
+ type CircuitJsonToGltfModule_Light3D = Light3D;
1052
+ type CircuitJsonToGltfModule_OBJMaterial = OBJMaterial;
1053
+ type CircuitJsonToGltfModule_OBJMesh = OBJMesh;
1054
+ type CircuitJsonToGltfModule_Point = Point;
1055
+ type CircuitJsonToGltfModule_Point3 = Point3;
1056
+ type CircuitJsonToGltfModule_STLMesh = STLMesh;
1057
+ type CircuitJsonToGltfModule_Scene3D = Scene3D;
1058
+ type CircuitJsonToGltfModule_Size3 = Size3;
1059
+ type CircuitJsonToGltfModule_Triangle = Triangle;
1060
+ declare const CircuitJsonToGltfModule_applyCoordinateTransform: typeof applyCoordinateTransform;
1061
+ declare const CircuitJsonToGltfModule_clearGLBCache: typeof clearGLBCache;
1062
+ declare const CircuitJsonToGltfModule_clearOBJCache: typeof clearOBJCache;
1063
+ declare const CircuitJsonToGltfModule_clearSTLCache: typeof clearSTLCache;
1064
+ declare const CircuitJsonToGltfModule_convertCircuitJsonTo3D: typeof convertCircuitJsonTo3D;
1065
+ declare const CircuitJsonToGltfModule_convertCircuitJsonToGltf: typeof convertCircuitJsonToGltf;
1066
+ declare const CircuitJsonToGltfModule_convertSceneToGLTF: typeof convertSceneToGLTF;
1067
+ declare const CircuitJsonToGltfModule_getBestCameraPosition: typeof getBestCameraPosition;
1068
+ declare const CircuitJsonToGltfModule_loadGLB: typeof loadGLB;
1069
+ declare const CircuitJsonToGltfModule_loadOBJ: typeof loadOBJ;
1070
+ declare const CircuitJsonToGltfModule_loadSTL: typeof loadSTL;
1071
+ declare const CircuitJsonToGltfModule_renderBoardLayer: typeof renderBoardLayer;
1072
+ declare const CircuitJsonToGltfModule_renderBoardTextures: typeof renderBoardTextures;
1073
+ declare const CircuitJsonToGltfModule_transformTriangles: typeof transformTriangles;
1074
+ declare namespace CircuitJsonToGltfModule {
1075
+ export { type CircuitJsonToGltfModule_BRepShape as BRepShape, type CircuitJsonToGltfModule_BoardRenderOptions as BoardRenderOptions, type CircuitJsonToGltfModule_BoundingBox as BoundingBox, type CircuitJsonToGltfModule_Box3D as Box3D, CircuitJsonToGltfModule_COORDINATE_TRANSFORMS as COORDINATE_TRANSFORMS, type CircuitJsonToGltfModule_Camera3D as Camera3D, type CircuitJsonToGltfModule_CameraFitOptions as CameraFitOptions, type CircuitJsonToGltfModule_CircuitTo3DOptions as CircuitTo3DOptions, type CircuitJsonToGltfModule_Color as Color, type CircuitJsonToGltfModule_ConversionOptions as ConversionOptions, type CircuitJsonToGltfModule_CoordinateTransformConfig as CoordinateTransformConfig, type CircuitJsonToGltfModule_GLTFExportOptions as GLTFExportOptions, type CircuitJsonToGltfModule_LayerRef as LayerRef, type CircuitJsonToGltfModule_Light3D as Light3D, type CircuitJsonToGltfModule_OBJMaterial as OBJMaterial, type CircuitJsonToGltfModule_OBJMesh as OBJMesh, type CircuitJsonToGltfModule_Point as Point, type CircuitJsonToGltfModule_Point3 as Point3, type CircuitJsonToGltfModule_STLMesh as STLMesh, type CircuitJsonToGltfModule_Scene3D as Scene3D, type CircuitJsonToGltfModule_Size3 as Size3, type CircuitJsonToGltfModule_Triangle as Triangle, CircuitJsonToGltfModule_applyCoordinateTransform as applyCoordinateTransform, CircuitJsonToGltfModule_clearGLBCache as clearGLBCache, CircuitJsonToGltfModule_clearOBJCache as clearOBJCache, CircuitJsonToGltfModule_clearSTLCache as clearSTLCache, CircuitJsonToGltfModule_convertCircuitJsonTo3D as convertCircuitJsonTo3D, CircuitJsonToGltfModule_convertCircuitJsonToGltf as convertCircuitJsonToGltf, CircuitJsonToGltfModule_convertSceneToGLTF as convertSceneToGLTF, CircuitJsonToGltfModule_getBestCameraPosition as getBestCameraPosition, CircuitJsonToGltfModule_loadGLB as loadGLB, CircuitJsonToGltfModule_loadOBJ as loadOBJ, CircuitJsonToGltfModule_loadSTL as loadSTL, CircuitJsonToGltfModule_renderBoardLayer as renderBoardLayer, CircuitJsonToGltfModule_renderBoardTextures as renderBoardTextures, CircuitJsonToGltfModule_transformTriangles as transformTriangles };
1076
+ }
1077
+
1078
+ type PaperSize = "A0" | "A1" | "A2" | "A3" | "A4" | "A5";
1079
+ interface PaperDimensions {
1080
+ width: number;
1081
+ height: number;
1082
+ name: PaperSize;
1083
+ }
1084
+
1085
+ type SchematicPortId = string;
1086
+ type SchematicTraceId = string;
1087
+ type PcbPortId = string;
1088
+ interface PcbNetInfo {
1089
+ id: number;
1090
+ name: string;
1091
+ }
1092
+ interface SymbolEntry {
1093
+ symbolName: string;
1094
+ symbol: SchematicSymbol;
1095
+ /**
1096
+ * Whether this symbol is from a standard library footprint (has footprinter_string).
1097
+ * If true, this is a builtin/standard symbol. If false, it's a custom/inline symbol.
1098
+ */
1099
+ isBuiltin?: boolean;
1100
+ }
1101
+ interface FootprintEntry {
1102
+ footprintName: string;
1103
+ kicadModString: string;
1104
+ model3dSourcePaths: string[];
1105
+ /**
1106
+ * Whether this footprint is from a standard library footprint (has footprinter_string).
1107
+ * If true, this is a builtin/standard footprint. If false, it's a custom/inline footprint.
1108
+ */
1109
+ isBuiltin?: boolean;
1110
+ }
1111
+ interface KicadLibraryOutput {
1112
+ kicadSymString: string;
1113
+ symbols: SymbolEntry[];
1114
+ footprints: FootprintEntry[];
1115
+ fpLibTableString: string;
1116
+ symLibTableString: string;
1117
+ model3dSourcePaths: string[];
1118
+ }
1119
+ interface ConverterContext {
1120
+ db: CircuitJsonUtilObjects;
1121
+ circuitJson: CircuitJson;
1122
+ kicadSch?: KicadSch;
1123
+ kicadPcb?: KicadPcb;
1124
+ /** Circuit JSON to KiCad schematic transformation matrix */
1125
+ c2kMatSch?: Matrix;
1126
+ /** Circuit JSON to KiCad PCB transformation matrix */
1127
+ c2kMatPcb?: Matrix;
1128
+ /** Selected paper size for schematic */
1129
+ schematicPaperSize?: PaperDimensions;
1130
+ pinPositions?: Map<SchematicPortId, {
1131
+ x: number;
1132
+ y: number;
1133
+ }>;
1134
+ wireConnections?: Map<SchematicTraceId, SchematicPortId[]>;
1135
+ pcbPadPositions?: Map<PcbPortId, {
1136
+ x: number;
1137
+ y: number;
1138
+ }>;
1139
+ pcbNetMap?: Map<string, PcbNetInfo>;
1140
+ numLayers?: number;
1141
+ /** Project name used as the .3dshapes folder for user-provided 3D models */
1142
+ projectName?: string;
1143
+ /** CDN URLs of 3D models needed for this PCB (collected during footprint stage) */
1144
+ pcbModel3dSourcePaths?: string[];
1145
+ libraryName?: string;
1146
+ fpLibraryName?: string;
1147
+ kicadSchString?: string;
1148
+ kicadPcbString?: string;
1149
+ symbolEntries?: SymbolEntry[];
1150
+ footprintEntries?: FootprintEntry[];
1151
+ libraryOutput?: KicadLibraryOutput;
1152
+ }
1153
+ declare abstract class ConverterStage<Input, Output> {
1154
+ MAX_ITERATIONS: number;
1155
+ iteration: number;
1156
+ finished: boolean;
1157
+ input: Input;
1158
+ ctx: ConverterContext;
1159
+ constructor(input: Input, ctx: ConverterContext);
1160
+ step(): void;
1161
+ _step(): void;
1162
+ runUntilFinished(): void;
1163
+ getOutput(): Output;
1164
+ }
1165
+
1166
+ declare class CircuitJsonToKicadSchConverter {
1167
+ ctx: ConverterContext;
1168
+ pipeline: ConverterStage<CircuitJson, KicadSch>[];
1169
+ currentStageIndex: number;
1170
+ finished: boolean;
1171
+ get currentStage(): ConverterStage<CircuitJson, KicadSch> | undefined;
1172
+ constructor(circuitJson: CircuitJson);
1173
+ step(): void;
1174
+ runUntilFinished(): void;
1175
+ getOutput(): KicadSch;
1176
+ /**
1177
+ * Get the output as a string
1178
+ */
1179
+ getOutputString(): string;
1180
+ }
1181
+
1182
+ interface CircuitJsonToKicadPcbOptions {
1183
+ /**
1184
+ * Set to true to embed "${KIPRJMOD}/3dmodels" 3D model references for
1185
+ * builtin footprints. Enable this in the CLI zip export.
1186
+ * Defaults to false.
1187
+ */
1188
+ includeBuiltin3dModels?: boolean;
1189
+ /**
1190
+ * Project name used as the .3dshapes folder for user-provided models.
1191
+ * e.g. "index" → "3dmodels/index.3dshapes/{filename}"
1192
+ */
1193
+ projectName?: string;
1194
+ }
1195
+ declare class CircuitJsonToKicadPcbConverter {
1196
+ ctx: ConverterContext;
1197
+ pipeline: ConverterStage<CircuitJson, KicadPcb>[];
1198
+ currentStageIndex: number;
1199
+ finished: boolean;
1200
+ get currentStage(): ConverterStage<CircuitJson, KicadPcb> | undefined;
1201
+ constructor(circuitJson: CircuitJson, options?: CircuitJsonToKicadPcbOptions);
1202
+ step(): void;
1203
+ runUntilFinished(): void;
1204
+ getOutput(): KicadPcb;
1205
+ /**
1206
+ * Get the output as a string
1207
+ */
1208
+ getOutputString(): string;
1209
+ /**
1210
+ * Returns CDN URLs for 3D model files needed by builtin footprints in this PCB.
1211
+ * The CLI can use these to download and include the models in the project zip.
1212
+ */
1213
+ getModel3dSourcePaths(): string[];
1214
+ }
1215
+
1216
+ interface CircuitJsonToKicadProOptions {
1217
+ projectName?: string;
1218
+ schematicFilename?: string;
1219
+ pcbFilename?: string;
1220
+ }
1221
+ interface KicadProProject {
1222
+ version: number;
1223
+ head: {
1224
+ generator: string;
1225
+ generator_version: string;
1226
+ project_name: string;
1227
+ created: string;
1228
+ modified: string;
1229
+ };
1230
+ meta: {
1231
+ version: number;
1232
+ };
1233
+ text_variables: Record<string, string>;
1234
+ libraries: {
1235
+ pinned_symbol_libs: string[];
1236
+ pinned_footprint_libs: string[];
1237
+ };
1238
+ boards: string[];
1239
+ cvpcb: {
1240
+ meta: {
1241
+ version: number;
1242
+ };
1243
+ };
1244
+ erc: {
1245
+ meta: {
1246
+ version: number;
1247
+ };
1248
+ erc_exclusions: unknown[];
1249
+ };
1250
+ net_settings: {
1251
+ meta: {
1252
+ version: number;
1253
+ };
1254
+ last_net_id: number;
1255
+ classes: unknown[];
1256
+ };
1257
+ pcbnew: {
1258
+ page_layout_descr_file: string;
1259
+ last_paths: Record<string, string>;
1260
+ };
1261
+ schematic: {
1262
+ meta: {
1263
+ version: number;
1264
+ };
1265
+ page_layout_descr_file: string;
1266
+ last_opened_files: string[];
1267
+ };
1268
+ board: {
1269
+ meta: {
1270
+ version: number;
1271
+ };
1272
+ last_opened_board: string;
1273
+ };
1274
+ sheets: [string, string][];
1275
+ }
1276
+ declare class CircuitJsonToKicadProConverter {
1277
+ ctx: {
1278
+ db: ReturnType<typeof cju>;
1279
+ circuitJson: CircuitJson;
1280
+ };
1281
+ private project;
1282
+ constructor(circuitJson: CircuitJson, options?: CircuitJsonToKicadProOptions);
1283
+ runUntilFinished(): void;
1284
+ getOutput(): KicadProProject;
1285
+ getOutputString(): string;
1286
+ }
1287
+
1288
+ interface CircuitJsonToKicadLibraryOptions {
1289
+ libraryName?: string;
1290
+ footprintLibraryName?: string;
1291
+ }
1292
+
1293
+ declare class CircuitJsonToKicadLibraryConverter {
1294
+ ctx: ConverterContext;
1295
+ pipeline: ConverterStage<CircuitJson, KicadLibraryOutput>[];
1296
+ currentStageIndex: number;
1297
+ finished: boolean;
1298
+ get currentStage(): ConverterStage<CircuitJson, KicadLibraryOutput> | undefined;
1299
+ constructor(circuitJson: CircuitJson, options?: CircuitJsonToKicadLibraryOptions);
1300
+ step(): void;
1301
+ runUntilFinished(): void;
1302
+ getOutput(): KicadLibraryOutput;
1303
+ getSymbolLibraryString(): string;
1304
+ getFootprints(): FootprintEntry[];
1305
+ getFpLibTableString(): string;
1306
+ getSymLibTableString(): string;
1307
+ getModel3dSourcePaths(): string[];
1308
+ }
1309
+
1310
+ interface KicadLibraryConverterOptions {
1311
+ /**
1312
+ * Name for the generated KiCad library (e.g., "my-library").
1313
+ * This will be used for the user library files.
1314
+ */
1315
+ kicadLibraryName?: string;
1316
+ /**
1317
+ * The main entry point file for the library (e.g., "lib/my-library.ts").
1318
+ * This file's exports define the public API of the library.
1319
+ */
1320
+ entrypoint: string;
1321
+ /**
1322
+ * Callback to build circuit JSON from a file path and export name.
1323
+ * Should handle both board components and symbol components:
1324
+ * - For board components: render inside a <board> element
1325
+ * - For symbol components: render inside a <chip> with the symbol prop
1326
+ * (Note: tscircuit symbols cannot render standalone - they must be
1327
+ * used as a prop on a <chip> component)
1328
+ * Return null if the export cannot be rendered.
1329
+ */
1330
+ buildFileToCircuitJson: (filePath: string, componentName: string) => Promise<CircuitJson | null>;
1331
+ /**
1332
+ * Callback to get all exports from a TSX/TS file.
1333
+ * Must evaluate the file (not just parse) to handle `export * from` patterns.
1334
+ */
1335
+ getExportsFromTsxFile: (filePath: string) => Promise<string[]>;
1336
+ /**
1337
+ * Callback to resolve an export name to its file path.
1338
+ * Returns the file path where the component is defined, or null if not resolvable.
1339
+ */
1340
+ resolveExportPath?: (entrypoint: string, exportName: string) => Promise<string | null>;
1341
+ /**
1342
+ * Whether to include builtin footprints/symbols (like 0402, soic8).
1343
+ * Default: true
1344
+ */
1345
+ includeBuiltins?: boolean;
1346
+ /**
1347
+ * Whether to generate files for KiCad PCM (Plugin and Content Manager).
1348
+ * When true:
1349
+ * - Footprint references in symbols will be prefixed with "PCM_"
1350
+ * - 3D model paths will use ${KICAD_3RD_PARTY} variable instead of relative paths
1351
+ * Default: false
1352
+ */
1353
+ isPcm?: boolean;
1354
+ /**
1355
+ * The KiCad PCM package identifier (e.g., "com_tscircuit_author_package-name").
1356
+ * Required when useKicadPcmPaths is true.
1357
+ * Used to construct 3D model paths like:
1358
+ * ${KICAD9_3RD_PARTY}/3dmodels/<kicadPcmPackageId>/<library>.3dshapes/<model>.step
1359
+ */
1360
+ kicadPcmPackageId?: string;
1361
+ }
1362
+ interface KicadLibraryConverterOutput {
1363
+ /**
1364
+ * Map of file paths to file contents for the generated KiCad library.
1365
+ */
1366
+ kicadProjectFsMap: Record<string, string | Buffer>;
1367
+ /**
1368
+ * Source paths to 3D model files that need to be copied.
1369
+ */
1370
+ model3dSourcePaths: string[];
1371
+ }
1372
+
1373
+ /**
1374
+ * Converts tscircuit component files to a KiCad library.
1375
+ */
1376
+ declare class KicadLibraryConverter {
1377
+ private options;
1378
+ private output;
1379
+ private ctx;
1380
+ constructor(options: KicadLibraryConverterOptions);
1381
+ run(): Promise<void>;
1382
+ /**
1383
+ * Builds tscircuit components to circuit-json.
1384
+ */
1385
+ private buildTscircuitComponents;
1386
+ /**
1387
+ * Extracts KiCad footprints and symbols from built tscircuit components.
1388
+ */
1389
+ private extractKicadComponents;
1390
+ getOutput(): KicadLibraryConverterOutput;
1391
+ }
1392
+
1393
+ type CircuitJsonToKicadModule_CircuitJsonToKicadLibraryConverter = CircuitJsonToKicadLibraryConverter;
1394
+ declare const CircuitJsonToKicadModule_CircuitJsonToKicadLibraryConverter: typeof CircuitJsonToKicadLibraryConverter;
1395
+ type CircuitJsonToKicadModule_CircuitJsonToKicadPcbConverter = CircuitJsonToKicadPcbConverter;
1396
+ declare const CircuitJsonToKicadModule_CircuitJsonToKicadPcbConverter: typeof CircuitJsonToKicadPcbConverter;
1397
+ type CircuitJsonToKicadModule_CircuitJsonToKicadProConverter = CircuitJsonToKicadProConverter;
1398
+ declare const CircuitJsonToKicadModule_CircuitJsonToKicadProConverter: typeof CircuitJsonToKicadProConverter;
1399
+ type CircuitJsonToKicadModule_CircuitJsonToKicadSchConverter = CircuitJsonToKicadSchConverter;
1400
+ declare const CircuitJsonToKicadModule_CircuitJsonToKicadSchConverter: typeof CircuitJsonToKicadSchConverter;
1401
+ type CircuitJsonToKicadModule_FootprintEntry = FootprintEntry;
1402
+ type CircuitJsonToKicadModule_KicadLibraryConverter = KicadLibraryConverter;
1403
+ declare const CircuitJsonToKicadModule_KicadLibraryConverter: typeof KicadLibraryConverter;
1404
+ type CircuitJsonToKicadModule_KicadLibraryConverterOptions = KicadLibraryConverterOptions;
1405
+ type CircuitJsonToKicadModule_KicadLibraryConverterOutput = KicadLibraryConverterOutput;
1406
+ type CircuitJsonToKicadModule_KicadLibraryOutput = KicadLibraryOutput;
1407
+ type CircuitJsonToKicadModule_SymbolEntry = SymbolEntry;
1408
+ declare namespace CircuitJsonToKicadModule {
1409
+ export { CircuitJsonToKicadModule_CircuitJsonToKicadLibraryConverter as CircuitJsonToKicadLibraryConverter, CircuitJsonToKicadModule_CircuitJsonToKicadPcbConverter as CircuitJsonToKicadPcbConverter, CircuitJsonToKicadModule_CircuitJsonToKicadProConverter as CircuitJsonToKicadProConverter, CircuitJsonToKicadModule_CircuitJsonToKicadSchConverter as CircuitJsonToKicadSchConverter, type CircuitJsonToKicadModule_FootprintEntry as FootprintEntry, CircuitJsonToKicadModule_KicadLibraryConverter as KicadLibraryConverter, type CircuitJsonToKicadModule_KicadLibraryConverterOptions as KicadLibraryConverterOptions, type CircuitJsonToKicadModule_KicadLibraryConverterOutput as KicadLibraryConverterOutput, type CircuitJsonToKicadModule_KicadLibraryOutput as KicadLibraryOutput, type CircuitJsonToKicadModule_SymbolEntry as SymbolEntry };
1410
+ }
1411
+
1412
+ interface ConvertCircuitJsonToLbrnOptions {
1413
+ includeSilkscreen?: boolean;
1414
+ origin?: {
1415
+ x: number;
1416
+ y: number;
1417
+ };
1418
+ margin?: number;
1419
+ includeCopper?: boolean;
1420
+ includeSoldermask?: boolean;
1421
+ includeSoldermaskCure?: boolean;
1422
+ globalCopperSoldermaskMarginAdjustment?: number;
1423
+ solderMaskMarginPercent?: number;
1424
+ includeLayers?: Array<"top" | "bottom">;
1425
+ traceMargin?: number;
1426
+ laserSpotSize?: number;
1427
+ mirrorBottomLayer?: boolean;
1428
+ /**
1429
+ * Whether to generate copper cut fill layers.
1430
+ * Creates a ring/band around traces and pads that will be laser cut
1431
+ * to remove copper, without cutting into the traces or pads themselves.
1432
+ */
1433
+ includeCopperCutFill?: boolean;
1434
+ /**
1435
+ * Margin to expand the copper outline for the cut fill band (in mm).
1436
+ * This determines how wide the band of copper removal will be around traces/pads.
1437
+ */
1438
+ copperCutFillMargin?: number;
1439
+ /**
1440
+ * Whether to generate an oxidation cleaning layer.
1441
+ * Creates a filled area covering the entire "inside" of the board outline
1442
+ * for laser ablation to clean oxidation from the copper surface.
1443
+ */
1444
+ includeOxidationCleaningLayer?: boolean;
1445
+ laserProfile?: {
1446
+ copper?: {
1447
+ speed?: number;
1448
+ numPasses?: number;
1449
+ frequency?: number;
1450
+ pulseWidth?: number;
1451
+ };
1452
+ board?: {
1453
+ speed?: number;
1454
+ numPasses?: number;
1455
+ frequency?: number;
1456
+ pulseWidth?: number;
1457
+ };
1458
+ };
1459
+ }
1460
+ declare const convertCircuitJsonToLbrn: (circuitJson: CircuitJson, options?: ConvertCircuitJsonToLbrnOptions) => Promise<LightBurnProject>;
1461
+
1462
+ type CircuitJsonToLbrnModule_ConvertCircuitJsonToLbrnOptions = ConvertCircuitJsonToLbrnOptions;
1463
+ declare const CircuitJsonToLbrnModule_convertCircuitJsonToLbrn: typeof convertCircuitJsonToLbrn;
1464
+ declare namespace CircuitJsonToLbrnModule {
1465
+ export { type CircuitJsonToLbrnModule_ConvertCircuitJsonToLbrnOptions as ConvertCircuitJsonToLbrnOptions, CircuitJsonToLbrnModule_convertCircuitJsonToLbrn as convertCircuitJsonToLbrn };
1466
+ }
1467
+
1468
+ interface PickAndPlaceRow {
1469
+ designator: string;
1470
+ mid_x: number;
1471
+ mid_y: number;
1472
+ layer: LayerRef$1;
1473
+ rotation: number;
1474
+ }
1475
+ declare const convertCircuitJsonToPickAndPlaceRows: (circuitJson: AnyCircuitElement[], opts?: {
1476
+ flip_y_axis?: boolean;
1477
+ }) => PickAndPlaceRow[];
1478
+ declare const convertCircuitJsonToPickAndPlaceCsv: (circuitJson: AnyCircuitElement[]) => string;
1479
+
1480
+ declare const CircuitJsonToPnpCsvModule_convertCircuitJsonToPickAndPlaceCsv: typeof convertCircuitJsonToPickAndPlaceCsv;
1481
+ declare const CircuitJsonToPnpCsvModule_convertCircuitJsonToPickAndPlaceRows: typeof convertCircuitJsonToPickAndPlaceRows;
1482
+ declare namespace CircuitJsonToPnpCsvModule {
1483
+ export { CircuitJsonToPnpCsvModule_convertCircuitJsonToPickAndPlaceCsv as convertCircuitJsonToPickAndPlaceCsv, CircuitJsonToPnpCsvModule_convertCircuitJsonToPickAndPlaceRows as convertCircuitJsonToPickAndPlaceRows };
1484
+ }
1485
+
1486
+ declare const convertCircuitJsonToReadableNetlist: (circuitJson: AnyCircuitElement[]) => string;
1487
+
1488
+ declare const CircuitJsonToReadableNetlistModule_convertCircuitJsonToReadableNetlist: typeof convertCircuitJsonToReadableNetlist;
1489
+ declare namespace CircuitJsonToReadableNetlistModule {
1490
+ export { CircuitJsonToReadableNetlistModule_convertCircuitJsonToReadableNetlist as convertCircuitJsonToReadableNetlist };
1491
+ }
1492
+
1493
+ type AnglePreset = "angle1" | "angle2" | "left" | "right" | "left-raised" | "right-raised";
1494
+
1495
+ interface BackgroundOptions {
1496
+ color?: string;
1497
+ opacity?: number;
1498
+ }
1499
+ interface Simple3dSvgOptions {
1500
+ camera?: {
1501
+ position: {
1502
+ x: number;
1503
+ y: number;
1504
+ z: number;
1505
+ };
1506
+ lookAt: {
1507
+ x: number;
1508
+ y: number;
1509
+ z: number;
1510
+ };
1511
+ focalLength?: number;
1512
+ };
1513
+ anglePreset?: AnglePreset;
1514
+ defaultZoomMultiplier?: number;
1515
+ background?: BackgroundOptions;
1516
+ width?: number;
1517
+ height?: number;
1518
+ showAxes?: boolean;
1519
+ showOrigin?: boolean;
1520
+ showGrid?: boolean;
1521
+ showBoundingBoxes?: boolean;
1522
+ }
1523
+
1524
+ declare function convertCircuitJsonToSimple3dScene(circuitJson: CircuitJson, opts?: Simple3dSvgOptions): Promise<{
1525
+ boxes: Box[];
1526
+ camera: any;
1527
+ }>;
1528
+ declare function convertCircuitJsonToSimple3dSvg(circuitJson: CircuitJson, opts?: Simple3dSvgOptions): Promise<string>;
1529
+
1530
+ type CircuitJsonToSimple3dModule_AnglePreset = AnglePreset;
1531
+ type CircuitJsonToSimple3dModule_BackgroundOptions = BackgroundOptions;
1532
+ type CircuitJsonToSimple3dModule_Simple3dSvgOptions = Simple3dSvgOptions;
1533
+ declare const CircuitJsonToSimple3dModule_convertCircuitJsonToSimple3dScene: typeof convertCircuitJsonToSimple3dScene;
1534
+ declare const CircuitJsonToSimple3dModule_convertCircuitJsonToSimple3dSvg: typeof convertCircuitJsonToSimple3dSvg;
1535
+ declare namespace CircuitJsonToSimple3dModule {
1536
+ export { type CircuitJsonToSimple3dModule_AnglePreset as AnglePreset, type CircuitJsonToSimple3dModule_BackgroundOptions as BackgroundOptions, type CircuitJsonToSimple3dModule_Simple3dSvgOptions as Simple3dSvgOptions, CircuitJsonToSimple3dModule_convertCircuitJsonToSimple3dScene as convertCircuitJsonToSimple3dScene, CircuitJsonToSimple3dModule_convertCircuitJsonToSimple3dSvg as convertCircuitJsonToSimple3dSvg };
1537
+ }
1538
+
1539
+ interface BaseSpiceCommand {
1540
+ commandName?: string;
1541
+ statementName?: string;
1542
+ toSpiceString(): string;
1543
+ }
1544
+
1545
+ declare class SpiceComponent {
1546
+ name: string;
1547
+ command: BaseSpiceCommand;
1548
+ nodes: string[];
1549
+ constructor(name: string, command: BaseSpiceCommand, nodes: string[]);
1550
+ toSpiceString(): string;
1551
+ }
1552
+
1553
+ declare class SpiceSubcircuit {
1554
+ name: string;
1555
+ pins: string[];
1556
+ constructor(name: string, pins: string[]);
1557
+ toSpiceString(): string;
1558
+ }
1559
+
1560
+ declare class SpiceNetlist {
1561
+ title: string;
1562
+ components: SpiceComponent[];
1563
+ nodes: Set<string>;
1564
+ controls: string[];
1565
+ subcircuits: SpiceSubcircuit[];
1566
+ models: Map<string, string>;
1567
+ tranCommand: string | null;
1568
+ printStatements: string[];
1569
+ constructor(title?: string);
1570
+ addComponent(component: SpiceComponent): void;
1571
+ addSubcircuit(subcircuit: SpiceSubcircuit): void;
1572
+ toSpiceString(): string;
1573
+ }
1574
+
1575
+ declare function circuitJsonToSpice(circuitJson: AnyCircuitElement[]): SpiceNetlist;
1576
+
1577
+ declare const convertSpiceNetlistToString: (netlist: SpiceNetlist) => string;
1578
+
1579
+ interface BJTCommandProps {
1580
+ name: string;
1581
+ collector: string;
1582
+ base: string;
1583
+ emitter: string;
1584
+ substrate?: string;
1585
+ model: string;
1586
+ area?: string;
1587
+ }
1588
+ declare class BJTCommand implements BaseSpiceCommand {
1589
+ commandName: "bjt";
1590
+ props: BJTCommandProps;
1591
+ constructor(props: BJTCommandProps);
1592
+ toSpiceString(): string;
1593
+ }
1594
+
1595
+ interface CapacitorCommandProps {
1596
+ name: string;
1597
+ positiveNode: string;
1598
+ negativeNode: string;
1599
+ modelName?: string;
1600
+ value: string;
1601
+ initialCondition?: string;
1602
+ }
1603
+ declare class CapacitorCommand implements BaseSpiceCommand {
1604
+ commandName: "capacitor";
1605
+ props: CapacitorCommandProps;
1606
+ constructor(props: CapacitorCommandProps);
1607
+ toSpiceString(): string;
1608
+ }
1609
+
1610
+ interface CurrentSourceCommandProps {
1611
+ name: string;
1612
+ positiveNode: string;
1613
+ negativeNode: string;
1614
+ value?: string;
1615
+ acMagnitude?: string;
1616
+ acPhase?: string;
1617
+ }
1618
+ declare class CurrentSourceCommand implements BaseSpiceCommand {
1619
+ commandName: "current_source";
1620
+ props: CurrentSourceCommandProps;
1621
+ constructor(props: CurrentSourceCommandProps);
1622
+ toSpiceString(): string;
1623
+ }
1624
+
1625
+ interface DiodeCommandProps {
1626
+ name: string;
1627
+ positiveNode: string;
1628
+ negativeNode: string;
1629
+ model: string;
1630
+ area?: string;
1631
+ }
1632
+ declare class DiodeCommand implements BaseSpiceCommand {
1633
+ commandName: "diode";
1634
+ props: DiodeCommandProps;
1635
+ constructor(props: DiodeCommandProps);
1636
+ toSpiceString(): string;
1637
+ }
1638
+
1639
+ interface InductorCommandProps {
1640
+ name: string;
1641
+ positiveNode: string;
1642
+ negativeNode: string;
1643
+ model?: string;
1644
+ value: string;
1645
+ initialCondition?: string;
1646
+ }
1647
+ declare class InductorCommand implements BaseSpiceCommand {
1648
+ commandName: "inductor";
1649
+ props: InductorCommandProps;
1650
+ constructor(props: InductorCommandProps);
1651
+ toSpiceString(): string;
1652
+ }
1653
+
1654
+ interface InductorCouplingCommandProps {
1655
+ name: string;
1656
+ inductors: string[];
1657
+ coupling: string;
1658
+ }
1659
+ declare class InductorCouplingCommand implements BaseSpiceCommand {
1660
+ commandName: "inductor_coupling";
1661
+ props: InductorCouplingCommandProps;
1662
+ constructor(props: InductorCouplingCommandProps);
1663
+ toSpiceString(): string;
1664
+ }
1665
+
1666
+ interface JFETCommandProps {
1667
+ name: string;
1668
+ drain: string;
1669
+ gate: string;
1670
+ source: string;
1671
+ model: string;
1672
+ area?: string;
1673
+ }
1674
+ declare class JFETCommand implements BaseSpiceCommand {
1675
+ commandName: "jfet";
1676
+ props: JFETCommandProps;
1677
+ constructor(props: JFETCommandProps);
1678
+ toSpiceString(): string;
1679
+ }
1680
+
1681
+ interface MOSFETCommandProps {
1682
+ name: string;
1683
+ drain: string;
1684
+ gate: string;
1685
+ source: string;
1686
+ substrate: string;
1687
+ model: string;
1688
+ length?: string;
1689
+ width?: string;
1690
+ drainArea?: string;
1691
+ sourceArea?: string;
1692
+ drainPerimeter?: string;
1693
+ sourcePerimeter?: string;
1694
+ drainResistance?: string;
1695
+ sourceResistance?: string;
1696
+ }
1697
+ declare class MOSFETCommand implements BaseSpiceCommand {
1698
+ commandName: "mosfet";
1699
+ props: MOSFETCommandProps;
1700
+ constructor(props: MOSFETCommandProps);
1701
+ toSpiceString(): string;
1702
+ }
1703
+
1704
+ interface ResistorCommandProps {
1705
+ name: string;
1706
+ positiveNode: string;
1707
+ negativeNode: string;
1708
+ model?: string;
1709
+ value: string;
1710
+ }
1711
+ declare class ResistorCommand implements BaseSpiceCommand {
1712
+ commandName: "resistor";
1713
+ props: ResistorCommandProps;
1714
+ constructor(props: ResistorCommandProps);
1715
+ toSpiceString(): string;
1716
+ }
1717
+
1718
+ interface SubcircuitCallCommandProps {
1719
+ name: string;
1720
+ nodes: string[];
1721
+ subcircuitName: string;
1722
+ }
1723
+ declare class SubcircuitCallCommand implements BaseSpiceCommand {
1724
+ commandName: "subcircuit_call";
1725
+ props: SubcircuitCallCommandProps;
1726
+ constructor(props: SubcircuitCallCommandProps);
1727
+ toSpiceString(): string;
1728
+ }
1729
+
1730
+ interface TransmissionLineCommandProps {
1731
+ name: string;
1732
+ aPositive: string;
1733
+ aNegative: string;
1734
+ bPositive: string;
1735
+ bNegative: string;
1736
+ impedance: string;
1737
+ delay?: string;
1738
+ frequency?: string;
1739
+ normalizedLength?: string;
1740
+ }
1741
+ declare class TransmissionLineCommand implements BaseSpiceCommand {
1742
+ commandName: "transmission_line";
1743
+ props: TransmissionLineCommandProps;
1744
+ constructor(props: TransmissionLineCommandProps);
1745
+ toSpiceString(): string;
1746
+ }
1747
+
1748
+ interface VoltageControlledSwitchCommandProps {
1749
+ name: string;
1750
+ positiveNode: string;
1751
+ negativeNode: string;
1752
+ positiveControl: string;
1753
+ negativeControl: string;
1754
+ model: string;
1755
+ }
1756
+ declare class VoltageControlledSwitchCommand implements BaseSpiceCommand {
1757
+ commandName: "voltage_controlled_switch";
1758
+ props: VoltageControlledSwitchCommandProps;
1759
+ constructor(props: VoltageControlledSwitchCommandProps);
1760
+ toSpiceString(): string;
1761
+ }
1762
+
1763
+ interface VoltageSourceCommandProps {
1764
+ name: string;
1765
+ positiveNode: string;
1766
+ negativeNode: string;
1767
+ value?: string;
1768
+ acMagnitude?: string;
1769
+ acPhase?: string;
1770
+ }
1771
+ declare class VoltageSourceCommand implements BaseSpiceCommand {
1772
+ commandName: "voltage_source";
1773
+ props: VoltageSourceCommandProps;
1774
+ constructor(props: VoltageSourceCommandProps);
1775
+ toSpiceString(): string;
1776
+ }
1777
+
1778
+ type CircuitJsonToSpiceModule_BJTCommand = BJTCommand;
1779
+ declare const CircuitJsonToSpiceModule_BJTCommand: typeof BJTCommand;
1780
+ type CircuitJsonToSpiceModule_BJTCommandProps = BJTCommandProps;
1781
+ type CircuitJsonToSpiceModule_BaseSpiceCommand = BaseSpiceCommand;
1782
+ type CircuitJsonToSpiceModule_CapacitorCommand = CapacitorCommand;
1783
+ declare const CircuitJsonToSpiceModule_CapacitorCommand: typeof CapacitorCommand;
1784
+ type CircuitJsonToSpiceModule_CapacitorCommandProps = CapacitorCommandProps;
1785
+ type CircuitJsonToSpiceModule_CurrentSourceCommand = CurrentSourceCommand;
1786
+ declare const CircuitJsonToSpiceModule_CurrentSourceCommand: typeof CurrentSourceCommand;
1787
+ type CircuitJsonToSpiceModule_CurrentSourceCommandProps = CurrentSourceCommandProps;
1788
+ type CircuitJsonToSpiceModule_DiodeCommand = DiodeCommand;
1789
+ declare const CircuitJsonToSpiceModule_DiodeCommand: typeof DiodeCommand;
1790
+ type CircuitJsonToSpiceModule_DiodeCommandProps = DiodeCommandProps;
1791
+ type CircuitJsonToSpiceModule_InductorCommand = InductorCommand;
1792
+ declare const CircuitJsonToSpiceModule_InductorCommand: typeof InductorCommand;
1793
+ type CircuitJsonToSpiceModule_InductorCommandProps = InductorCommandProps;
1794
+ type CircuitJsonToSpiceModule_InductorCouplingCommand = InductorCouplingCommand;
1795
+ declare const CircuitJsonToSpiceModule_InductorCouplingCommand: typeof InductorCouplingCommand;
1796
+ type CircuitJsonToSpiceModule_InductorCouplingCommandProps = InductorCouplingCommandProps;
1797
+ type CircuitJsonToSpiceModule_JFETCommand = JFETCommand;
1798
+ declare const CircuitJsonToSpiceModule_JFETCommand: typeof JFETCommand;
1799
+ type CircuitJsonToSpiceModule_JFETCommandProps = JFETCommandProps;
1800
+ type CircuitJsonToSpiceModule_MOSFETCommand = MOSFETCommand;
1801
+ declare const CircuitJsonToSpiceModule_MOSFETCommand: typeof MOSFETCommand;
1802
+ type CircuitJsonToSpiceModule_MOSFETCommandProps = MOSFETCommandProps;
1803
+ type CircuitJsonToSpiceModule_ResistorCommand = ResistorCommand;
1804
+ declare const CircuitJsonToSpiceModule_ResistorCommand: typeof ResistorCommand;
1805
+ type CircuitJsonToSpiceModule_ResistorCommandProps = ResistorCommandProps;
1806
+ type CircuitJsonToSpiceModule_SpiceComponent = SpiceComponent;
1807
+ declare const CircuitJsonToSpiceModule_SpiceComponent: typeof SpiceComponent;
1808
+ type CircuitJsonToSpiceModule_SpiceNetlist = SpiceNetlist;
1809
+ declare const CircuitJsonToSpiceModule_SpiceNetlist: typeof SpiceNetlist;
1810
+ type CircuitJsonToSpiceModule_SpiceSubcircuit = SpiceSubcircuit;
1811
+ declare const CircuitJsonToSpiceModule_SpiceSubcircuit: typeof SpiceSubcircuit;
1812
+ type CircuitJsonToSpiceModule_SubcircuitCallCommand = SubcircuitCallCommand;
1813
+ declare const CircuitJsonToSpiceModule_SubcircuitCallCommand: typeof SubcircuitCallCommand;
1814
+ type CircuitJsonToSpiceModule_SubcircuitCallCommandProps = SubcircuitCallCommandProps;
1815
+ type CircuitJsonToSpiceModule_TransmissionLineCommand = TransmissionLineCommand;
1816
+ declare const CircuitJsonToSpiceModule_TransmissionLineCommand: typeof TransmissionLineCommand;
1817
+ type CircuitJsonToSpiceModule_TransmissionLineCommandProps = TransmissionLineCommandProps;
1818
+ type CircuitJsonToSpiceModule_VoltageControlledSwitchCommand = VoltageControlledSwitchCommand;
1819
+ declare const CircuitJsonToSpiceModule_VoltageControlledSwitchCommand: typeof VoltageControlledSwitchCommand;
1820
+ type CircuitJsonToSpiceModule_VoltageControlledSwitchCommandProps = VoltageControlledSwitchCommandProps;
1821
+ type CircuitJsonToSpiceModule_VoltageSourceCommand = VoltageSourceCommand;
1822
+ declare const CircuitJsonToSpiceModule_VoltageSourceCommand: typeof VoltageSourceCommand;
1823
+ type CircuitJsonToSpiceModule_VoltageSourceCommandProps = VoltageSourceCommandProps;
1824
+ declare const CircuitJsonToSpiceModule_circuitJsonToSpice: typeof circuitJsonToSpice;
1825
+ declare const CircuitJsonToSpiceModule_convertSpiceNetlistToString: typeof convertSpiceNetlistToString;
1826
+ declare namespace CircuitJsonToSpiceModule {
1827
+ export { CircuitJsonToSpiceModule_BJTCommand as BJTCommand, type CircuitJsonToSpiceModule_BJTCommandProps as BJTCommandProps, type CircuitJsonToSpiceModule_BaseSpiceCommand as BaseSpiceCommand, CircuitJsonToSpiceModule_CapacitorCommand as CapacitorCommand, type CircuitJsonToSpiceModule_CapacitorCommandProps as CapacitorCommandProps, CircuitJsonToSpiceModule_CurrentSourceCommand as CurrentSourceCommand, type CircuitJsonToSpiceModule_CurrentSourceCommandProps as CurrentSourceCommandProps, CircuitJsonToSpiceModule_DiodeCommand as DiodeCommand, type CircuitJsonToSpiceModule_DiodeCommandProps as DiodeCommandProps, CircuitJsonToSpiceModule_InductorCommand as InductorCommand, type CircuitJsonToSpiceModule_InductorCommandProps as InductorCommandProps, CircuitJsonToSpiceModule_InductorCouplingCommand as InductorCouplingCommand, type CircuitJsonToSpiceModule_InductorCouplingCommandProps as InductorCouplingCommandProps, CircuitJsonToSpiceModule_JFETCommand as JFETCommand, type CircuitJsonToSpiceModule_JFETCommandProps as JFETCommandProps, CircuitJsonToSpiceModule_MOSFETCommand as MOSFETCommand, type CircuitJsonToSpiceModule_MOSFETCommandProps as MOSFETCommandProps, CircuitJsonToSpiceModule_ResistorCommand as ResistorCommand, type CircuitJsonToSpiceModule_ResistorCommandProps as ResistorCommandProps, CircuitJsonToSpiceModule_SpiceComponent as SpiceComponent, CircuitJsonToSpiceModule_SpiceNetlist as SpiceNetlist, CircuitJsonToSpiceModule_SpiceSubcircuit as SpiceSubcircuit, CircuitJsonToSpiceModule_SubcircuitCallCommand as SubcircuitCallCommand, type CircuitJsonToSpiceModule_SubcircuitCallCommandProps as SubcircuitCallCommandProps, CircuitJsonToSpiceModule_TransmissionLineCommand as TransmissionLineCommand, type CircuitJsonToSpiceModule_TransmissionLineCommandProps as TransmissionLineCommandProps, CircuitJsonToSpiceModule_VoltageControlledSwitchCommand as VoltageControlledSwitchCommand, type CircuitJsonToSpiceModule_VoltageControlledSwitchCommandProps as VoltageControlledSwitchCommandProps, CircuitJsonToSpiceModule_VoltageSourceCommand as VoltageSourceCommand, type CircuitJsonToSpiceModule_VoltageSourceCommandProps as VoltageSourceCommandProps, CircuitJsonToSpiceModule_circuitJsonToSpice as circuitJsonToSpice, CircuitJsonToSpiceModule_convertSpiceNetlistToString as convertSpiceNetlistToString };
1828
+ }
1829
+
1830
+ interface CircuitJsonToStepOptions {
1831
+ /** Board width in mm (optional if pcb_board is present) */
1832
+ boardWidth?: number;
1833
+ /** Board height in mm (optional if pcb_board is present) */
1834
+ boardHeight?: number;
1835
+ /** Board thickness in mm (default: 1.6mm or from pcb_board) */
1836
+ boardThickness?: number;
1837
+ /** Product name (default: "PCB") */
1838
+ productName?: string;
1839
+ /** Include component meshes (default: false) */
1840
+ includeComponents?: boolean;
1841
+ /** Include external model meshes from model_*_url fields (default: false). Only applicable when includeComponents is true. */
1842
+ includeExternalMeshes?: boolean;
1843
+ /**
1844
+ * Pre-loaded STEP file contents, keyed by URL/path.
1845
+ * If a URL is found here, the content is used directly instead of fetching.
1846
+ * Useful for tests that need to load local files.
1847
+ */
1848
+ fsMap?: Record<string, string>;
1849
+ }
1850
+ /**
1851
+ * Converts circuit JSON to STEP format, creating holes in a PCB board
1852
+ */
1853
+ declare function circuitJsonToStep(circuitJson: CircuitJson, options?: CircuitJsonToStepOptions): Promise<string>;
1854
+
1855
+ type CircuitJsonToStepModule_CircuitJsonToStepOptions = CircuitJsonToStepOptions;
1856
+ declare const CircuitJsonToStepModule_circuitJsonToStep: typeof circuitJsonToStep;
1857
+ declare namespace CircuitJsonToStepModule {
1858
+ export { type CircuitJsonToStepModule_CircuitJsonToStepOptions as CircuitJsonToStepOptions, CircuitJsonToStepModule_circuitJsonToStep as circuitJsonToStep };
1859
+ }
1860
+
1861
+ interface ComponentTemplateParams {
1862
+ pinLabels?: Record<string, string[]> | Record<string, string>;
1863
+ componentName: string;
1864
+ objUrl?: string;
1865
+ circuitJson: AnyCircuitElement[];
1866
+ supplierPartNumbers?: Record<string, string[]>;
1867
+ manufacturerPartNumber?: string;
1868
+ }
1869
+
1870
+ declare const convertCircuitJsonToTscircuit: (circuitJson: CircuitJson, opts: Omit<ComponentTemplateParams, "circuitJson">) => string;
1871
+
1872
+ declare const CircuitJsonToTscircuitModule_convertCircuitJsonToTscircuit: typeof convertCircuitJsonToTscircuit;
1873
+ declare namespace CircuitJsonToTscircuitModule {
1874
+ export { CircuitJsonToTscircuitModule_convertCircuitJsonToTscircuit as convertCircuitJsonToTscircuit };
1875
+ }
1876
+
1877
+ /**
1878
+ * Canvas context type that works with both browser and node-canvas.
1879
+ * Uses a subset of CanvasRenderingContext2D methods that are common to both.
1880
+ */
1881
+ interface CanvasContext {
1882
+ beginPath(): void;
1883
+ closePath(): void;
1884
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
1885
+ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
1886
+ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number): void;
1887
+ fill(fillRule?: "nonzero" | "evenodd"): void;
1888
+ stroke(): void;
1889
+ rect(x: number, y: number, w: number, h: number): void;
1890
+ lineTo(x: number, y: number): void;
1891
+ moveTo(x: number, y: number): void;
1892
+ save(): void;
1893
+ restore(): void;
1894
+ clip(): void;
1895
+ translate(x: number, y: number): void;
1896
+ rotate(angle: number): void;
1897
+ scale(x: number, y: number): void;
1898
+ globalCompositeOperation?: string;
1899
+ fillStyle: string | CanvasGradient | CanvasPattern;
1900
+ strokeStyle: string | CanvasGradient | CanvasPattern;
1901
+ globalAlpha: number;
1902
+ lineWidth: number;
1903
+ lineCap: "butt" | "round" | "square";
1904
+ lineJoin: "bevel" | "round" | "miter";
1905
+ setLineDash(segments: number[]): void;
1906
+ canvas: {
1907
+ width: number;
1908
+ height: number;
1909
+ };
1910
+ fillText(text: string, x: number, y: number): void;
1911
+ fillRect(x: number, y: number, width: number, height: number): void;
1912
+ measureText?: (text: string) => {
1913
+ width: number;
1914
+ actualBoundingBoxAscent?: number;
1915
+ actualBoundingBoxDescent?: number;
1916
+ };
1917
+ font: string;
1918
+ textAlign: "start" | "end" | "left" | "right" | "center";
1919
+ }
1920
+ type CopperLayerName$1 = "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
1921
+ type CopperColorMap$1 = Record<CopperLayerName$1, string> & {
1922
+ [layer: string]: string;
1923
+ };
1924
+ interface PcbColorMap$1 {
1925
+ copper: CopperColorMap$1;
1926
+ copperPour: {
1927
+ top: string;
1928
+ bottom: string;
1929
+ };
1930
+ drill: string;
1931
+ silkscreen: {
1932
+ top: string;
1933
+ bottom: string;
1934
+ };
1935
+ boardOutline: string;
1936
+ soldermask: {
1937
+ top: string;
1938
+ bottom: string;
1939
+ };
1940
+ soldermaskWithCopperUnderneath: {
1941
+ top: string;
1942
+ bottom: string;
1943
+ };
1944
+ soldermaskOverCopper: {
1945
+ top: string;
1946
+ bottom: string;
1947
+ };
1948
+ substrate: string;
1949
+ courtyard: {
1950
+ top: string;
1951
+ bottom: string;
1952
+ };
1953
+ keepout: string;
1954
+ fabricationNote: string;
1955
+ }
1956
+ declare const DEFAULT_PCB_COLOR_MAP: PcbColorMap$1;
1957
+ interface DrawerConfig {
1958
+ colorOverrides?: Partial<PcbColorMap$1>;
1959
+ }
1960
+ interface CameraBounds {
1961
+ minX: number;
1962
+ maxX: number;
1963
+ minY: number;
1964
+ maxY: number;
1965
+ }
1966
+ interface DrawContext {
1967
+ ctx: CanvasRenderingContext2D;
1968
+ realToCanvasMat: Matrix;
1969
+ colorMap: PcbColorMap$1;
1970
+ }
1971
+
1972
+ interface DrawElementsOptions {
1973
+ layers?: PcbRenderLayer[];
1974
+ /** Whether to render the soldermask layer. Defaults to false. */
1975
+ drawSoldermask?: boolean;
1976
+ /** Render top soldermask layer when drawSoldermask is enabled. Defaults to true if both layer flags are unset. */
1977
+ drawSoldermaskTop?: boolean;
1978
+ /** Render bottom soldermask layer when drawSoldermask is enabled. */
1979
+ drawSoldermaskBottom?: boolean;
1980
+ /** Whether to render the board material (substrate fill). Defaults to false. */
1981
+ drawBoardMaterial?: boolean;
1982
+ /** Minimum on-screen outline stroke width for pcb_board only. */
1983
+ minBoardOutlineStrokePx?: number;
1984
+ /** Whether to render pcb_note elements. Defaults to true. */
1985
+ showPcbNotes?: boolean;
1986
+ }
1987
+ interface CanvasLike {
1988
+ getContext(contextId: "2d"): CanvasContext | null;
1989
+ }
1990
+ declare class CircuitToCanvasDrawer {
1991
+ private ctx;
1992
+ private colorMap;
1993
+ realToCanvasMat: Matrix;
1994
+ constructor(canvasOrContext: CanvasLike | CanvasContext);
1995
+ configure(config: DrawerConfig): void;
1996
+ setCameraBounds(bounds: CameraBounds): void;
1997
+ drawElements(elements: AnyCircuitElement[], options?: DrawElementsOptions): void;
1998
+ }
1999
+
2000
+ interface DrawCircleParams {
2001
+ ctx: CanvasContext;
2002
+ center: {
2003
+ x: number;
2004
+ y: number;
2005
+ };
2006
+ radius: number;
2007
+ fill?: string;
2008
+ realToCanvasMat: Matrix;
2009
+ stroke?: string;
2010
+ strokeWidth?: number;
2011
+ isStrokeDashed?: boolean;
2012
+ }
2013
+ declare function drawCircle(params: DrawCircleParams): void;
2014
+
2015
+ interface DrawRectParams {
2016
+ ctx: CanvasContext;
2017
+ center: {
2018
+ x: number;
2019
+ y: number;
2020
+ };
2021
+ width: number;
2022
+ height: number;
2023
+ fill?: string;
2024
+ realToCanvasMat: Matrix;
2025
+ borderRadius?: number;
2026
+ ccwRotationDegrees?: number;
2027
+ stroke?: string;
2028
+ strokeWidth?: number;
2029
+ isStrokeDashed?: boolean;
2030
+ }
2031
+ declare function drawRect(params: DrawRectParams): void;
2032
+
2033
+ interface DrawOvalParams {
2034
+ ctx: CanvasContext;
2035
+ center: {
2036
+ x: number;
2037
+ y: number;
2038
+ };
2039
+ radius_x: number;
2040
+ radius_y: number;
2041
+ fill?: string;
2042
+ stroke?: string;
2043
+ strokeWidth?: number;
2044
+ realToCanvasMat: Matrix;
2045
+ rotation?: number;
2046
+ }
2047
+ declare function drawOval(params: DrawOvalParams): void;
2048
+
2049
+ interface DrawPillParams {
2050
+ ctx: CanvasContext;
2051
+ center: {
2052
+ x: number;
2053
+ y: number;
2054
+ };
2055
+ width: number;
2056
+ height: number;
2057
+ fill?: string;
2058
+ realToCanvasMat: Matrix;
2059
+ rotation?: number;
2060
+ stroke?: string;
2061
+ strokeWidth?: number;
2062
+ }
2063
+ declare function drawPill(params: DrawPillParams): void;
2064
+
2065
+ interface DrawPolygonParams {
2066
+ ctx: CanvasContext;
2067
+ points: Array<{
2068
+ x: number;
2069
+ y: number;
2070
+ }>;
2071
+ fill: string;
2072
+ realToCanvasMat: Matrix;
2073
+ }
2074
+ declare function drawPolygon(params: DrawPolygonParams): void;
2075
+
2076
+ interface DrawLineParams {
2077
+ ctx: CanvasContext;
2078
+ start: {
2079
+ x: number;
2080
+ y: number;
2081
+ };
2082
+ end: {
2083
+ x: number;
2084
+ y: number;
2085
+ };
2086
+ strokeWidth: number;
2087
+ stroke: string;
2088
+ realToCanvasMat: Matrix;
2089
+ lineCap?: "butt" | "round" | "square";
2090
+ }
2091
+ declare function drawLine(params: DrawLineParams): void;
2092
+
2093
+ interface DrawPathParams {
2094
+ ctx: CanvasContext;
2095
+ points: Array<{
2096
+ x: number;
2097
+ y: number;
2098
+ }>;
2099
+ fill?: string;
2100
+ stroke?: string;
2101
+ strokeWidth?: number;
2102
+ minStrokePx?: number;
2103
+ realToCanvasMat: Matrix;
2104
+ closePath?: boolean;
2105
+ }
2106
+ declare function drawPath(params: DrawPathParams): void;
2107
+
2108
+ interface DrawArrowParams {
2109
+ ctx: CanvasContext;
2110
+ x: number;
2111
+ y: number;
2112
+ angle: number;
2113
+ arrowSize: number;
2114
+ color: string;
2115
+ strokeWidth: number;
2116
+ }
2117
+ /**
2118
+ * Draw an arrow at a point along a line
2119
+ */
2120
+ declare function drawArrow(params: DrawArrowParams): void;
2121
+
2122
+ interface DrawDimensionLineParams {
2123
+ ctx: CanvasContext;
2124
+ from: {
2125
+ x: number;
2126
+ y: number;
2127
+ };
2128
+ to: {
2129
+ x: number;
2130
+ y: number;
2131
+ };
2132
+ realToCanvasMat: Matrix;
2133
+ color: string;
2134
+ fontSize: number;
2135
+ arrowSize?: number;
2136
+ strokeWidth?: number;
2137
+ text?: string;
2138
+ textRotation?: number;
2139
+ offset?: {
2140
+ distance: number;
2141
+ direction: {
2142
+ x: number;
2143
+ y: number;
2144
+ };
2145
+ };
2146
+ }
2147
+ declare function drawDimensionLine(params: DrawDimensionLineParams): void;
2148
+
2149
+ type AlphabetLayout = {
2150
+ width: number;
2151
+ height: number;
2152
+ glyphWidth: number;
2153
+ letterSpacing: number;
2154
+ spaceWidth: number;
2155
+ strokeWidth: number;
2156
+ lineHeight: number;
2157
+ lines: string[];
2158
+ lineWidths: number[];
2159
+ };
2160
+ declare function getAlphabetLayout(text: string, fontSize: number): AlphabetLayout;
2161
+
2162
+ interface StrokeAlphabetTextParams {
2163
+ ctx: CanvasContext;
2164
+ text: string;
2165
+ fontSize: number;
2166
+ startX: number;
2167
+ startY: number;
2168
+ anchorAlignment?: NinePointAnchor;
2169
+ }
2170
+ declare function strokeAlphabetText(params: StrokeAlphabetTextParams): void;
2171
+ interface DrawTextParams {
2172
+ ctx: CanvasContext;
2173
+ text: string;
2174
+ x: number;
2175
+ y: number;
2176
+ fontSize: number;
2177
+ color: string;
2178
+ realToCanvasMat: Matrix;
2179
+ anchorAlignment: NinePointAnchor;
2180
+ rotation?: number;
2181
+ mirrorX?: boolean;
2182
+ knockout?: boolean;
2183
+ knockoutPadding?: {
2184
+ top?: number;
2185
+ bottom?: number;
2186
+ left?: number;
2187
+ right?: number;
2188
+ };
2189
+ }
2190
+ declare function drawText(params: DrawTextParams): void;
2191
+
2192
+ type AnchorAlignment = NinePointAnchor;
2193
+ declare function getTextStartPosition(alignment: NinePointAnchor, layout: AlphabetLayout): {
2194
+ x: number;
2195
+ y: number;
2196
+ };
2197
+
2198
+ interface DrawPcbPlatedHoleParams {
2199
+ ctx: CanvasContext;
2200
+ hole: PcbPlatedHole;
2201
+ realToCanvasMat: Matrix;
2202
+ colorMap: PcbColorMap$1;
2203
+ soldermaskMargin?: number;
2204
+ drawSoldermask?: boolean;
2205
+ layer?: "top" | "bottom";
2206
+ }
2207
+ declare function drawPcbPlatedHole(params: DrawPcbPlatedHoleParams): void;
2208
+
2209
+ interface DrawPcbViaParams {
2210
+ ctx: CanvasContext;
2211
+ via: PCBVia;
2212
+ realToCanvasMat: Matrix;
2213
+ colorMap: PcbColorMap$1;
2214
+ layer?: "top" | "bottom";
2215
+ }
2216
+ declare function drawPcbVia(params: DrawPcbViaParams): void;
2217
+
2218
+ interface DrawPcbHoleParams {
2219
+ ctx: CanvasContext;
2220
+ hole: PcbHole;
2221
+ realToCanvasMat: Matrix;
2222
+ colorMap: PcbColorMap$1;
2223
+ soldermaskMargin?: number;
2224
+ drawSoldermask?: boolean;
2225
+ }
2226
+ declare function drawPcbHole(params: DrawPcbHoleParams): void;
2227
+
2228
+ interface DrawPcbSmtPadParams {
2229
+ ctx: CanvasContext;
2230
+ pad: PcbSmtPad;
2231
+ realToCanvasMat: Matrix;
2232
+ colorMap: PcbColorMap$1;
2233
+ }
2234
+ declare function drawPcbSmtPad(params: DrawPcbSmtPadParams): void;
2235
+
2236
+ /**
2237
+ * Draws a soldermask ring for rectangular shapes with negative margin
2238
+ * (soldermask appears inside the pad boundary)
2239
+ */
2240
+ declare function drawSoldermaskRingForRect(ctx: CanvasContext, center: {
2241
+ x: number;
2242
+ y: number;
2243
+ }, width: number, height: number, margin: number, borderRadius: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string, asymmetricMargins?: {
2244
+ left: number;
2245
+ right: number;
2246
+ top: number;
2247
+ bottom: number;
2248
+ }): void;
2249
+ /**
2250
+ * Draws a soldermask ring for circular shapes with negative margin
2251
+ * (soldermask appears inside the pad boundary)
2252
+ */
2253
+ declare function drawSoldermaskRingForCircle(ctx: CanvasContext, center: {
2254
+ x: number;
2255
+ y: number;
2256
+ }, radius: number, margin: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
2257
+ /**
2258
+ * Draws a soldermask ring for pill shapes with negative margin
2259
+ * (soldermask appears inside the pad boundary)
2260
+ */
2261
+ declare function drawSoldermaskRingForPill(ctx: CanvasContext, center: {
2262
+ x: number;
2263
+ y: number;
2264
+ }, width: number, height: number, margin: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
2265
+ /**
2266
+ * Draws a soldermask ring for oval shapes with negative margin
2267
+ * (soldermask appears inside the hole boundary)
2268
+ */
2269
+ declare function drawSoldermaskRingForOval(ctx: CanvasContext, center: {
2270
+ x: number;
2271
+ y: number;
2272
+ }, radius_x: number, radius_y: number, margin: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, holeColor: string): void;
2273
+
2274
+ interface DrawPcbTraceParams {
2275
+ ctx: CanvasContext;
2276
+ trace: PcbTrace;
2277
+ realToCanvasMat: Matrix;
2278
+ colorMap: PcbColorMap$1;
2279
+ vias?: PcbVia[];
2280
+ platedHoles?: PcbPlatedHole[];
2281
+ }
2282
+ declare function drawPcbTrace(params: DrawPcbTraceParams): void;
2283
+
2284
+ interface DrawPcbBoardParams {
2285
+ ctx: CanvasContext;
2286
+ board: PcbBoard;
2287
+ realToCanvasMat: Matrix;
2288
+ colorMap: PcbColorMap$1;
2289
+ drawBoardMaterial: boolean;
2290
+ minBoardOutlineStrokePx?: number;
2291
+ }
2292
+ declare function drawPcbBoard(params: DrawPcbBoardParams): void;
2293
+
2294
+ interface DrawPcbPanelParams {
2295
+ ctx: CanvasContext;
2296
+ panel: PcbPanel;
2297
+ realToCanvasMat: Matrix;
2298
+ colorMap: PcbColorMap$1;
2299
+ drawBoardMaterial: boolean;
2300
+ }
2301
+ declare function drawPcbPanelElement(params: DrawPcbPanelParams): void;
2302
+
2303
+ interface DrawPcbSilkscreenTextParams {
2304
+ ctx: CanvasContext;
2305
+ text: PcbSilkscreenText;
2306
+ realToCanvasMat: Matrix;
2307
+ colorMap: PcbColorMap$1;
2308
+ }
2309
+ declare function drawPcbSilkscreenText(params: DrawPcbSilkscreenTextParams): void;
2310
+
2311
+ interface DrawPcbSilkscreenRectParams {
2312
+ ctx: CanvasContext;
2313
+ rect: PcbSilkscreenRect;
2314
+ realToCanvasMat: Matrix;
2315
+ colorMap: PcbColorMap$1;
2316
+ }
2317
+ declare function drawPcbSilkscreenRect(params: DrawPcbSilkscreenRectParams): void;
2318
+
2319
+ interface DrawPcbSilkscreenCircleParams {
2320
+ ctx: CanvasContext;
2321
+ circle: PcbSilkscreenCircle;
2322
+ realToCanvasMat: Matrix;
2323
+ colorMap: PcbColorMap$1;
2324
+ }
2325
+ declare function drawPcbSilkscreenCircle(params: DrawPcbSilkscreenCircleParams): void;
2326
+
2327
+ interface DrawPcbSilkscreenLineParams {
2328
+ ctx: CanvasContext;
2329
+ line: PcbSilkscreenLine;
2330
+ realToCanvasMat: Matrix;
2331
+ colorMap: PcbColorMap$1;
2332
+ }
2333
+ declare function drawPcbSilkscreenLine(params: DrawPcbSilkscreenLineParams): void;
2334
+
2335
+ interface DrawPcbSilkscreenPathParams {
2336
+ ctx: CanvasContext;
2337
+ path: PcbSilkscreenPath;
2338
+ realToCanvasMat: Matrix;
2339
+ colorMap: PcbColorMap$1;
2340
+ }
2341
+ declare function drawPcbSilkscreenPath(params: DrawPcbSilkscreenPathParams): void;
2342
+
2343
+ interface DrawPcbSilkscreenPillParams {
2344
+ ctx: CanvasContext;
2345
+ pill: PcbSilkscreenPill;
2346
+ realToCanvasMat: Matrix;
2347
+ colorMap: PcbColorMap$1;
2348
+ }
2349
+ declare function drawPcbSilkscreenPill(params: DrawPcbSilkscreenPillParams): void;
2350
+
2351
+ interface DrawPcbSilkscreenOvalParams {
2352
+ ctx: CanvasContext;
2353
+ oval: PcbSilkscreenOval;
2354
+ realToCanvasMat: Matrix;
2355
+ colorMap: PcbColorMap$1;
2356
+ }
2357
+ declare function drawPcbSilkscreenOval(params: DrawPcbSilkscreenOvalParams): void;
2358
+
2359
+ interface DrawPcbCutoutParams {
2360
+ ctx: CanvasContext;
2361
+ cutout: PcbCutout;
2362
+ realToCanvasMat: Matrix;
2363
+ colorMap: PcbColorMap$1;
2364
+ }
2365
+ declare function drawPcbCutout(params: DrawPcbCutoutParams): void;
2366
+
2367
+ interface DrawPcbKeepoutParams {
2368
+ ctx: CanvasContext;
2369
+ keepout: PCBKeepout;
2370
+ realToCanvasMat: Matrix;
2371
+ colorMap: PcbColorMap$1;
2372
+ }
2373
+ declare function drawPcbKeepout(params: DrawPcbKeepoutParams): void;
2374
+
2375
+ interface DrawPcbCopperPourParams {
2376
+ ctx: CanvasContext;
2377
+ pour: PcbCopperPour;
2378
+ realToCanvasMat: Matrix;
2379
+ colorMap: PcbColorMap$1;
2380
+ }
2381
+ declare function drawPcbCopperPour(params: DrawPcbCopperPourParams): void;
2382
+
2383
+ interface DrawPcbCopperTextParams {
2384
+ ctx: CanvasContext;
2385
+ text: PcbCopperText;
2386
+ realToCanvasMat: Matrix;
2387
+ colorMap: PcbColorMap$1;
2388
+ }
2389
+ declare function drawPcbCopperText(params: DrawPcbCopperTextParams): void;
2390
+
2391
+ interface DrawPcbFabricationNoteTextParams {
2392
+ ctx: CanvasContext;
2393
+ text: PcbFabricationNoteText;
2394
+ realToCanvasMat: Matrix;
2395
+ colorMap: PcbColorMap$1;
2396
+ }
2397
+ declare function drawPcbFabricationNoteText(params: DrawPcbFabricationNoteTextParams): void;
2398
+
2399
+ interface DrawPcbFabricationNoteRectParams {
2400
+ ctx: CanvasContext;
2401
+ rect: PcbFabricationNoteRect;
2402
+ realToCanvasMat: Matrix;
2403
+ colorMap: PcbColorMap$1;
2404
+ }
2405
+ declare function drawPcbFabricationNoteRect(params: DrawPcbFabricationNoteRectParams): void;
2406
+
2407
+ interface DrawPcbNoteRectParams {
2408
+ ctx: CanvasContext;
2409
+ rect: PcbNoteRect;
2410
+ realToCanvasMat: Matrix;
2411
+ colorMap: PcbColorMap$1;
2412
+ }
2413
+ declare function drawPcbNoteRect(params: DrawPcbNoteRectParams): void;
2414
+
2415
+ interface DrawPcbFabricationNotePathParams {
2416
+ ctx: CanvasContext;
2417
+ path: PcbFabricationNotePath;
2418
+ realToCanvasMat: Matrix;
2419
+ colorMap: PcbColorMap$1;
2420
+ }
2421
+ declare function drawPcbFabricationNotePath(params: DrawPcbFabricationNotePathParams): void;
2422
+
2423
+ interface DrawPcbNotePathParams {
2424
+ ctx: CanvasContext;
2425
+ path: PcbNotePath;
2426
+ realToCanvasMat: Matrix;
2427
+ colorMap: PcbColorMap$1;
2428
+ }
2429
+ declare function drawPcbNotePath(params: DrawPcbNotePathParams): void;
2430
+
2431
+ interface DrawPcbNoteTextParams {
2432
+ ctx: CanvasContext;
2433
+ text: PcbNoteText;
2434
+ realToCanvasMat: Matrix;
2435
+ colorMap: PcbColorMap$1;
2436
+ }
2437
+ declare function drawPcbNoteText(params: DrawPcbNoteTextParams): void;
2438
+
2439
+ interface DrawPcbNoteDimensionParams {
2440
+ ctx: CanvasContext;
2441
+ pcbNoteDimension: PcbNoteDimension;
2442
+ realToCanvasMat: Matrix;
2443
+ colorMap: PcbColorMap$1;
2444
+ }
2445
+ declare function drawPcbNoteDimension(params: DrawPcbNoteDimensionParams): void;
2446
+
2447
+ interface DrawPcbFabricationNoteDimensionParams {
2448
+ ctx: CanvasContext;
2449
+ pcbFabricationNoteDimension: PcbFabricationNoteDimension;
2450
+ realToCanvasMat: Matrix;
2451
+ colorMap: PcbColorMap$1;
2452
+ }
2453
+ declare function drawPcbFabricationNoteDimension(params: DrawPcbFabricationNoteDimensionParams): void;
2454
+
2455
+ interface DrawPcbCourtyardCircleParams {
2456
+ ctx: CanvasContext;
2457
+ circle: PcbCourtyardCircle;
2458
+ realToCanvasMat: Matrix;
2459
+ colorMap: PcbColorMap$1;
2460
+ }
2461
+ declare function drawPcbCourtyardCircle(params: DrawPcbCourtyardCircleParams): void;
2462
+
2463
+ type CircuitToCanvasModule_AlphabetLayout = AlphabetLayout;
2464
+ type CircuitToCanvasModule_AnchorAlignment = AnchorAlignment;
2465
+ type CircuitToCanvasModule_CameraBounds = CameraBounds;
2466
+ type CircuitToCanvasModule_CanvasContext = CanvasContext;
2467
+ type CircuitToCanvasModule_CircuitToCanvasDrawer = CircuitToCanvasDrawer;
2468
+ declare const CircuitToCanvasModule_CircuitToCanvasDrawer: typeof CircuitToCanvasDrawer;
2469
+ declare const CircuitToCanvasModule_DEFAULT_PCB_COLOR_MAP: typeof DEFAULT_PCB_COLOR_MAP;
2470
+ type CircuitToCanvasModule_DrawArrowParams = DrawArrowParams;
2471
+ type CircuitToCanvasModule_DrawCircleParams = DrawCircleParams;
2472
+ type CircuitToCanvasModule_DrawContext = DrawContext;
2473
+ type CircuitToCanvasModule_DrawDimensionLineParams = DrawDimensionLineParams;
2474
+ type CircuitToCanvasModule_DrawElementsOptions = DrawElementsOptions;
2475
+ type CircuitToCanvasModule_DrawLineParams = DrawLineParams;
2476
+ type CircuitToCanvasModule_DrawOvalParams = DrawOvalParams;
2477
+ type CircuitToCanvasModule_DrawPathParams = DrawPathParams;
2478
+ type CircuitToCanvasModule_DrawPcbBoardParams = DrawPcbBoardParams;
2479
+ type CircuitToCanvasModule_DrawPcbCopperPourParams = DrawPcbCopperPourParams;
2480
+ type CircuitToCanvasModule_DrawPcbCopperTextParams = DrawPcbCopperTextParams;
2481
+ type CircuitToCanvasModule_DrawPcbCourtyardCircleParams = DrawPcbCourtyardCircleParams;
2482
+ type CircuitToCanvasModule_DrawPcbCutoutParams = DrawPcbCutoutParams;
2483
+ type CircuitToCanvasModule_DrawPcbFabricationNoteDimensionParams = DrawPcbFabricationNoteDimensionParams;
2484
+ type CircuitToCanvasModule_DrawPcbFabricationNotePathParams = DrawPcbFabricationNotePathParams;
2485
+ type CircuitToCanvasModule_DrawPcbFabricationNoteRectParams = DrawPcbFabricationNoteRectParams;
2486
+ type CircuitToCanvasModule_DrawPcbFabricationNoteTextParams = DrawPcbFabricationNoteTextParams;
2487
+ type CircuitToCanvasModule_DrawPcbHoleParams = DrawPcbHoleParams;
2488
+ type CircuitToCanvasModule_DrawPcbKeepoutParams = DrawPcbKeepoutParams;
2489
+ type CircuitToCanvasModule_DrawPcbNoteDimensionParams = DrawPcbNoteDimensionParams;
2490
+ type CircuitToCanvasModule_DrawPcbNotePathParams = DrawPcbNotePathParams;
2491
+ type CircuitToCanvasModule_DrawPcbNoteRectParams = DrawPcbNoteRectParams;
2492
+ type CircuitToCanvasModule_DrawPcbNoteTextParams = DrawPcbNoteTextParams;
2493
+ type CircuitToCanvasModule_DrawPcbPanelParams = DrawPcbPanelParams;
2494
+ type CircuitToCanvasModule_DrawPcbPlatedHoleParams = DrawPcbPlatedHoleParams;
2495
+ type CircuitToCanvasModule_DrawPcbSilkscreenCircleParams = DrawPcbSilkscreenCircleParams;
2496
+ type CircuitToCanvasModule_DrawPcbSilkscreenLineParams = DrawPcbSilkscreenLineParams;
2497
+ type CircuitToCanvasModule_DrawPcbSilkscreenOvalParams = DrawPcbSilkscreenOvalParams;
2498
+ type CircuitToCanvasModule_DrawPcbSilkscreenPathParams = DrawPcbSilkscreenPathParams;
2499
+ type CircuitToCanvasModule_DrawPcbSilkscreenPillParams = DrawPcbSilkscreenPillParams;
2500
+ type CircuitToCanvasModule_DrawPcbSilkscreenRectParams = DrawPcbSilkscreenRectParams;
2501
+ type CircuitToCanvasModule_DrawPcbSilkscreenTextParams = DrawPcbSilkscreenTextParams;
2502
+ type CircuitToCanvasModule_DrawPcbSmtPadParams = DrawPcbSmtPadParams;
2503
+ type CircuitToCanvasModule_DrawPcbTraceParams = DrawPcbTraceParams;
2504
+ type CircuitToCanvasModule_DrawPcbViaParams = DrawPcbViaParams;
2505
+ type CircuitToCanvasModule_DrawPillParams = DrawPillParams;
2506
+ type CircuitToCanvasModule_DrawPolygonParams = DrawPolygonParams;
2507
+ type CircuitToCanvasModule_DrawRectParams = DrawRectParams;
2508
+ type CircuitToCanvasModule_DrawTextParams = DrawTextParams;
2509
+ type CircuitToCanvasModule_DrawerConfig = DrawerConfig;
2510
+ declare const CircuitToCanvasModule_drawArrow: typeof drawArrow;
2511
+ declare const CircuitToCanvasModule_drawCircle: typeof drawCircle;
2512
+ declare const CircuitToCanvasModule_drawDimensionLine: typeof drawDimensionLine;
2513
+ declare const CircuitToCanvasModule_drawLine: typeof drawLine;
2514
+ declare const CircuitToCanvasModule_drawOval: typeof drawOval;
2515
+ declare const CircuitToCanvasModule_drawPath: typeof drawPath;
2516
+ declare const CircuitToCanvasModule_drawPcbBoard: typeof drawPcbBoard;
2517
+ declare const CircuitToCanvasModule_drawPcbCopperPour: typeof drawPcbCopperPour;
2518
+ declare const CircuitToCanvasModule_drawPcbCopperText: typeof drawPcbCopperText;
2519
+ declare const CircuitToCanvasModule_drawPcbCourtyardCircle: typeof drawPcbCourtyardCircle;
2520
+ declare const CircuitToCanvasModule_drawPcbCutout: typeof drawPcbCutout;
2521
+ declare const CircuitToCanvasModule_drawPcbFabricationNoteDimension: typeof drawPcbFabricationNoteDimension;
2522
+ declare const CircuitToCanvasModule_drawPcbFabricationNotePath: typeof drawPcbFabricationNotePath;
2523
+ declare const CircuitToCanvasModule_drawPcbFabricationNoteRect: typeof drawPcbFabricationNoteRect;
2524
+ declare const CircuitToCanvasModule_drawPcbFabricationNoteText: typeof drawPcbFabricationNoteText;
2525
+ declare const CircuitToCanvasModule_drawPcbHole: typeof drawPcbHole;
2526
+ declare const CircuitToCanvasModule_drawPcbKeepout: typeof drawPcbKeepout;
2527
+ declare const CircuitToCanvasModule_drawPcbNoteDimension: typeof drawPcbNoteDimension;
2528
+ declare const CircuitToCanvasModule_drawPcbNotePath: typeof drawPcbNotePath;
2529
+ declare const CircuitToCanvasModule_drawPcbNoteRect: typeof drawPcbNoteRect;
2530
+ declare const CircuitToCanvasModule_drawPcbNoteText: typeof drawPcbNoteText;
2531
+ declare const CircuitToCanvasModule_drawPcbPanelElement: typeof drawPcbPanelElement;
2532
+ declare const CircuitToCanvasModule_drawPcbPlatedHole: typeof drawPcbPlatedHole;
2533
+ declare const CircuitToCanvasModule_drawPcbSilkscreenCircle: typeof drawPcbSilkscreenCircle;
2534
+ declare const CircuitToCanvasModule_drawPcbSilkscreenLine: typeof drawPcbSilkscreenLine;
2535
+ declare const CircuitToCanvasModule_drawPcbSilkscreenOval: typeof drawPcbSilkscreenOval;
2536
+ declare const CircuitToCanvasModule_drawPcbSilkscreenPath: typeof drawPcbSilkscreenPath;
2537
+ declare const CircuitToCanvasModule_drawPcbSilkscreenPill: typeof drawPcbSilkscreenPill;
2538
+ declare const CircuitToCanvasModule_drawPcbSilkscreenRect: typeof drawPcbSilkscreenRect;
2539
+ declare const CircuitToCanvasModule_drawPcbSilkscreenText: typeof drawPcbSilkscreenText;
2540
+ declare const CircuitToCanvasModule_drawPcbSmtPad: typeof drawPcbSmtPad;
2541
+ declare const CircuitToCanvasModule_drawPcbTrace: typeof drawPcbTrace;
2542
+ declare const CircuitToCanvasModule_drawPcbVia: typeof drawPcbVia;
2543
+ declare const CircuitToCanvasModule_drawPill: typeof drawPill;
2544
+ declare const CircuitToCanvasModule_drawPolygon: typeof drawPolygon;
2545
+ declare const CircuitToCanvasModule_drawRect: typeof drawRect;
2546
+ declare const CircuitToCanvasModule_drawSoldermaskRingForCircle: typeof drawSoldermaskRingForCircle;
2547
+ declare const CircuitToCanvasModule_drawSoldermaskRingForOval: typeof drawSoldermaskRingForOval;
2548
+ declare const CircuitToCanvasModule_drawSoldermaskRingForPill: typeof drawSoldermaskRingForPill;
2549
+ declare const CircuitToCanvasModule_drawSoldermaskRingForRect: typeof drawSoldermaskRingForRect;
2550
+ declare const CircuitToCanvasModule_drawText: typeof drawText;
2551
+ declare const CircuitToCanvasModule_getAlphabetLayout: typeof getAlphabetLayout;
2552
+ declare const CircuitToCanvasModule_getTextStartPosition: typeof getTextStartPosition;
2553
+ declare const CircuitToCanvasModule_strokeAlphabetText: typeof strokeAlphabetText;
2554
+ declare namespace CircuitToCanvasModule {
2555
+ export { type CircuitToCanvasModule_AlphabetLayout as AlphabetLayout, type CircuitToCanvasModule_AnchorAlignment as AnchorAlignment, type CircuitToCanvasModule_CameraBounds as CameraBounds, type CircuitToCanvasModule_CanvasContext as CanvasContext, CircuitToCanvasModule_CircuitToCanvasDrawer as CircuitToCanvasDrawer, type CopperColorMap$1 as CopperColorMap, type CopperLayerName$1 as CopperLayerName, CircuitToCanvasModule_DEFAULT_PCB_COLOR_MAP as DEFAULT_PCB_COLOR_MAP, type CircuitToCanvasModule_DrawArrowParams as DrawArrowParams, type CircuitToCanvasModule_DrawCircleParams as DrawCircleParams, type CircuitToCanvasModule_DrawContext as DrawContext, type CircuitToCanvasModule_DrawDimensionLineParams as DrawDimensionLineParams, type CircuitToCanvasModule_DrawElementsOptions as DrawElementsOptions, type CircuitToCanvasModule_DrawLineParams as DrawLineParams, type CircuitToCanvasModule_DrawOvalParams as DrawOvalParams, type CircuitToCanvasModule_DrawPathParams as DrawPathParams, type CircuitToCanvasModule_DrawPcbBoardParams as DrawPcbBoardParams, type CircuitToCanvasModule_DrawPcbCopperPourParams as DrawPcbCopperPourParams, type CircuitToCanvasModule_DrawPcbCopperTextParams as DrawPcbCopperTextParams, type CircuitToCanvasModule_DrawPcbCourtyardCircleParams as DrawPcbCourtyardCircleParams, type CircuitToCanvasModule_DrawPcbCutoutParams as DrawPcbCutoutParams, type CircuitToCanvasModule_DrawPcbFabricationNoteDimensionParams as DrawPcbFabricationNoteDimensionParams, type CircuitToCanvasModule_DrawPcbFabricationNotePathParams as DrawPcbFabricationNotePathParams, type CircuitToCanvasModule_DrawPcbFabricationNoteRectParams as DrawPcbFabricationNoteRectParams, type CircuitToCanvasModule_DrawPcbFabricationNoteTextParams as DrawPcbFabricationNoteTextParams, type CircuitToCanvasModule_DrawPcbHoleParams as DrawPcbHoleParams, type CircuitToCanvasModule_DrawPcbKeepoutParams as DrawPcbKeepoutParams, type CircuitToCanvasModule_DrawPcbNoteDimensionParams as DrawPcbNoteDimensionParams, type CircuitToCanvasModule_DrawPcbNotePathParams as DrawPcbNotePathParams, type CircuitToCanvasModule_DrawPcbNoteRectParams as DrawPcbNoteRectParams, type CircuitToCanvasModule_DrawPcbNoteTextParams as DrawPcbNoteTextParams, type CircuitToCanvasModule_DrawPcbPanelParams as DrawPcbPanelParams, type CircuitToCanvasModule_DrawPcbPlatedHoleParams as DrawPcbPlatedHoleParams, type CircuitToCanvasModule_DrawPcbSilkscreenCircleParams as DrawPcbSilkscreenCircleParams, type CircuitToCanvasModule_DrawPcbSilkscreenLineParams as DrawPcbSilkscreenLineParams, type CircuitToCanvasModule_DrawPcbSilkscreenOvalParams as DrawPcbSilkscreenOvalParams, type CircuitToCanvasModule_DrawPcbSilkscreenPathParams as DrawPcbSilkscreenPathParams, type CircuitToCanvasModule_DrawPcbSilkscreenPillParams as DrawPcbSilkscreenPillParams, type CircuitToCanvasModule_DrawPcbSilkscreenRectParams as DrawPcbSilkscreenRectParams, type CircuitToCanvasModule_DrawPcbSilkscreenTextParams as DrawPcbSilkscreenTextParams, type CircuitToCanvasModule_DrawPcbSmtPadParams as DrawPcbSmtPadParams, type CircuitToCanvasModule_DrawPcbTraceParams as DrawPcbTraceParams, type CircuitToCanvasModule_DrawPcbViaParams as DrawPcbViaParams, type CircuitToCanvasModule_DrawPillParams as DrawPillParams, type CircuitToCanvasModule_DrawPolygonParams as DrawPolygonParams, type CircuitToCanvasModule_DrawRectParams as DrawRectParams, type CircuitToCanvasModule_DrawTextParams as DrawTextParams, type CircuitToCanvasModule_DrawerConfig as DrawerConfig, type PcbColorMap$1 as PcbColorMap, CircuitToCanvasModule_drawArrow as drawArrow, CircuitToCanvasModule_drawCircle as drawCircle, CircuitToCanvasModule_drawDimensionLine as drawDimensionLine, CircuitToCanvasModule_drawLine as drawLine, CircuitToCanvasModule_drawOval as drawOval, CircuitToCanvasModule_drawPath as drawPath, CircuitToCanvasModule_drawPcbBoard as drawPcbBoard, CircuitToCanvasModule_drawPcbCopperPour as drawPcbCopperPour, CircuitToCanvasModule_drawPcbCopperText as drawPcbCopperText, CircuitToCanvasModule_drawPcbCourtyardCircle as drawPcbCourtyardCircle, CircuitToCanvasModule_drawPcbCutout as drawPcbCutout, CircuitToCanvasModule_drawPcbFabricationNoteDimension as drawPcbFabricationNoteDimension, CircuitToCanvasModule_drawPcbFabricationNotePath as drawPcbFabricationNotePath, CircuitToCanvasModule_drawPcbFabricationNoteRect as drawPcbFabricationNoteRect, CircuitToCanvasModule_drawPcbFabricationNoteText as drawPcbFabricationNoteText, CircuitToCanvasModule_drawPcbHole as drawPcbHole, CircuitToCanvasModule_drawPcbKeepout as drawPcbKeepout, CircuitToCanvasModule_drawPcbNoteDimension as drawPcbNoteDimension, CircuitToCanvasModule_drawPcbNotePath as drawPcbNotePath, CircuitToCanvasModule_drawPcbNoteRect as drawPcbNoteRect, CircuitToCanvasModule_drawPcbNoteText as drawPcbNoteText, CircuitToCanvasModule_drawPcbPanelElement as drawPcbPanelElement, CircuitToCanvasModule_drawPcbPlatedHole as drawPcbPlatedHole, CircuitToCanvasModule_drawPcbSilkscreenCircle as drawPcbSilkscreenCircle, CircuitToCanvasModule_drawPcbSilkscreenLine as drawPcbSilkscreenLine, CircuitToCanvasModule_drawPcbSilkscreenOval as drawPcbSilkscreenOval, CircuitToCanvasModule_drawPcbSilkscreenPath as drawPcbSilkscreenPath, CircuitToCanvasModule_drawPcbSilkscreenPill as drawPcbSilkscreenPill, CircuitToCanvasModule_drawPcbSilkscreenRect as drawPcbSilkscreenRect, CircuitToCanvasModule_drawPcbSilkscreenText as drawPcbSilkscreenText, CircuitToCanvasModule_drawPcbSmtPad as drawPcbSmtPad, CircuitToCanvasModule_drawPcbTrace as drawPcbTrace, CircuitToCanvasModule_drawPcbVia as drawPcbVia, CircuitToCanvasModule_drawPill as drawPill, CircuitToCanvasModule_drawPolygon as drawPolygon, CircuitToCanvasModule_drawRect as drawRect, CircuitToCanvasModule_drawSoldermaskRingForCircle as drawSoldermaskRingForCircle, CircuitToCanvasModule_drawSoldermaskRingForOval as drawSoldermaskRingForOval, CircuitToCanvasModule_drawSoldermaskRingForPill as drawSoldermaskRingForPill, CircuitToCanvasModule_drawSoldermaskRingForRect as drawSoldermaskRingForRect, CircuitToCanvasModule_drawText as drawText, CircuitToCanvasModule_getAlphabetLayout as getAlphabetLayout, CircuitToCanvasModule_getTextStartPosition as getTextStartPosition, CircuitToCanvasModule_strokeAlphabetText as strokeAlphabetText };
2556
+ }
2557
+
2558
+ interface PcbGridOptions {
2559
+ cellSize: number;
2560
+ lineColor?: string;
2561
+ majorCellSize?: number;
2562
+ majorLineColor?: string;
2563
+ }
2564
+
2565
+ type CopperLayerName = "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2566
+ type CopperColorMap = Record<CopperLayerName, string> & {
2567
+ [layer: string]: string;
2568
+ };
2569
+ interface PcbColorMap {
2570
+ copper: CopperColorMap;
2571
+ drill: string;
2572
+ silkscreen: {
2573
+ top: string;
2574
+ bottom: string;
2575
+ };
2576
+ boardOutline: string;
2577
+ soldermask: {
2578
+ top: string;
2579
+ bottom: string;
2580
+ };
2581
+ soldermaskWithCopperUnderneath: {
2582
+ top: string;
2583
+ bottom: string;
2584
+ };
2585
+ soldermaskOverCopper: {
2586
+ top: string;
2587
+ bottom: string;
2588
+ };
2589
+ substrate: string;
2590
+ courtyard: {
2591
+ top: string;
2592
+ bottom: string;
2593
+ };
2594
+ keepout?: string;
2595
+ debugComponent: {
2596
+ fill: string | null;
2597
+ stroke: string | null;
2598
+ };
2599
+ }
2600
+ interface PcbColorOverrides {
2601
+ copper?: Partial<PcbColorMap["copper"]>;
2602
+ drill?: string;
2603
+ silkscreen?: Partial<PcbColorMap["silkscreen"]>;
2604
+ boardOutline?: string;
2605
+ soldermask?: Partial<PcbColorMap["soldermask"]>;
2606
+ soldermaskWithCopperUnderneath?: Partial<PcbColorMap["soldermaskWithCopperUnderneath"]>;
2607
+ soldermaskOverCopper?: Partial<PcbColorMap["soldermaskOverCopper"]>;
2608
+ substrate?: string;
2609
+ courtyard?: Partial<PcbColorMap["courtyard"]>;
2610
+ keepout?: string;
2611
+ debugComponent?: Partial<PcbColorMap["debugComponent"]>;
2612
+ }
2613
+
2614
+ interface PcbSvgOptions {
2615
+ colorOverrides?: PcbColorOverrides;
2616
+ width?: number;
2617
+ height?: number;
2618
+ shouldDrawErrors?: boolean;
2619
+ showErrorsInTextOverlay?: boolean;
2620
+ shouldDrawRatsNest?: boolean;
2621
+ showCourtyards?: boolean;
2622
+ showPcbGroups?: boolean;
2623
+ layer?: "top" | "bottom";
2624
+ matchBoardAspectRatio?: boolean;
2625
+ backgroundColor?: string;
2626
+ drawPaddingOutsideBoard?: boolean;
2627
+ includeVersion?: boolean;
2628
+ showSolderMask?: boolean;
2629
+ showPcbNotes?: boolean;
2630
+ grid?: PcbGridOptions;
2631
+ showAnchorOffsets?: boolean;
2632
+ viewport?: {
2633
+ minX: number;
2634
+ minY: number;
2635
+ maxX: number;
2636
+ maxY: number;
2637
+ };
2638
+ viewportTarget?: {
2639
+ pcb_panel_id?: string;
2640
+ pcb_board_id?: string;
2641
+ };
2642
+ }
2643
+ interface PcbContext {
2644
+ transform: Matrix;
2645
+ layer?: "top" | "bottom";
2646
+ shouldDrawErrors?: boolean;
2647
+ showCourtyards?: boolean;
2648
+ showPcbGroups?: boolean;
2649
+ drawPaddingOutsideBoard?: boolean;
2650
+ colorMap: PcbColorMap;
2651
+ showSolderMask?: boolean;
2652
+ showPcbNotes?: boolean;
2653
+ showAnchorOffsets?: boolean;
2654
+ circuitJson?: AnyCircuitElement[];
2655
+ }
2656
+ declare function convertCircuitJsonToPcbSvg(circuitJson: AnyCircuitElement[], options?: PcbSvgOptions): string;
2657
+ /**
2658
+ * @deprecated use `convertCircuitJsonToPcbSvg` instead
2659
+ */
2660
+ declare const circuitJsonToPcbSvg: typeof convertCircuitJsonToPcbSvg;
2661
+
2662
+ interface Options$3 {
2663
+ width?: number;
2664
+ height?: number;
2665
+ includeVersion?: boolean;
2666
+ showErrorsInTextOverlay?: boolean;
2667
+ }
2668
+ interface AssemblySvgContext {
2669
+ transform: Matrix;
2670
+ }
2671
+ declare function convertCircuitJsonToAssemblySvg(soup: AnyCircuitElement[], options?: Options$3): string;
2672
+
2673
+ type LabelPosition = {
2674
+ text: string;
2675
+ aliases: string[];
2676
+ elbow_end: {
2677
+ x: number;
2678
+ y: number;
2679
+ };
2680
+ label_pos: {
2681
+ x: number;
2682
+ y: number;
2683
+ };
2684
+ edge: "left" | "right" | "top" | "bottom";
2685
+ };
2686
+
2687
+ interface Options$2 {
2688
+ width?: number;
2689
+ height?: number;
2690
+ includeVersion?: boolean;
2691
+ showErrorsInTextOverlay?: boolean;
2692
+ }
2693
+ interface PinoutLabel {
2694
+ pcb_port: PcbPort;
2695
+ aliases: string[];
2696
+ edge: "left" | "right" | "top" | "bottom";
2697
+ }
2698
+ interface PinoutSvgContext {
2699
+ transform: Matrix;
2700
+ soup: AnyCircuitElement[];
2701
+ board_bounds: {
2702
+ minX: number;
2703
+ minY: number;
2704
+ maxX: number;
2705
+ maxY: number;
2706
+ };
2707
+ styleScale: number;
2708
+ label_positions: Map<string, LabelPosition>;
2709
+ svgWidth: number;
2710
+ svgHeight: number;
2711
+ }
2712
+ declare function convertCircuitJsonToPinoutSvg(soup: AnyCircuitElement[], options?: Options$2): string;
2713
+
2714
+ declare const colorMap: {
2715
+ "3d_viewer": {
2716
+ background_bottom: string;
2717
+ background_top: string;
2718
+ board: string;
2719
+ copper: string;
2720
+ silkscreen_bottom: string;
2721
+ silkscreen_top: string;
2722
+ soldermask: string;
2723
+ solderpaste: string;
2724
+ };
2725
+ board: {
2726
+ anchor: string;
2727
+ aux_items: string;
2728
+ b_adhes: string;
2729
+ b_crtyd: string;
2730
+ b_fab: string;
2731
+ b_mask: string;
2732
+ b_paste: string;
2733
+ b_silks: string;
2734
+ background: string;
2735
+ cmts_user: string;
2736
+ copper: {
2737
+ b: string;
2738
+ f: string;
2739
+ in1: string;
2740
+ in10: string;
2741
+ in11: string;
2742
+ in12: string;
2743
+ in13: string;
2744
+ in14: string;
2745
+ in15: string;
2746
+ in16: string;
2747
+ in17: string;
2748
+ in18: string;
2749
+ in19: string;
2750
+ in2: string;
2751
+ in20: string;
2752
+ in21: string;
2753
+ in22: string;
2754
+ in23: string;
2755
+ in24: string;
2756
+ in25: string;
2757
+ in26: string;
2758
+ in27: string;
2759
+ in28: string;
2760
+ in29: string;
2761
+ in3: string;
2762
+ in30: string;
2763
+ in4: string;
2764
+ in5: string;
2765
+ in6: string;
2766
+ in7: string;
2767
+ in8: string;
2768
+ in9: string;
2769
+ };
2770
+ cursor: string;
2771
+ drc: string;
2772
+ drc_error: string;
2773
+ drc_exclusion: string;
2774
+ drc_warning: string;
2775
+ dwgs_user: string;
2776
+ eco1_user: string;
2777
+ eco2_user: string;
2778
+ edge_cuts: string;
2779
+ f_adhes: string;
2780
+ f_crtyd: string;
2781
+ f_fab: string;
2782
+ f_mask: string;
2783
+ f_paste: string;
2784
+ f_silks: string;
2785
+ footprint_text_back: string;
2786
+ footprint_text_front: string;
2787
+ footprint_text_invisible: string;
2788
+ grid: string;
2789
+ grid_axes: string;
2790
+ margin: string;
2791
+ microvia: string;
2792
+ no_connect: string;
2793
+ pad_back: string;
2794
+ pad_front: string;
2795
+ pad_plated_hole: string;
2796
+ pad_through_hole: string;
2797
+ plated_hole: string;
2798
+ ratsnest: string;
2799
+ select_overlay: string;
2800
+ through_via: string;
2801
+ user_1: string;
2802
+ user_2: string;
2803
+ user_3: string;
2804
+ user_4: string;
2805
+ user_5: string;
2806
+ user_6: string;
2807
+ user_7: string;
2808
+ user_8: string;
2809
+ user_9: string;
2810
+ via_blind_buried: string;
2811
+ via_hole: string;
2812
+ via_micro: string;
2813
+ via_through: string;
2814
+ worksheet: string;
2815
+ };
2816
+ gerbview: {
2817
+ axes: string;
2818
+ background: string;
2819
+ dcodes: string;
2820
+ grid: string;
2821
+ layers: string[];
2822
+ negative_objects: string;
2823
+ worksheet: string;
2824
+ };
2825
+ meta: {
2826
+ filename: string;
2827
+ name: string;
2828
+ version: number;
2829
+ };
2830
+ palette: string[];
2831
+ schematic: {
2832
+ aux_items: string;
2833
+ background: string;
2834
+ brightened: string;
2835
+ bus: string;
2836
+ bus_junction: string;
2837
+ component_body: string;
2838
+ component_outline: string;
2839
+ cursor: string;
2840
+ erc_error: string;
2841
+ erc_warning: string;
2842
+ fields: string;
2843
+ grid: string;
2844
+ grid_axes: string;
2845
+ hidden: string;
2846
+ junction: string;
2847
+ label_global: string;
2848
+ label_background: string;
2849
+ label_hier: string;
2850
+ label_local: string;
2851
+ net_name: string;
2852
+ no_connect: string;
2853
+ note: string;
2854
+ override_item_colors: boolean;
2855
+ pin: string;
2856
+ pin_name: string;
2857
+ pin_number: string;
2858
+ reference: string;
2859
+ shadow: string;
2860
+ sheet: string;
2861
+ sheet_background: string;
2862
+ sheet_fields: string;
2863
+ sheet_filename: string;
2864
+ sheet_label: string;
2865
+ sheet_name: string;
2866
+ table: string;
2867
+ value: string;
2868
+ wire: string;
2869
+ wire_crossing: string;
2870
+ worksheet: string;
2871
+ };
2872
+ };
2873
+ type ColorMap = typeof colorMap;
2874
+
2875
+ type ColorOverrides = {
2876
+ schematic?: Partial<ColorMap["schematic"]>;
2877
+ };
2878
+ interface Options$1 {
2879
+ colorOverrides?: ColorOverrides;
2880
+ width?: number;
2881
+ height?: number;
2882
+ grid?: boolean | {
2883
+ cellSize?: number;
2884
+ labelCells?: boolean;
2885
+ };
2886
+ labeledPoints?: Array<{
2887
+ x: number;
2888
+ y: number;
2889
+ label: string;
2890
+ }>;
2891
+ includeVersion?: boolean;
2892
+ showErrorsInTextOverlay?: boolean;
2893
+ drawPorts?: boolean;
2894
+ }
2895
+ declare function convertCircuitJsonToSchematicSvg(circuitJson: AnyCircuitElement[], options?: Options$1): string;
2896
+ /**
2897
+ * @deprecated use `convertCircuitJsonToSchematicSvg` instead
2898
+ */
2899
+ declare const circuitJsonToSchematicSvg: typeof convertCircuitJsonToSchematicSvg;
2900
+
2901
+ type CircuitJsonWithSimulation = AnyCircuitElement | SimulationExperiment | SimulationTransientVoltageGraph | SimulationVoltageProbe;
2902
+ declare function isSimulationTransientVoltageGraph(value: CircuitJsonWithSimulation): value is SimulationTransientVoltageGraph;
2903
+ declare function isSimulationExperiment(value: CircuitJsonWithSimulation): value is SimulationExperiment;
2904
+ declare function isSimulationVoltageProbe(value: CircuitJsonWithSimulation): value is SimulationVoltageProbe;
2905
+
2906
+ interface ConvertSchematicSimulationParams {
2907
+ circuitJson: CircuitJsonWithSimulation[];
2908
+ simulation_experiment_id: string;
2909
+ simulation_transient_voltage_graph_ids?: string[];
2910
+ width?: number;
2911
+ height?: number;
2912
+ schematicHeightRatio?: number;
2913
+ schematicOptions?: Omit<Parameters<typeof convertCircuitJsonToSchematicSvg>[1], "width" | "height" | "includeVersion">;
2914
+ includeVersion?: boolean;
2915
+ /** When true, place the simulation graph above the schematic instead of below (defaults to false). */
2916
+ graphAboveSchematic?: boolean;
2917
+ showErrorsInTextOverlay?: boolean;
2918
+ }
2919
+ declare function convertCircuitJsonToSchematicSimulationSvg({ circuitJson, simulation_experiment_id, simulation_transient_voltage_graph_ids, width, height, schematicHeightRatio, schematicOptions, includeVersion, graphAboveSchematic, showErrorsInTextOverlay, }: ConvertSchematicSimulationParams): string;
2920
+
2921
+ interface Options {
2922
+ layer: "top" | "bottom";
2923
+ width?: number;
2924
+ height?: number;
2925
+ includeVersion?: boolean;
2926
+ showErrorsInTextOverlay?: boolean;
2927
+ }
2928
+ declare function convertCircuitJsonToSolderPasteMask(circuitJson: AnyCircuitElement[], options: Options): string;
2929
+
2930
+ interface ConvertSimulationGraphParams {
2931
+ circuitJson: CircuitJsonWithSimulation[];
2932
+ simulation_experiment_id: string;
2933
+ simulation_transient_voltage_graph_ids?: string[];
2934
+ width?: number;
2935
+ height?: number;
2936
+ includeVersion?: boolean;
2937
+ }
2938
+ declare function convertCircuitJsonToSimulationGraphSvg({ circuitJson, simulation_experiment_id, simulation_transient_voltage_graph_ids, width, height, includeVersion, }: ConvertSimulationGraphParams): string;
2939
+
2940
+ declare function getSoftwareUsedString(circuitJson: AnyCircuitElement[]): string | undefined;
2941
+
2942
+ declare const CIRCUIT_TO_SVG_VERSION: string;
2943
+
2944
+ declare const createSvgObjectsForSchComponentPortHovers: ({ component, transform, circuitJson, }: {
2945
+ component: SchematicComponent;
2946
+ transform: Matrix;
2947
+ circuitJson: AnyCircuitElement[];
2948
+ }) => INode[];
2949
+
2950
+ declare function createErrorTextOverlay(circuitJson: AnyCircuitElement[], dataType?: string): INode | null;
2951
+
2952
+ type CircuitToSvgModule_AssemblySvgContext = AssemblySvgContext;
2953
+ declare const CircuitToSvgModule_CIRCUIT_TO_SVG_VERSION: typeof CIRCUIT_TO_SVG_VERSION;
2954
+ type CircuitToSvgModule_CircuitJsonWithSimulation = CircuitJsonWithSimulation;
2955
+ type CircuitToSvgModule_ColorMap = ColorMap;
2956
+ type CircuitToSvgModule_ColorOverrides = ColorOverrides;
2957
+ type CircuitToSvgModule_PcbColorMap = PcbColorMap;
2958
+ type CircuitToSvgModule_PcbColorOverrides = PcbColorOverrides;
2959
+ type CircuitToSvgModule_PcbContext = PcbContext;
2960
+ type CircuitToSvgModule_PcbSvgOptions = PcbSvgOptions;
2961
+ type CircuitToSvgModule_PinoutLabel = PinoutLabel;
2962
+ type CircuitToSvgModule_PinoutSvgContext = PinoutSvgContext;
2963
+ declare const CircuitToSvgModule_circuitJsonToPcbSvg: typeof circuitJsonToPcbSvg;
2964
+ declare const CircuitToSvgModule_circuitJsonToSchematicSvg: typeof circuitJsonToSchematicSvg;
2965
+ declare const CircuitToSvgModule_convertCircuitJsonToAssemblySvg: typeof convertCircuitJsonToAssemblySvg;
2966
+ declare const CircuitToSvgModule_convertCircuitJsonToPcbSvg: typeof convertCircuitJsonToPcbSvg;
2967
+ declare const CircuitToSvgModule_convertCircuitJsonToPinoutSvg: typeof convertCircuitJsonToPinoutSvg;
2968
+ declare const CircuitToSvgModule_convertCircuitJsonToSchematicSimulationSvg: typeof convertCircuitJsonToSchematicSimulationSvg;
2969
+ declare const CircuitToSvgModule_convertCircuitJsonToSchematicSvg: typeof convertCircuitJsonToSchematicSvg;
2970
+ declare const CircuitToSvgModule_convertCircuitJsonToSimulationGraphSvg: typeof convertCircuitJsonToSimulationGraphSvg;
2971
+ declare const CircuitToSvgModule_convertCircuitJsonToSolderPasteMask: typeof convertCircuitJsonToSolderPasteMask;
2972
+ declare const CircuitToSvgModule_createErrorTextOverlay: typeof createErrorTextOverlay;
2973
+ declare const CircuitToSvgModule_createSvgObjectsForSchComponentPortHovers: typeof createSvgObjectsForSchComponentPortHovers;
2974
+ declare const CircuitToSvgModule_getSoftwareUsedString: typeof getSoftwareUsedString;
2975
+ declare const CircuitToSvgModule_isSimulationExperiment: typeof isSimulationExperiment;
2976
+ declare const CircuitToSvgModule_isSimulationTransientVoltageGraph: typeof isSimulationTransientVoltageGraph;
2977
+ declare const CircuitToSvgModule_isSimulationVoltageProbe: typeof isSimulationVoltageProbe;
2978
+ declare namespace CircuitToSvgModule {
2979
+ export { type CircuitToSvgModule_AssemblySvgContext as AssemblySvgContext, CircuitToSvgModule_CIRCUIT_TO_SVG_VERSION as CIRCUIT_TO_SVG_VERSION, type CircuitToSvgModule_CircuitJsonWithSimulation as CircuitJsonWithSimulation, type CircuitToSvgModule_ColorMap as ColorMap, type CircuitToSvgModule_ColorOverrides as ColorOverrides, type CircuitToSvgModule_PcbColorMap as PcbColorMap, type CircuitToSvgModule_PcbColorOverrides as PcbColorOverrides, type CircuitToSvgModule_PcbContext as PcbContext, type CircuitToSvgModule_PcbSvgOptions as PcbSvgOptions, type CircuitToSvgModule_PinoutLabel as PinoutLabel, type CircuitToSvgModule_PinoutSvgContext as PinoutSvgContext, CircuitToSvgModule_circuitJsonToPcbSvg as circuitJsonToPcbSvg, CircuitToSvgModule_circuitJsonToSchematicSvg as circuitJsonToSchematicSvg, CircuitToSvgModule_convertCircuitJsonToAssemblySvg as convertCircuitJsonToAssemblySvg, CircuitToSvgModule_convertCircuitJsonToPcbSvg as convertCircuitJsonToPcbSvg, CircuitToSvgModule_convertCircuitJsonToPinoutSvg as convertCircuitJsonToPinoutSvg, CircuitToSvgModule_convertCircuitJsonToSchematicSimulationSvg as convertCircuitJsonToSchematicSimulationSvg, CircuitToSvgModule_convertCircuitJsonToSchematicSvg as convertCircuitJsonToSchematicSvg, CircuitToSvgModule_convertCircuitJsonToSimulationGraphSvg as convertCircuitJsonToSimulationGraphSvg, CircuitToSvgModule_convertCircuitJsonToSolderPasteMask as convertCircuitJsonToSolderPasteMask, CircuitToSvgModule_createErrorTextOverlay as createErrorTextOverlay, CircuitToSvgModule_createSvgObjectsForSchComponentPortHovers as createSvgObjectsForSchComponentPortHovers, CircuitToSvgModule_getSoftwareUsedString as getSoftwareUsedString, CircuitToSvgModule_isSimulationExperiment as isSimulationExperiment, CircuitToSvgModule_isSimulationTransientVoltageGraph as isSimulationTransientVoltageGraph, CircuitToSvgModule_isSimulationVoltageProbe as isSimulationVoltageProbe };
2980
+ }
2981
+
2982
+ declare const supportedModules: readonly ["circuit-json-to-bom-csv", "circuit-json-to-bpc", "circuit-json-to-connectivity-map", "circuit-json-to-gerber", "circuit-json-to-gltf", "circuit-json-to-kicad", "circuit-json-to-lbrn", "circuit-json-to-pnp-csv", "circuit-json-to-readable-netlist", "circuit-json-to-simple-3d", "circuit-json-to-spice", "circuit-json-to-step", "circuit-json-to-tscircuit", "circuit-to-canvas", "circuit-to-svg"];
2983
+ type SupportedModuleName = (typeof supportedModules)[number];
2984
+ type SupportedModuleSpecifier = SupportedModuleName | `${SupportedModuleName}@${string}`;
2985
+ interface SupportedModuleMap {
2986
+ "circuit-json-to-bom-csv": typeof CircuitJsonToBomCsvModule;
2987
+ "circuit-json-to-bpc": typeof CircuitJsonToBpcModule;
2988
+ "circuit-json-to-connectivity-map": typeof CircuitJsonToConnectivityMapModule;
2989
+ "circuit-json-to-gerber": typeof CircuitJsonToGerberModule;
2990
+ "circuit-json-to-gltf": typeof CircuitJsonToGltfModule;
2991
+ "circuit-json-to-kicad": typeof CircuitJsonToKicadModule;
2992
+ "circuit-json-to-lbrn": typeof CircuitJsonToLbrnModule;
2993
+ "circuit-json-to-pnp-csv": typeof CircuitJsonToPnpCsvModule;
2994
+ "circuit-json-to-readable-netlist": typeof CircuitJsonToReadableNetlistModule;
2995
+ "circuit-json-to-simple-3d": typeof CircuitJsonToSimple3dModule;
2996
+ "circuit-json-to-spice": typeof CircuitJsonToSpiceModule;
2997
+ "circuit-json-to-step": typeof CircuitJsonToStepModule;
2998
+ "circuit-json-to-tscircuit": typeof CircuitJsonToTscircuitModule;
2999
+ "circuit-to-canvas": typeof CircuitToCanvasModule;
3000
+ "circuit-to-svg": typeof CircuitToSvgModule;
3001
+ }
3002
+ type StripVersion<TSpecifier extends string> = TSpecifier extends `${infer TBase}@${string}` ? TBase extends SupportedModuleName ? TBase : never : TSpecifier extends SupportedModuleName ? TSpecifier : never;
3003
+ declare const getImportUrl: (specifier: string) => string;
3004
+ declare function importer<TSpecifier extends SupportedModuleSpecifier>(specifier: TSpecifier): Promise<SupportedModuleMap[StripVersion<TSpecifier>]>;
3005
+ declare function importer(specifier: string): Promise<unknown>;
3006
+
3007
+ export { type SupportedModuleMap, type SupportedModuleName, type SupportedModuleSpecifier, importer as default, getImportUrl, supportedModules };