@ifc-lite/codegen 1.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.
- package/INTEGRATION.md +354 -0
- package/LICENSE +373 -0
- package/README.md +101 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -0
- package/dist/express-parser.d.ts +75 -0
- package/dist/express-parser.d.ts.map +1 -0
- package/dist/express-parser.js +318 -0
- package/dist/express-parser.js.map +1 -0
- package/dist/generator.d.ts +10 -0
- package/dist/generator.d.ts.map +1 -0
- package/dist/generator.js +64 -0
- package/dist/generator.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/typescript-generator.d.ts +28 -0
- package/dist/typescript-generator.d.ts.map +1 -0
- package/dist/typescript-generator.js +400 -0
- package/dist/typescript-generator.js.map +1 -0
- package/generated/ifc4/entities.ts +6978 -0
- package/generated/ifc4/enums.ts +2471 -0
- package/generated/ifc4/index.ts +15 -0
- package/generated/ifc4/schema-registry.ts +60726 -0
- package/generated/ifc4/selects.ts +191 -0
- package/generated/ifc4/test-compile.ts +37 -0
- package/generated/ifc4/types.ts +3104 -0
- package/generated/ifc4x3/entities.ts +7836 -0
- package/generated/ifc4x3/enums.ts +3100 -0
- package/generated/ifc4x3/index.ts +15 -0
- package/generated/ifc4x3/schema-registry.ts +71023 -0
- package/generated/ifc4x3/selects.ts +194 -0
- package/generated/ifc4x3/types.ts +3707 -0
- package/package.json +32 -0
- package/schemas/IFC4X3.exp +13984 -0
- package/schemas/IFC4_ADD2_TC1.exp +12399 -0
- package/src/cli.ts +41 -0
- package/src/express-parser.ts +441 -0
- package/src/generator.ts +81 -0
- package/src/index.ts +31 -0
- package/src/typescript-generator.ts +496 -0
- package/test/express-parser.test.ts +363 -0
- package/test/integration.test.ts +246 -0
- package/test/typescript-generator.test.ts +348 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* IFC SELECT Types (Unions)
|
|
7
|
+
* Generated from EXPRESS schema: IFC4_ADD2_TC1
|
|
8
|
+
*
|
|
9
|
+
* DO NOT EDIT - This file is auto-generated
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** IfcActorSelect */
|
|
13
|
+
export type IfcActorSelect = IfcOrganization | IfcPerson | IfcPersonAndOrganization;
|
|
14
|
+
|
|
15
|
+
/** IfcAppliedValueSelect */
|
|
16
|
+
export type IfcAppliedValueSelect = IfcMeasureWithUnit | IfcReference | IfcValue;
|
|
17
|
+
|
|
18
|
+
/** IfcAxis2Placement */
|
|
19
|
+
export type IfcAxis2Placement = IfcAxis2Placement2D | IfcAxis2Placement3D;
|
|
20
|
+
|
|
21
|
+
/** IfcBendingParameterSelect */
|
|
22
|
+
export type IfcBendingParameterSelect = number | number;
|
|
23
|
+
|
|
24
|
+
/** IfcBooleanOperand */
|
|
25
|
+
export type IfcBooleanOperand = IfcBooleanResult | IfcCsgPrimitive3D | IfcHalfSpaceSolid | IfcSolidModel | IfcTessellatedFaceSet;
|
|
26
|
+
|
|
27
|
+
/** IfcClassificationReferenceSelect */
|
|
28
|
+
export type IfcClassificationReferenceSelect = IfcClassification | IfcClassificationReference;
|
|
29
|
+
|
|
30
|
+
/** IfcClassificationSelect */
|
|
31
|
+
export type IfcClassificationSelect = IfcClassification | IfcClassificationReference;
|
|
32
|
+
|
|
33
|
+
/** IfcColour */
|
|
34
|
+
export type IfcColour = IfcColourSpecification | IfcPreDefinedColour;
|
|
35
|
+
|
|
36
|
+
/** IfcColourOrFactor */
|
|
37
|
+
export type IfcColourOrFactor = IfcColourRgb | number;
|
|
38
|
+
|
|
39
|
+
/** IfcCoordinateReferenceSystemSelect */
|
|
40
|
+
export type IfcCoordinateReferenceSystemSelect = IfcCoordinateReferenceSystem | IfcGeometricRepresentationContext;
|
|
41
|
+
|
|
42
|
+
/** IfcCsgSelect */
|
|
43
|
+
export type IfcCsgSelect = IfcBooleanResult | IfcCsgPrimitive3D;
|
|
44
|
+
|
|
45
|
+
/** IfcCurveFontOrScaledCurveFontSelect */
|
|
46
|
+
export type IfcCurveFontOrScaledCurveFontSelect = IfcCurveStyleFontAndScaling | IfcCurveStyleFontSelect;
|
|
47
|
+
|
|
48
|
+
/** IfcCurveOnSurface */
|
|
49
|
+
export type IfcCurveOnSurface = IfcCompositeCurveOnSurface | IfcPcurve | IfcSurfaceCurve;
|
|
50
|
+
|
|
51
|
+
/** IfcCurveOrEdgeCurve */
|
|
52
|
+
export type IfcCurveOrEdgeCurve = IfcBoundedCurve | IfcEdgeCurve;
|
|
53
|
+
|
|
54
|
+
/** IfcCurveStyleFontSelect */
|
|
55
|
+
export type IfcCurveStyleFontSelect = IfcCurveStyleFont | IfcPreDefinedCurveFont;
|
|
56
|
+
|
|
57
|
+
/** IfcDefinitionSelect */
|
|
58
|
+
export type IfcDefinitionSelect = IfcObjectDefinition | IfcPropertyDefinition;
|
|
59
|
+
|
|
60
|
+
/** IfcDerivedMeasureValue */
|
|
61
|
+
export type IfcDerivedMeasureValue = number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number | number;
|
|
62
|
+
|
|
63
|
+
/** IfcDocumentSelect */
|
|
64
|
+
export type IfcDocumentSelect = IfcDocumentInformation | IfcDocumentReference;
|
|
65
|
+
|
|
66
|
+
/** IfcFillStyleSelect */
|
|
67
|
+
export type IfcFillStyleSelect = IfcColour | IfcExternallyDefinedHatchStyle | IfcFillAreaStyleHatching | IfcFillAreaStyleTiles;
|
|
68
|
+
|
|
69
|
+
/** IfcGeometricSetSelect */
|
|
70
|
+
export type IfcGeometricSetSelect = IfcCurve | IfcPoint | IfcSurface;
|
|
71
|
+
|
|
72
|
+
/** IfcGridPlacementDirectionSelect */
|
|
73
|
+
export type IfcGridPlacementDirectionSelect = IfcDirection | IfcVirtualGridIntersection;
|
|
74
|
+
|
|
75
|
+
/** IfcHatchLineDistanceSelect */
|
|
76
|
+
export type IfcHatchLineDistanceSelect = number | IfcVector;
|
|
77
|
+
|
|
78
|
+
/** IfcLayeredItem */
|
|
79
|
+
export type IfcLayeredItem = IfcRepresentation | IfcRepresentationItem;
|
|
80
|
+
|
|
81
|
+
/** IfcLibrarySelect */
|
|
82
|
+
export type IfcLibrarySelect = IfcLibraryInformation | IfcLibraryReference;
|
|
83
|
+
|
|
84
|
+
/** IfcLightDistributionDataSourceSelect */
|
|
85
|
+
export type IfcLightDistributionDataSourceSelect = IfcExternalReference | IfcLightIntensityDistribution;
|
|
86
|
+
|
|
87
|
+
/** IfcMaterialSelect */
|
|
88
|
+
export type IfcMaterialSelect = IfcMaterialDefinition | IfcMaterialList | IfcMaterialUsageDefinition;
|
|
89
|
+
|
|
90
|
+
/** IfcMeasureValue */
|
|
91
|
+
export type IfcMeasureValue = number | number | IfcComplexNumber | number | number | number | number | number | number | number | number | number | number | IfcParameterValue | number | number | number | number | number | number | number | number | number;
|
|
92
|
+
|
|
93
|
+
/** IfcMetricValueSelect */
|
|
94
|
+
export type IfcMetricValueSelect = IfcAppliedValue | IfcMeasureWithUnit | IfcReference | IfcTable | IfcTimeSeries | IfcValue;
|
|
95
|
+
|
|
96
|
+
/** IfcModulusOfRotationalSubgradeReactionSelect */
|
|
97
|
+
export type IfcModulusOfRotationalSubgradeReactionSelect = IfcBoolean | number;
|
|
98
|
+
|
|
99
|
+
/** IfcModulusOfSubgradeReactionSelect */
|
|
100
|
+
export type IfcModulusOfSubgradeReactionSelect = IfcBoolean | number;
|
|
101
|
+
|
|
102
|
+
/** IfcModulusOfTranslationalSubgradeReactionSelect */
|
|
103
|
+
export type IfcModulusOfTranslationalSubgradeReactionSelect = IfcBoolean | number;
|
|
104
|
+
|
|
105
|
+
/** IfcObjectReferenceSelect */
|
|
106
|
+
export type IfcObjectReferenceSelect = IfcAddress | IfcAppliedValue | IfcExternalReference | IfcMaterialDefinition | IfcOrganization | IfcPerson | IfcPersonAndOrganization | IfcTable | IfcTimeSeries;
|
|
107
|
+
|
|
108
|
+
/** IfcPointOrVertexPoint */
|
|
109
|
+
export type IfcPointOrVertexPoint = IfcPoint | IfcVertexPoint;
|
|
110
|
+
|
|
111
|
+
/** IfcPresentationStyleSelect */
|
|
112
|
+
export type IfcPresentationStyleSelect = IfcCurveStyle | IfcFillAreaStyle | IfcNullStyle | IfcSurfaceStyle | IfcTextStyle;
|
|
113
|
+
|
|
114
|
+
/** IfcProcessSelect */
|
|
115
|
+
export type IfcProcessSelect = IfcProcess | IfcTypeProcess;
|
|
116
|
+
|
|
117
|
+
/** IfcProductRepresentationSelect */
|
|
118
|
+
export type IfcProductRepresentationSelect = IfcProductDefinitionShape | IfcRepresentationMap;
|
|
119
|
+
|
|
120
|
+
/** IfcProductSelect */
|
|
121
|
+
export type IfcProductSelect = IfcProduct | IfcTypeProduct;
|
|
122
|
+
|
|
123
|
+
/** IfcPropertySetDefinitionSelect */
|
|
124
|
+
export type IfcPropertySetDefinitionSelect = IfcPropertySetDefinition | IfcPropertySetDefinitionSet;
|
|
125
|
+
|
|
126
|
+
/** IfcResourceObjectSelect */
|
|
127
|
+
export type IfcResourceObjectSelect = IfcActorRole | IfcAppliedValue | IfcApproval | IfcConstraint | IfcContextDependentUnit | IfcConversionBasedUnit | IfcExternalInformation | IfcExternalReference | IfcMaterialDefinition | IfcOrganization | IfcPerson | IfcPersonAndOrganization | IfcPhysicalQuantity | IfcProfileDef | IfcPropertyAbstraction | IfcTimeSeries;
|
|
128
|
+
|
|
129
|
+
/** IfcResourceSelect */
|
|
130
|
+
export type IfcResourceSelect = IfcResource | IfcTypeResource;
|
|
131
|
+
|
|
132
|
+
/** IfcRotationalStiffnessSelect */
|
|
133
|
+
export type IfcRotationalStiffnessSelect = IfcBoolean | number;
|
|
134
|
+
|
|
135
|
+
/** IfcSegmentIndexSelect */
|
|
136
|
+
export type IfcSegmentIndexSelect = IfcArcIndex | IfcLineIndex;
|
|
137
|
+
|
|
138
|
+
/** IfcShell */
|
|
139
|
+
export type IfcShell = IfcClosedShell | IfcOpenShell;
|
|
140
|
+
|
|
141
|
+
/** IfcSimpleValue */
|
|
142
|
+
export type IfcSimpleValue = IfcBinary | IfcBoolean | IfcDate | IfcDateTime | IfcDuration | IfcIdentifier | IfcInteger | IfcLabel | IfcLogical | IfcPositiveInteger | IfcReal | IfcText | IfcTime | IfcTimeStamp;
|
|
143
|
+
|
|
144
|
+
/** IfcSizeSelect */
|
|
145
|
+
export type IfcSizeSelect = number | number | number | number | number | number;
|
|
146
|
+
|
|
147
|
+
/** IfcSolidOrShell */
|
|
148
|
+
export type IfcSolidOrShell = IfcClosedShell | IfcSolidModel;
|
|
149
|
+
|
|
150
|
+
/** IfcSpaceBoundarySelect */
|
|
151
|
+
export type IfcSpaceBoundarySelect = IfcExternalSpatialElement | IfcSpace;
|
|
152
|
+
|
|
153
|
+
/** IfcSpecularHighlightSelect */
|
|
154
|
+
export type IfcSpecularHighlightSelect = IfcSpecularExponent | IfcSpecularRoughness;
|
|
155
|
+
|
|
156
|
+
/** IfcStructuralActivityAssignmentSelect */
|
|
157
|
+
export type IfcStructuralActivityAssignmentSelect = IfcElement | IfcStructuralItem;
|
|
158
|
+
|
|
159
|
+
/** IfcStyleAssignmentSelect */
|
|
160
|
+
export type IfcStyleAssignmentSelect = IfcPresentationStyle | IfcPresentationStyleAssignment;
|
|
161
|
+
|
|
162
|
+
/** IfcSurfaceOrFaceSurface */
|
|
163
|
+
export type IfcSurfaceOrFaceSurface = IfcFaceBasedSurfaceModel | IfcFaceSurface | IfcSurface;
|
|
164
|
+
|
|
165
|
+
/** IfcSurfaceStyleElementSelect */
|
|
166
|
+
export type IfcSurfaceStyleElementSelect = IfcExternallyDefinedSurfaceStyle | IfcSurfaceStyleLighting | IfcSurfaceStyleRefraction | IfcSurfaceStyleShading | IfcSurfaceStyleWithTextures;
|
|
167
|
+
|
|
168
|
+
/** IfcTextFontSelect */
|
|
169
|
+
export type IfcTextFontSelect = IfcExternallyDefinedTextFont | IfcPreDefinedTextFont;
|
|
170
|
+
|
|
171
|
+
/** IfcTimeOrRatioSelect */
|
|
172
|
+
export type IfcTimeOrRatioSelect = IfcDuration | number;
|
|
173
|
+
|
|
174
|
+
/** IfcTranslationalStiffnessSelect */
|
|
175
|
+
export type IfcTranslationalStiffnessSelect = IfcBoolean | number;
|
|
176
|
+
|
|
177
|
+
/** IfcTrimmingSelect */
|
|
178
|
+
export type IfcTrimmingSelect = IfcCartesianPoint | IfcParameterValue;
|
|
179
|
+
|
|
180
|
+
/** IfcUnit */
|
|
181
|
+
export type IfcUnit = IfcDerivedUnit | IfcMonetaryUnit | IfcNamedUnit;
|
|
182
|
+
|
|
183
|
+
/** IfcValue */
|
|
184
|
+
export type IfcValue = IfcDerivedMeasureValue | IfcMeasureValue | IfcSimpleValue;
|
|
185
|
+
|
|
186
|
+
/** IfcVectorOrDirection */
|
|
187
|
+
export type IfcVectorOrDirection = IfcDirection | IfcVector;
|
|
188
|
+
|
|
189
|
+
/** IfcWarpingStiffnessSelect */
|
|
190
|
+
export type IfcWarpingStiffnessSelect = IfcBoolean | number;
|
|
191
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
|
|
5
|
+
// Test file to verify generated types compile correctly
|
|
6
|
+
import type { IfcWall, IfcDoor, IfcWindow, IfcProject, IfcBuilding } from './entities';
|
|
7
|
+
import { IfcWallTypeEnum, IfcDoorTypeEnum } from './enums';
|
|
8
|
+
import { SCHEMA_REGISTRY, getEntityMetadata } from './schema-registry';
|
|
9
|
+
|
|
10
|
+
// Test: Create typed objects
|
|
11
|
+
const wall: IfcWall = {
|
|
12
|
+
GlobalId: 'abc123',
|
|
13
|
+
Name: 'Test Wall',
|
|
14
|
+
ObjectType: 'External Wall',
|
|
15
|
+
PredefinedType: IfcWallTypeEnum.SOLIDWALL,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const door: IfcDoor = {
|
|
19
|
+
GlobalId: 'door123',
|
|
20
|
+
Name: 'Main Door',
|
|
21
|
+
ObjectType: 'Entrance',
|
|
22
|
+
PredefinedType: IfcDoorTypeEnum.DOOR,
|
|
23
|
+
OverallHeight: 2.1,
|
|
24
|
+
OverallWidth: 0.9,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// Test: Use schema registry
|
|
28
|
+
const wallMetadata = getEntityMetadata('IfcWall');
|
|
29
|
+
console.log(wallMetadata?.name);
|
|
30
|
+
console.log(wallMetadata?.parent);
|
|
31
|
+
console.log(wallMetadata?.attributes);
|
|
32
|
+
|
|
33
|
+
// Test: Check entity count
|
|
34
|
+
const entityCount = Object.keys(SCHEMA_REGISTRY.entities).length;
|
|
35
|
+
console.log(`Total entities: ${entityCount}`);
|
|
36
|
+
|
|
37
|
+
export { wall, door, wallMetadata, entityCount };
|