@modular-circuit/ir 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -711,6 +711,21 @@ interface IR_GND extends PowerBase {
711
711
  param?: GroundParam;
712
712
  }
713
713
 
714
+ /**
715
+ * @since 0.1.1 Port generated by AI or manual mock data
716
+ */
717
+ interface AbstractPort extends IR_GraphItem {
718
+ port: PortLike | string;
719
+ }
720
+
721
+ /**
722
+ * @since 0.1.1 Block generated by AI or manual mock data
723
+ */
724
+ interface AbstractBlock extends IR_GraphItem {
725
+ name: string;
726
+ ports: AbstractPort[];
727
+ }
728
+
714
729
  interface IR_Junction extends IR_GraphItem {
715
730
  }
716
731
 
@@ -726,9 +741,10 @@ interface IR_PowerSym extends PowerBase {
726
741
  interface IR_Wire extends IR_GraphItem, Connection {
727
742
  }
728
743
 
744
+ type IR_BLOCK_T = IR_Block | AbstractBlock;
729
745
  interface IR_Graph extends IR_GraphItem {
730
746
  name?: string;
731
- blocks?: IR_Block[];
747
+ blocks?: IR_BLOCK_T[];
732
748
  wires?: IR_Wire[];
733
749
  gnd?: IR_GND[];
734
750
  pwr?: IR_PowerSym[];
@@ -736,6 +752,8 @@ interface IR_Graph extends IR_GraphItem {
736
752
  junctions?: IR_Junction[];
737
753
  }
738
754
 
755
+ declare const block_is_abstract: (block: IR_BLOCK_T) => block is AbstractBlock;
756
+
739
757
  declare const MODULAR_CIRCUIT_SCH_EXT = "modular_circuit";
740
758
 
741
- export { type Arc, type BASE_SYMBOL, type Bezier, type BlockBase, type BlockPort, type BomItem, type Bus, type BusAlias, type BusEntry, type Circle, type Component, type ComponentProperty, type ConcreteBlockDesign, type Design, type DesignPort, type Drawing, type EDA_DESIGN, type EDA_ITEM, type EDA_PORT_ANNOTATION, type EDA_PORT_ELECTRICAL_ANNOT, type EDA_TEXT, type EMBEDDED_FILE, type EMBEDDED_FILES, type Effects, FILE_TYPE, type Fill, type Font, type GeneralModuleDesign, type GlobalLabel, type GraphicItem, type HierarchicalLabel, type IR_Block, type IR_GND, type IR_Graph, type IR_GraphItem, type IR_Junction, type IR_Label, type IR_Port, type IR_PowerSym, type IR_Wire, type Junction, type Justify, KICAD_GND_NAME, type KiCadBlock, type LABEL_META, type LIB_SYMBOL, type LIB_SYMBOLS, type LabelType, MODULAR_CIRCUIT_EXT, MODULAR_CIRCUIT_SCH_EXT, type ModuleBlock, type ModuleBom, type ModuleCircuit, type ModuleCircuitId, type ModuleDesignBase, type ModuleIndex, type ModuleName, type ModuleResolver, type ModuleSpec, type NetLabel, type NoConnect, type PIN_ALTERNATE, type PIN_DEFINITION, type PIN_DISPLAY_OPT, type PIN_INSTANCE, PORT_ANNOT_TYPE, type Paper, PaperSize, type PaperSizeName, type Polyline, type Project, type ProjectDesign, type PublishedProjectDesign, type Rectangle, type ReusableDesign, type RuntimeModuleCircuit, type SCHEMATIC, type SCH_FIELD, type SCH_IMAGE, type SCH_ITEM, type SCH_ITEM_PROPERTY, type SCH_LABEL, type SCH_LINE, type SCH_SHEET, type SCH_SHEET_INSTANCE, type SCH_SHEET_PIN, type SCH_SYMBOL, type SCH_SYMBOL_META, type SCH_SYMBOL_PROPERTIES, type SCH_TEXT, type SCH_TEXT_BOX, type SERIALIZABLE, SHAPE_T, SHEET_FIELD_TYPE, type SYMBOL_INSTANCE, type SheetInstance, type SheetInstances, type Stroke, type Tag, type TextBox, type TitleBlock, block_is_associated_with_concrete_module, parse_eda_annotation };
759
+ export { type AbstractBlock, type AbstractPort, type Arc, type BASE_SYMBOL, type Bezier, type BlockBase, type BlockPort, type BomItem, type Bus, type BusAlias, type BusEntry, type Circle, type Component, type ComponentProperty, type ConcreteBlockDesign, type Design, type DesignPort, type Drawing, type EDA_DESIGN, type EDA_ITEM, type EDA_PORT_ANNOTATION, type EDA_PORT_ELECTRICAL_ANNOT, type EDA_TEXT, type EMBEDDED_FILE, type EMBEDDED_FILES, type Effects, FILE_TYPE, type Fill, type Font, type GeneralModuleDesign, type GlobalLabel, type GraphicItem, type HierarchicalLabel, type IR_BLOCK_T, type IR_Block, type IR_GND, type IR_Graph, type IR_GraphItem, type IR_Junction, type IR_Label, type IR_Port, type IR_PowerSym, type IR_Wire, type Junction, type Justify, KICAD_GND_NAME, type KiCadBlock, type LABEL_META, type LIB_SYMBOL, type LIB_SYMBOLS, type LabelType, MODULAR_CIRCUIT_EXT, MODULAR_CIRCUIT_SCH_EXT, type ModuleBlock, type ModuleBom, type ModuleCircuit, type ModuleCircuitId, type ModuleDesignBase, type ModuleIndex, type ModuleName, type ModuleResolver, type ModuleSpec, type NetLabel, type NoConnect, type PIN_ALTERNATE, type PIN_DEFINITION, type PIN_DISPLAY_OPT, type PIN_INSTANCE, PORT_ANNOT_TYPE, type Paper, PaperSize, type PaperSizeName, type Polyline, type Project, type ProjectDesign, type PublishedProjectDesign, type Rectangle, type ReusableDesign, type RuntimeModuleCircuit, type SCHEMATIC, type SCH_FIELD, type SCH_IMAGE, type SCH_ITEM, type SCH_ITEM_PROPERTY, type SCH_LABEL, type SCH_LINE, type SCH_SHEET, type SCH_SHEET_INSTANCE, type SCH_SHEET_PIN, type SCH_SYMBOL, type SCH_SYMBOL_META, type SCH_SYMBOL_PROPERTIES, type SCH_TEXT, type SCH_TEXT_BOX, type SERIALIZABLE, SHAPE_T, SHEET_FIELD_TYPE, type SYMBOL_INSTANCE, type SheetInstance, type SheetInstances, type Stroke, type Tag, type TextBox, type TitleBlock, block_is_abstract, block_is_associated_with_concrete_module, parse_eda_annotation };
package/dist/index.d.ts CHANGED
@@ -711,6 +711,21 @@ interface IR_GND extends PowerBase {
711
711
  param?: GroundParam;
712
712
  }
713
713
 
714
+ /**
715
+ * @since 0.1.1 Port generated by AI or manual mock data
716
+ */
717
+ interface AbstractPort extends IR_GraphItem {
718
+ port: PortLike | string;
719
+ }
720
+
721
+ /**
722
+ * @since 0.1.1 Block generated by AI or manual mock data
723
+ */
724
+ interface AbstractBlock extends IR_GraphItem {
725
+ name: string;
726
+ ports: AbstractPort[];
727
+ }
728
+
714
729
  interface IR_Junction extends IR_GraphItem {
715
730
  }
716
731
 
@@ -726,9 +741,10 @@ interface IR_PowerSym extends PowerBase {
726
741
  interface IR_Wire extends IR_GraphItem, Connection {
727
742
  }
728
743
 
744
+ type IR_BLOCK_T = IR_Block | AbstractBlock;
729
745
  interface IR_Graph extends IR_GraphItem {
730
746
  name?: string;
731
- blocks?: IR_Block[];
747
+ blocks?: IR_BLOCK_T[];
732
748
  wires?: IR_Wire[];
733
749
  gnd?: IR_GND[];
734
750
  pwr?: IR_PowerSym[];
@@ -736,6 +752,8 @@ interface IR_Graph extends IR_GraphItem {
736
752
  junctions?: IR_Junction[];
737
753
  }
738
754
 
755
+ declare const block_is_abstract: (block: IR_BLOCK_T) => block is AbstractBlock;
756
+
739
757
  declare const MODULAR_CIRCUIT_SCH_EXT = "modular_circuit";
740
758
 
741
- export { type Arc, type BASE_SYMBOL, type Bezier, type BlockBase, type BlockPort, type BomItem, type Bus, type BusAlias, type BusEntry, type Circle, type Component, type ComponentProperty, type ConcreteBlockDesign, type Design, type DesignPort, type Drawing, type EDA_DESIGN, type EDA_ITEM, type EDA_PORT_ANNOTATION, type EDA_PORT_ELECTRICAL_ANNOT, type EDA_TEXT, type EMBEDDED_FILE, type EMBEDDED_FILES, type Effects, FILE_TYPE, type Fill, type Font, type GeneralModuleDesign, type GlobalLabel, type GraphicItem, type HierarchicalLabel, type IR_Block, type IR_GND, type IR_Graph, type IR_GraphItem, type IR_Junction, type IR_Label, type IR_Port, type IR_PowerSym, type IR_Wire, type Junction, type Justify, KICAD_GND_NAME, type KiCadBlock, type LABEL_META, type LIB_SYMBOL, type LIB_SYMBOLS, type LabelType, MODULAR_CIRCUIT_EXT, MODULAR_CIRCUIT_SCH_EXT, type ModuleBlock, type ModuleBom, type ModuleCircuit, type ModuleCircuitId, type ModuleDesignBase, type ModuleIndex, type ModuleName, type ModuleResolver, type ModuleSpec, type NetLabel, type NoConnect, type PIN_ALTERNATE, type PIN_DEFINITION, type PIN_DISPLAY_OPT, type PIN_INSTANCE, PORT_ANNOT_TYPE, type Paper, PaperSize, type PaperSizeName, type Polyline, type Project, type ProjectDesign, type PublishedProjectDesign, type Rectangle, type ReusableDesign, type RuntimeModuleCircuit, type SCHEMATIC, type SCH_FIELD, type SCH_IMAGE, type SCH_ITEM, type SCH_ITEM_PROPERTY, type SCH_LABEL, type SCH_LINE, type SCH_SHEET, type SCH_SHEET_INSTANCE, type SCH_SHEET_PIN, type SCH_SYMBOL, type SCH_SYMBOL_META, type SCH_SYMBOL_PROPERTIES, type SCH_TEXT, type SCH_TEXT_BOX, type SERIALIZABLE, SHAPE_T, SHEET_FIELD_TYPE, type SYMBOL_INSTANCE, type SheetInstance, type SheetInstances, type Stroke, type Tag, type TextBox, type TitleBlock, block_is_associated_with_concrete_module, parse_eda_annotation };
759
+ export { type AbstractBlock, type AbstractPort, type Arc, type BASE_SYMBOL, type Bezier, type BlockBase, type BlockPort, type BomItem, type Bus, type BusAlias, type BusEntry, type Circle, type Component, type ComponentProperty, type ConcreteBlockDesign, type Design, type DesignPort, type Drawing, type EDA_DESIGN, type EDA_ITEM, type EDA_PORT_ANNOTATION, type EDA_PORT_ELECTRICAL_ANNOT, type EDA_TEXT, type EMBEDDED_FILE, type EMBEDDED_FILES, type Effects, FILE_TYPE, type Fill, type Font, type GeneralModuleDesign, type GlobalLabel, type GraphicItem, type HierarchicalLabel, type IR_BLOCK_T, type IR_Block, type IR_GND, type IR_Graph, type IR_GraphItem, type IR_Junction, type IR_Label, type IR_Port, type IR_PowerSym, type IR_Wire, type Junction, type Justify, KICAD_GND_NAME, type KiCadBlock, type LABEL_META, type LIB_SYMBOL, type LIB_SYMBOLS, type LabelType, MODULAR_CIRCUIT_EXT, MODULAR_CIRCUIT_SCH_EXT, type ModuleBlock, type ModuleBom, type ModuleCircuit, type ModuleCircuitId, type ModuleDesignBase, type ModuleIndex, type ModuleName, type ModuleResolver, type ModuleSpec, type NetLabel, type NoConnect, type PIN_ALTERNATE, type PIN_DEFINITION, type PIN_DISPLAY_OPT, type PIN_INSTANCE, PORT_ANNOT_TYPE, type Paper, PaperSize, type PaperSizeName, type Polyline, type Project, type ProjectDesign, type PublishedProjectDesign, type Rectangle, type ReusableDesign, type RuntimeModuleCircuit, type SCHEMATIC, type SCH_FIELD, type SCH_IMAGE, type SCH_ITEM, type SCH_ITEM_PROPERTY, type SCH_LABEL, type SCH_LINE, type SCH_SHEET, type SCH_SHEET_INSTANCE, type SCH_SHEET_PIN, type SCH_SYMBOL, type SCH_SYMBOL_META, type SCH_SYMBOL_PROPERTIES, type SCH_TEXT, type SCH_TEXT_BOX, type SERIALIZABLE, SHAPE_T, SHEET_FIELD_TYPE, type SYMBOL_INSTANCE, type SheetInstance, type SheetInstances, type Stroke, type Tag, type TextBox, type TitleBlock, block_is_abstract, block_is_associated_with_concrete_module, parse_eda_annotation };
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ __export(index_exports, {
28
28
  PaperSize: () => PaperSize,
29
29
  SHAPE_T: () => SHAPE_T,
30
30
  SHEET_FIELD_TYPE: () => SHEET_FIELD_TYPE,
31
+ block_is_abstract: () => block_is_abstract,
31
32
  block_is_associated_with_concrete_module: () => block_is_associated_with_concrete_module,
32
33
  parse_eda_annotation: () => parse_eda_annotation
33
34
  });
@@ -114,6 +115,11 @@ var block_is_associated_with_concrete_module = (block_type) => {
114
115
  return typeof block_type === "string";
115
116
  };
116
117
 
118
+ // src/graph/utils/block_is_abstract.ts
119
+ var block_is_abstract = (block) => {
120
+ return !("type" in block);
121
+ };
122
+
117
123
  // src/constraints/index.ts
118
124
  var MODULAR_CIRCUIT_SCH_EXT = "modular_circuit";
119
125
  // Annotate the CommonJS export names for ESM import in node:
@@ -126,6 +132,7 @@ var MODULAR_CIRCUIT_SCH_EXT = "modular_circuit";
126
132
  PaperSize,
127
133
  SHAPE_T,
128
134
  SHEET_FIELD_TYPE,
135
+ block_is_abstract,
129
136
  block_is_associated_with_concrete_module,
130
137
  parse_eda_annotation
131
138
  });
package/dist/index.mjs CHANGED
@@ -79,6 +79,11 @@ var block_is_associated_with_concrete_module = (block_type) => {
79
79
  return typeof block_type === "string";
80
80
  };
81
81
 
82
+ // src/graph/utils/block_is_abstract.ts
83
+ var block_is_abstract = (block) => {
84
+ return !("type" in block);
85
+ };
86
+
82
87
  // src/constraints/index.ts
83
88
  var MODULAR_CIRCUIT_SCH_EXT = "modular_circuit";
84
89
  export {
@@ -90,6 +95,7 @@ export {
90
95
  PaperSize,
91
96
  SHAPE_T,
92
97
  SHEET_FIELD_TYPE,
98
+ block_is_abstract,
93
99
  block_is_associated_with_concrete_module,
94
100
  parse_eda_annotation
95
101
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-circuit/ir",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Intermediate representation of the modular circuit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -8,8 +8,7 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": "./dist/index.mjs",
11
- "require": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
11
+ "require": "./dist/index.js"
13
12
  }
14
13
  },
15
14
  "files": [
@@ -27,7 +26,7 @@
27
26
  "typescript": "^5.4.5"
28
27
  },
29
28
  "dependencies": {
30
- "@modular-circuit/electronics-model": "0.1.0"
29
+ "@modular-circuit/electronics-model": "0.1.1"
31
30
  },
32
31
  "scripts": {
33
32
  "clean": "rimraf dist",