multisim2kicad 0.0.0 → 0.2.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,415 @@
1
+ export interface Source {
2
+ application: string;
3
+ versionMajor: number;
4
+ versionMinor: number;
5
+ schema: number;
6
+ }
7
+ export interface EwLayer {
8
+ number: number;
9
+ name: string;
10
+ description?: string;
11
+ state: number;
12
+ rgb: number;
13
+ }
14
+ export interface Point {
15
+ x: number;
16
+ y: number;
17
+ }
18
+ export type Shape = {
19
+ kind: "polyline";
20
+ layer: number;
21
+ thickness: number;
22
+ points: Point[];
23
+ } | {
24
+ kind: "rectangle";
25
+ layer: number;
26
+ thickness: number;
27
+ points: Point[];
28
+ } | {
29
+ kind: "roundRect";
30
+ layer: number;
31
+ thickness: number;
32
+ points: Point[];
33
+ radius: number;
34
+ } | {
35
+ kind: "ellipse";
36
+ layer: number;
37
+ thickness: number;
38
+ points: Point[];
39
+ } | {
40
+ kind: "arc";
41
+ layer: number;
42
+ thickness: number;
43
+ start: Point;
44
+ end: Point;
45
+ center: Point;
46
+ };
47
+ export interface Track {
48
+ layer: number;
49
+ thickness: number;
50
+ start: Point;
51
+ end: Point;
52
+ }
53
+ export type PadPrimitive = {
54
+ kind: "poly";
55
+ points: Point[];
56
+ } | {
57
+ kind: "arc";
58
+ center: Point;
59
+ start: Point;
60
+ end: Point;
61
+ width: number;
62
+ } | {
63
+ kind: "circle";
64
+ center: Point;
65
+ radius: number;
66
+ width: number;
67
+ fill: boolean;
68
+ };
69
+ export type PadShape = {
70
+ kind: "circle";
71
+ diameter: number;
72
+ } | {
73
+ kind: "rect";
74
+ width: number;
75
+ height: number;
76
+ } | {
77
+ kind: "roundrect";
78
+ width: number;
79
+ height: number;
80
+ cornerRadius: number;
81
+ } | {
82
+ kind: "custom";
83
+ primitives: PadPrimitive[];
84
+ };
85
+ export interface Pad {
86
+ number: string;
87
+ at: Point;
88
+ rotation: number;
89
+ shape: PadShape;
90
+ drillDiameter: number;
91
+ side: "both" | "top" | "bottom";
92
+ }
93
+ export interface Component {
94
+ reference: string;
95
+ value: string;
96
+ name: string;
97
+ origin: Point;
98
+ /**
99
+ * Millionths of a degree, CCW. Pads and graphics are stored already placed
100
+ * (absolute). Top: placed = origin + R(rotation) * local. Bottom: placed =
101
+ * origin + R(-rotation) * mirrorX(local), from a corpus survey of parts
102
+ * used on both sides (plans/converter.md, C6).
103
+ */
104
+ rotation: number;
105
+ bottom: boolean;
106
+ pads: Pad[];
107
+ /** Silk / fab / courtyard / 3D outline graphics owned by the part, absolute. */
108
+ graphics: Shape[];
109
+ /** The part's text attributes that KiCad can show (REFDES, VALUE, visible labels). */
110
+ texts: ComponentText[];
111
+ }
112
+ /** A component text attribute; `tag` is EW's attribute name (REFDES, VALUE, ...). */
113
+ export interface ComponentText extends BoardText {
114
+ tag: string;
115
+ visible: boolean;
116
+ }
117
+ export interface Via {
118
+ at: Point;
119
+ drillDiameter: number;
120
+ diameter: number;
121
+ netName?: string;
122
+ }
123
+ export interface Hole {
124
+ at: Point;
125
+ drillDiameter: number;
126
+ plated: boolean;
127
+ }
128
+ export interface NetPinRef {
129
+ refdes: string;
130
+ pin: string;
131
+ }
132
+ export interface Net {
133
+ name: string;
134
+ pins: NetPinRef[];
135
+ /** Ultiboard per-net rules (nm); absent = the board default. */
136
+ clearance?: number;
137
+ trackWidth?: number;
138
+ }
139
+ /** Ultiboard board-wide design rules (nm). */
140
+ export interface DesignRules {
141
+ /** Clearance from any copper to a trace / pad / via / copper area. */
142
+ clearance: {
143
+ trace: number;
144
+ pad: number;
145
+ via: number;
146
+ area: number;
147
+ };
148
+ trackWidth: number;
149
+ minTrackWidth: number;
150
+ /** Copper to board outline. */
151
+ edgeClearance: number;
152
+ /** Default via. */
153
+ via: {
154
+ diameter: number;
155
+ drill: number;
156
+ };
157
+ }
158
+ /** Copper stack, top to bottom, as EW layer numbers (0, 1..2N-2, 63). */
159
+ export interface Stackup {
160
+ copper: number[];
161
+ thickness: number;
162
+ }
163
+ /**
164
+ * A copper pour: EW power plane (`UBPowerPlane`) or board-level copper area
165
+ * (`UBPolygon`, `UBRectangle`, ...). EW stores the outline and fill rules,
166
+ * never the computed fill.
167
+ */
168
+ export interface Zone {
169
+ kind: "plane" | "area";
170
+ layer: number;
171
+ netName: string;
172
+ outline: Point[];
173
+ clearance: number;
174
+ minThickness: number;
175
+ reliefSpokeWidth: number;
176
+ thermalReliefStyle: number;
177
+ removeIslands: boolean;
178
+ islandArea: number;
179
+ removeNotEdgeConnected: boolean;
180
+ }
181
+ /** Free text on the board (`UBAttribute Tag=TEXT`). */
182
+ export interface BoardText {
183
+ layer: number;
184
+ text: string;
185
+ at: Point;
186
+ angle: number;
187
+ mirror: boolean;
188
+ width: number;
189
+ height: number;
190
+ strokeWidth: number;
191
+ }
192
+ /**
193
+ * An Ultiboard rule area (keep-in / keep-out). Semantics of `type` and the
194
+ * net groups are not confirmed; masks are kept raw.
195
+ */
196
+ export interface RuleArea {
197
+ type: number;
198
+ outline: Point[];
199
+ /** ActiveLayersZero..Seven, bit i of word w = EW layer 64w + i. */
200
+ activeLayers: bigint[];
201
+ allNets: boolean;
202
+ nets: string[];
203
+ }
204
+ export interface Board {
205
+ source: Source;
206
+ projectName: string;
207
+ sheetTitle: string;
208
+ workArea: {
209
+ left: number;
210
+ bottom: number;
211
+ right: number;
212
+ top: number;
213
+ };
214
+ layers: EwLayer[];
215
+ stackup: Stackup;
216
+ zones: Zone[];
217
+ texts: BoardText[];
218
+ ruleAreas: RuleArea[];
219
+ shapes: Shape[];
220
+ tracks: Track[];
221
+ components: Component[];
222
+ holes: Hole[];
223
+ vias: Via[];
224
+ nets: Net[];
225
+ rules?: DesignRules;
226
+ }
227
+ export interface SchPoint {
228
+ x: number;
229
+ y: number;
230
+ }
231
+ /**
232
+ * A dihedral transform as a 2x2 integer matrix: p' = (a*x + c*y, b*x + d*y).
233
+ * Maps symbol-local coordinates (Y-down) onto the sheet, before translation.
234
+ */
235
+ export interface Dihedral {
236
+ a: number;
237
+ b: number;
238
+ c: number;
239
+ d: number;
240
+ }
241
+ export type SchGraphic = {
242
+ kind: "polyline";
243
+ points: SchPoint[];
244
+ width: number;
245
+ fill: boolean;
246
+ } | {
247
+ kind: "rect";
248
+ a: SchPoint;
249
+ b: SchPoint;
250
+ width: number;
251
+ fill: boolean;
252
+ } | {
253
+ kind: "circle";
254
+ center: SchPoint;
255
+ radius: number;
256
+ width: number;
257
+ fill: boolean;
258
+ } | {
259
+ kind: "arc";
260
+ start: SchPoint;
261
+ mid: SchPoint;
262
+ end: SchPoint;
263
+ width: number;
264
+ } | {
265
+ kind: "text";
266
+ at: SchPoint;
267
+ text: string;
268
+ size: number;
269
+ };
270
+ export interface SymbolPin {
271
+ name: string;
272
+ number: string;
273
+ at: SchPoint;
274
+ dir: SchPoint;
275
+ length: number;
276
+ attach?: SchPoint;
277
+ netId?: string;
278
+ connected?: boolean;
279
+ /** Electrical type, when the source says (EW database parts); else passive. */
280
+ electrical?: PinElectrical;
281
+ }
282
+ export type PinElectrical = "input" | "output" | "bidirectional" | "tri_state" | "passive" | "power_in" | "power_out" | "open_collector" | "open_emitter" | "no_connect" | "unspecified";
283
+ export interface SymbolText {
284
+ text: string;
285
+ at: SchPoint;
286
+ hidden: boolean;
287
+ }
288
+ /** A placed part (or power port), in its own local frame plus a placement. */
289
+ export interface SchematicSymbol {
290
+ reference: string;
291
+ value: string;
292
+ kind: "part" | "power";
293
+ at: SchPoint;
294
+ transform: Dihedral;
295
+ graphics: SchGraphic[];
296
+ pins: SymbolPin[];
297
+ refText?: SymbolText;
298
+ valueText?: SymbolText;
299
+ showPinNames: boolean;
300
+ showPinNumbers: boolean;
301
+ /**
302
+ * Key for final-refdes lookup: drawn refdes + Multisim section name. The
303
+ * final refdes depends on which hierarchy instance the sheet is in.
304
+ */
305
+ drawnKey?: string;
306
+ /** Power port that Multisim doesn't connect to anything. */
307
+ floating?: boolean;
308
+ /** The part's name in the EW database (e.g. "BAV23C"), when known. */
309
+ partName?: string;
310
+ /** How KiCad's simulator should model it (from Multisim's netlist template). */
311
+ sim?: SimSpec;
312
+ /** Added for the simulator only (a supply source): not in the BOM or on the board. */
313
+ simOnly?: boolean;
314
+ }
315
+ /**
316
+ * KiCad simulator (ngspice) settings for one part, as `Sim.*` fields.
317
+ * `exclude`: Multisim has no model for it. Otherwise `device` is a KiCad
318
+ * device (`R`, `C`, `L`, `SUBCKT`), with `params` for the built-in models,
319
+ * `name` the model in the design's SPICE library (`library: true`), and
320
+ * `pins` symbol pin number -> model pin.
321
+ */
322
+ export interface SimSpec {
323
+ exclude?: boolean;
324
+ device?: string;
325
+ params?: string;
326
+ /** Built-in R/C/L: the value KiCad would infer the same model from. */
327
+ value?: string;
328
+ name?: string;
329
+ library?: boolean;
330
+ pins?: [string, string][];
331
+ }
332
+ export interface SchematicWire {
333
+ points: SchPoint[];
334
+ netId?: string;
335
+ }
336
+ export interface SchematicLabel {
337
+ name: string;
338
+ at: SchPoint;
339
+ kind: "local" | "global" | "hierarchical";
340
+ dir: SchPoint;
341
+ netId?: string;
342
+ floating?: boolean;
343
+ }
344
+ /**
345
+ * A Multisim bus line. Drawing only: bus members connect by name, through
346
+ * the labels placed at each bus entry's wire end.
347
+ */
348
+ export interface SchematicBus {
349
+ points: SchPoint[];
350
+ name: string;
351
+ members: string[];
352
+ }
353
+ /** A bus entry stub: `wire` is where the member's wire attaches, `bus` lies on the bus. */
354
+ export interface SchematicBusEntry {
355
+ wire: SchPoint;
356
+ bus: SchPoint;
357
+ member: string;
358
+ }
359
+ export interface SchematicText {
360
+ text: string;
361
+ at: SchPoint;
362
+ size: number;
363
+ }
364
+ /** A hierarchical block (sub-sheet instance) placed on a page. */
365
+ export interface SheetBlock {
366
+ id: string;
367
+ childSheet: string;
368
+ a: SchPoint;
369
+ b: SchPoint;
370
+ pins: {
371
+ name: string;
372
+ at: SchPoint;
373
+ attach?: SchPoint;
374
+ }[];
375
+ }
376
+ export interface SchematicSheet {
377
+ name: string;
378
+ title: string;
379
+ page: string;
380
+ blocks: SheetBlock[];
381
+ size: {
382
+ width: number;
383
+ height: number;
384
+ };
385
+ symbols: SchematicSymbol[];
386
+ wires: SchematicWire[];
387
+ labels: SchematicLabel[];
388
+ texts: SchematicText[];
389
+ buses: SchematicBus[];
390
+ busEntries: SchematicBusEntry[];
391
+ }
392
+ /** One instantiation of a unique sheet in the design hierarchy. */
393
+ export interface SchInstance {
394
+ sheet: string;
395
+ name: string;
396
+ blockId?: string;
397
+ parentPage?: string;
398
+ /** Final refdes by `${page}|${drawnKey}`; absent -> keep the drawn name. */
399
+ refdes: Record<string, string>;
400
+ /** Drawn -> final pin numbers by `${page}|${drawnKey}`. */
401
+ pinRemaps: Record<string, Record<string, string>>;
402
+ /** 1-based unit of a multi-section part by `${page}|${drawnKey}`. */
403
+ units: Record<string, number>;
404
+ children: SchInstance[];
405
+ }
406
+ export interface Schematic {
407
+ source: Source;
408
+ projectName: string;
409
+ rootSheet: string;
410
+ sheets: SchematicSheet[];
411
+ root: SchInstance;
412
+ /** SPICE model library for the simulator (models + wrappers); "" when none. */
413
+ spiceLibrary?: string;
414
+ warnings?: string[];
415
+ }
package/dist/load.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ export type DesignKind = "pcb" | "schematic";
2
+ export interface LoadedDesign {
3
+ kind: DesignKind;
4
+ /** Decompressed EW XML text. */
5
+ xml: string;
6
+ /** "binary" when decoded via ewd, "xml" when read as already-decoded text. */
7
+ via: "binary" | "xml";
8
+ }
9
+ /**
10
+ * Read an EW design from disk. Binary `.ewprj` / `.ms1x` containers are
11
+ * detected by magic bytes and decompressed in memory via `ewd`
12
+ * (electronics-workbench-decoder); anything else is treated as the XML that
13
+ * `ewd` would produce. The design kind comes from the XML root element, not
14
+ * the filename.
15
+ */
16
+ export declare function loadDesign(path: string): Promise<LoadedDesign>;
17
+ /** Output base name: strips `.xml` and the EW design extension. */
18
+ export declare function designBaseName(file: string): string;
package/dist/main.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ /** One KiCad project: an EW schematic and/or board sharing a base name. */
2
+ export interface ProjectInput {
3
+ base: string;
4
+ sch?: {
5
+ input: string;
6
+ xml: string;
7
+ };
8
+ pcb?: {
9
+ input: string;
10
+ xml: string;
11
+ };
12
+ }
13
+ /**
14
+ * Convert a project. With both halves present the outputs are linked the
15
+ * way KiCad's "Update PCB from Schematic" expects: each footprint carries its
16
+ * symbol's path / sheet name / sheet file, and each symbol names its
17
+ * footprint. See plans/converter.md, phase E.
18
+ */
19
+ export declare function convertProject(p: ProjectInput, outDir: string): Promise<string[]>;
20
+ export declare function convertPcb(input: string, xml: string, outDir: string): Promise<string>;
21
+ export declare function convertSch(input: string, xml: string, outDir: string): Promise<string>;
22
+ /**
23
+ * Group design files into projects: a schematic and a board in the same
24
+ * folder with the same base name (Main.ms14 + Main.ewprj) are one project.
25
+ * Directories contribute every design file directly inside them.
26
+ */
27
+ export declare function groupProjects(paths: string[]): Promise<ProjectInput[]>;
28
+ /** Convert one design file on its own (no pairing). */
29
+ export declare function convertFile(input: string, outDir?: string): Promise<string>;
30
+ /** The command line: `multisim2kicad [-o <outDir>] <inputs...>`. */
31
+ export declare function main(args?: string[]): Promise<void>;
32
+ /**
33
+ * An EW component database (`.prj` / `.usr`) -> KiCad libraries named after
34
+ * it: `<name>.pretty/` (+ fp-lib-table) and `<name>.kicad_sym` (+
35
+ * sym-lib-table), each symbol's Footprint pointing into the `.pretty` when
36
+ * the database holds its package. Phase F.
37
+ */
38
+ export declare function convertDatabase(input: string, outDir: string): Promise<void>;
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Multisim's `d_chip` behavioural logic -> ngspice XSPICE.
3
+ *
4
+ * Multisim describes most MSI logic (74xx counters, decoders, comparators,
5
+ * 4000-series registers, ...) with a `.MODEL <name> d_chip (behaviour="...")`
6
+ * whose string is a small table language:
7
+ *
8
+ * /inputs A B C pins, in the order the instance lists them
9
+ * /outputs Y Z
10
+ * /wires W1 W2 internal nets of the top level
11
+ * /module NAME ... /endmodule
12
+ * /instance NAME a b y a module instance (its inputs, then outputs)
13
+ * /table N N rows: input values, then output values
14
+ * /clock CLK +|-|X F S A F state flags; S synchronous rows (applied on
15
+ * the clock edge), then A asynchronous rows
16
+ * /delay N N rows: input output rise fall
17
+ * /conditional_delay N, /constraint N timing detail and checks
18
+ *
19
+ * Rows match top to bottom; the first that matches wins. Input values are
20
+ * `L`/`H`/`X` (don't care), one character per column, so `HHLL` covers four
21
+ * columns. A clocked module's columns are its inputs followed by its flags
22
+ * (`F0` = flag 0). Output values: `L`, `H`, `X`, `Z`, an input's name (or
23
+ * `~name`), `Fk` / `~Fk`, and `F+k` / `F-k`: bit k of the flags read as a
24
+ * binary number (F0 lowest) plus or minus one.
25
+ *
26
+ * Translation: each output of a table becomes an XSPICE `d_lut` over the
27
+ * columns it depends on; each flag a `d_dff` whose data input is a `d_lut`
28
+ * of the synchronous rows and whose set / reset inputs are `d_lut`s of the
29
+ * asynchronous rows; modules are flattened. Delays: a module output gets the
30
+ * largest rise / fall delay its `/delay` rows give it (per-path delays and
31
+ * conditional delays are folded into that one number); timing constraints
32
+ * are dropped.
33
+ */
34
+ interface Clock {
35
+ input: string;
36
+ edge: "+" | "-" | "X";
37
+ flags: number;
38
+ sync: string[][];
39
+ async: string[][];
40
+ }
41
+ interface Module {
42
+ name: string;
43
+ inputs: string[];
44
+ outputs: string[];
45
+ wires: string[];
46
+ clock?: Clock;
47
+ table?: string[][];
48
+ /** Output -> largest rise / fall delay in seconds. */
49
+ delays: Map<string, {
50
+ rise: number;
51
+ fall: number;
52
+ }>;
53
+ /** Output -> largest delay into / out of high-Z (rise = turn on, fall = turn off). */
54
+ zDelays: Map<string, {
55
+ rise: number;
56
+ fall: number;
57
+ }>;
58
+ instances: {
59
+ module: string;
60
+ args: string[];
61
+ }[];
62
+ }
63
+ export interface Chip {
64
+ top: Module;
65
+ modules: Map<string, Module>;
66
+ }
67
+ /** Parse a `d_chip` model's behaviour string. Throws on anything it doesn't know. */
68
+ export declare function parseChip(modelText: string): Chip;
69
+ /** A translated chip: its subcircuit's name and pin count. */
70
+ export interface DChip {
71
+ name: string;
72
+ pins: number;
73
+ inputs: number;
74
+ outputs: number;
75
+ /**
76
+ * Tri-state outputs (indexes into the outputs): each has an enable pin,
77
+ * 1 while it drives, after the outputs in the same order.
78
+ */
79
+ enables: number[];
80
+ }
81
+ /**
82
+ * A d_chip model as an ngspice subcircuit named `spiceName(name)`: pins are
83
+ * the chip's inputs, then its outputs.
84
+ */
85
+ export declare function dchipSubckt(name: string, modelText: string): DChip & {
86
+ text: string;
87
+ };
88
+ /**
89
+ * Translate every `.MODEL x d_chip (...)` in `text` into a subcircuit, and
90
+ * its `a...` instances in `text` into `x...` subcircuit calls. Generated
91
+ * subcircuits go to the top level, ahead of the rest (a model inside a
92
+ * `.subckt` would otherwise nest). `chips` is keyed by the lower-case model
93
+ * name, both as written and SPICE-safe. Models that fail to translate stay
94
+ * as they are, with the reason in `errors`.
95
+ */
96
+ export declare function translateDChips(text: string): {
97
+ text: string;
98
+ chips: Map<string, DChip>;
99
+ errors: string[];
100
+ };
101
+ /**
102
+ * `aName [in ...] [out ...] model` -> `xaName in ... out ... model` for
103
+ * translated chips. Templates often list more nodes than the chip declares
104
+ * (an IC variant's VCC / GND at the end of the outputs, an open-collector
105
+ * part's outputs read back at the end of the inputs); the chip never reads
106
+ * them, so trailing extras are dropped. Too few nodes is an error.
107
+ * Tri-state outputs' enable nodes are added to `enables`.
108
+ */
109
+ export declare function rewriteDChipInstances(text: string, chips: ReadonlyMap<string, DChip>, errors?: string[], enables?: Set<string>): string;
110
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Shared access to the EW XML document model from ewd.
3
+ *
4
+ * Every parser takes `XmlInput`: callers that run several parsers over one
5
+ * design parse the XML once (`parseEwXml`) and pass the document around;
6
+ * one-off callers can still pass the XML text.
7
+ */
8
+ import { type EwDocument, type EwElement } from "electronics-workbench-decoder";
9
+ export type { EwDocument, EwElement };
10
+ export { decodeEwString } from "electronics-workbench-decoder";
11
+ export type XmlInput = string | EwDocument;
12
+ export declare const docOf: (input: XmlInput) => EwDocument;
13
+ /**
14
+ * Text shown on a drawing (values, refdes, notes, pin names). The document
15
+ * model keeps attribute values raw; display text drops surrounding
16
+ * whitespace and uses LF line breaks (EW stores CRLF).
17
+ */
18
+ export declare const displayText: (s: string) => string;
@@ -0,0 +1,79 @@
1
+ import { type EwElement, type XmlInput } from "./doc.ts";
2
+ export interface NetPin {
3
+ refdes: string;
4
+ pin: string;
5
+ }
6
+ interface Mod {
7
+ mod: string;
8
+ value: string;
9
+ }
10
+ interface PinRec {
11
+ id: string;
12
+ owner: string;
13
+ ownerKind: string;
14
+ portId?: string;
15
+ pinNumber: string;
16
+ pinName: string;
17
+ mods: Mod[];
18
+ }
19
+ export interface PageIndex {
20
+ title: string;
21
+ page: string;
22
+ /** The page's DesignSheet element (for drawing extraction). */
23
+ designSheet: EwElement;
24
+ edges: [string, string][];
25
+ pins: PinRec[];
26
+ symbols: Map<string, {
27
+ kind: string;
28
+ ciComp: string;
29
+ obj: EwElement;
30
+ }>;
31
+ links: {
32
+ id: string;
33
+ mods: Mod[];
34
+ }[];
35
+ }
36
+ export interface SheetInstance {
37
+ /** "" for the root, else "/SC1/SC4"-style path of drawn instance names. */
38
+ path: string;
39
+ sheet: string;
40
+ /** Drawn instance name (e.g. "SC1") and final name (e.g. "H0"). */
41
+ name: string;
42
+ finalName: string;
43
+ /** Macro element ID on the parent page (for matching the sheet symbol). */
44
+ macroId?: string;
45
+ parentPath?: string;
46
+ parentPage?: string;
47
+ /** CIR path for one of this instance's pages. */
48
+ cirOf: (page: string) => string;
49
+ children: SheetInstance[];
50
+ }
51
+ export interface MultisimDesign {
52
+ rootTitle: string;
53
+ pages: PageIndex[];
54
+ root: SheetInstance;
55
+ /** Final refdes for a drawn part: (instance path, page, drawn refdes + section). */
56
+ finalRefdes(inst: SheetInstance, page: string, drawnKey: string): string | undefined;
57
+ /** CIR -> IR pin-number remap for a part, if any. */
58
+ pinRemap(inst: SheetInstance, page: string, drawnKey: string): Map<string, string> | undefined;
59
+ /** 1-based unit (section) of the final part this drawn symbol is, if multi-section. */
60
+ finalUnit(inst: SheetInstance, page: string, drawnKey: string): number | undefined;
61
+ /** Final refdes of each `CiComponent`, one per placement (a subcircuit used twice places it twice). */
62
+ finalNames(): Map<string, string[]>;
63
+ warnings: string[];
64
+ }
65
+ export interface CiItem {
66
+ cls: string;
67
+ body: EwElement;
68
+ }
69
+ export declare function parseMultisimDesign(input: XmlInput): MultisimDesign & {
70
+ ci: Map<string, CiItem>;
71
+ };
72
+ /**
73
+ * Multisim's flattened netlist (final refdes, final pin numbers), built from
74
+ * the drawing ID graph. This is the scorecard's reference.
75
+ */
76
+ export declare function flattenNetlist(design: ReturnType<typeof parseMultisimDesign>,
77
+ /** Filled with each net name users gave (lowercase; the root sheet's first, then deeper ones) -> its pins. */
78
+ named?: Map<string, NetPin[]>): Map<string, NetPin[]>;
79
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Board, Component } from "../ir/types.ts";
2
+ import { type XmlInput } from "./doc.ts";
3
+ /**
4
+ * The footprint in an Ultiboard library object (an EW database `UBLIB`
5
+ * blob: `<LibraryObject>` holding one `UBComponent` in its own frame, origin
6
+ * at the library RefPoint). Undefined when the object holds no component.
7
+ */
8
+ export declare function parseUbLibraryXml(input: XmlInput): Component | undefined;
9
+ export declare function parsePcbXml(input: XmlInput): Board;