@bitbybit-dev/ifc 0.0.0-stage → 1.5.0-rc.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.
Files changed (242) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +42 -0
  3. package/README.md +92 -2
  4. package/index.d.ts +1 -0
  5. package/index.js +1 -0
  6. package/lib/api/dto-registry.d.ts +8 -0
  7. package/lib/api/dto-registry.js +109 -0
  8. package/lib/api/ifc-service.d.ts +109 -0
  9. package/lib/api/ifc-service.js +55 -0
  10. package/lib/api/inputs/base-inputs.d.ts +5 -0
  11. package/lib/api/inputs/base-inputs.js +5 -0
  12. package/lib/api/inputs/ifc-inputs.d.ts +2727 -0
  13. package/lib/api/inputs/ifc-inputs.js +2498 -0
  14. package/lib/api/inputs/index.d.ts +3 -0
  15. package/lib/api/inputs/index.js +3 -0
  16. package/lib/api/resolved-inputs/index.d.ts +70 -0
  17. package/lib/api/resolved-inputs/index.js +1 -0
  18. package/lib/api/services/assemblies.d.ts +28 -0
  19. package/lib/api/services/assemblies.js +49 -0
  20. package/lib/api/services/beams.d.ts +33 -0
  21. package/lib/api/services/beams.js +59 -0
  22. package/lib/api/services/columns.d.ts +26 -0
  23. package/lib/api/services/columns.js +56 -0
  24. package/lib/api/services/defaults.constants.d.ts +44 -0
  25. package/lib/api/services/defaults.constants.js +44 -0
  26. package/lib/api/services/doors.d.ts +45 -0
  27. package/lib/api/services/doors.js +94 -0
  28. package/lib/api/services/geometry.d.ts +51 -0
  29. package/lib/api/services/geometry.js +87 -0
  30. package/lib/api/services/index.d.ts +17 -0
  31. package/lib/api/services/index.js +17 -0
  32. package/lib/api/services/materials.d.ts +46 -0
  33. package/lib/api/services/materials.js +86 -0
  34. package/lib/api/services/member-support.d.ts +7 -0
  35. package/lib/api/services/member-support.js +29 -0
  36. package/lib/api/services/members.d.ts +24 -0
  37. package/lib/api/services/members.js +51 -0
  38. package/lib/api/services/model.d.ts +244 -0
  39. package/lib/api/services/model.js +409 -0
  40. package/lib/api/services/openings.d.ts +57 -0
  41. package/lib/api/services/openings.js +102 -0
  42. package/lib/api/services/properties.d.ts +89 -0
  43. package/lib/api/services/properties.js +142 -0
  44. package/lib/api/services/quantities.d.ts +38 -0
  45. package/lib/api/services/quantities.js +51 -0
  46. package/lib/api/services/roofs.d.ts +24 -0
  47. package/lib/api/services/roofs.js +52 -0
  48. package/lib/api/services/service-support.d.ts +8 -0
  49. package/lib/api/services/service-support.js +37 -0
  50. package/lib/api/services/service-types.d.ts +3 -0
  51. package/lib/api/services/service-types.js +1 -0
  52. package/lib/api/services/site.d.ts +37 -0
  53. package/lib/api/services/site.js +80 -0
  54. package/lib/api/services/slabs.d.ts +31 -0
  55. package/lib/api/services/slabs.js +59 -0
  56. package/lib/api/services/spaces.d.ts +36 -0
  57. package/lib/api/services/spaces.js +64 -0
  58. package/lib/api/services/spatial.d.ts +54 -0
  59. package/lib/api/services/spatial.js +75 -0
  60. package/lib/api/services/walls.d.ts +140 -0
  61. package/lib/api/services/walls.js +268 -0
  62. package/lib/api/services/windows.d.ts +46 -0
  63. package/lib/api/services/windows.js +76 -0
  64. package/lib/build/assemblies.d.ts +4 -0
  65. package/lib/build/assemblies.js +45 -0
  66. package/lib/build/build-types.d.ts +345 -0
  67. package/lib/build/build-types.js +1 -0
  68. package/lib/build/checks.d.ts +6 -0
  69. package/lib/build/checks.js +32 -0
  70. package/lib/build/constants.d.ts +27 -0
  71. package/lib/build/constants.js +43 -0
  72. package/lib/build/contexts.d.ts +9 -0
  73. package/lib/build/contexts.js +52 -0
  74. package/lib/build/curves.d.ts +3 -0
  75. package/lib/build/curves.js +23 -0
  76. package/lib/build/entity-writer.d.ts +23 -0
  77. package/lib/build/entity-writer.js +97 -0
  78. package/lib/build/fillings.d.ts +7 -0
  79. package/lib/build/fillings.js +182 -0
  80. package/lib/build/georeference.d.ts +5 -0
  81. package/lib/build/georeference.js +44 -0
  82. package/lib/build/materials.d.ts +18 -0
  83. package/lib/build/materials.js +166 -0
  84. package/lib/build/math.d.ts +10 -0
  85. package/lib/build/math.js +47 -0
  86. package/lib/build/measure.d.ts +9 -0
  87. package/lib/build/measure.js +195 -0
  88. package/lib/build/moving.d.ts +4 -0
  89. package/lib/build/moving.js +61 -0
  90. package/lib/build/openings.d.ts +12 -0
  91. package/lib/build/openings.js +156 -0
  92. package/lib/build/outlines.d.ts +4 -0
  93. package/lib/build/outlines.js +40 -0
  94. package/lib/build/placement.d.ts +16 -0
  95. package/lib/build/placement.js +106 -0
  96. package/lib/build/profiles.d.ts +4 -0
  97. package/lib/build/profiles.js +35 -0
  98. package/lib/build/project.d.ts +11 -0
  99. package/lib/build/project.js +134 -0
  100. package/lib/build/properties.d.ts +10 -0
  101. package/lib/build/properties.js +182 -0
  102. package/lib/build/quantities.d.ts +7 -0
  103. package/lib/build/quantities.js +262 -0
  104. package/lib/build/relationships.d.ts +9 -0
  105. package/lib/build/relationships.js +67 -0
  106. package/lib/build/removal.d.ts +3 -0
  107. package/lib/build/removal.js +106 -0
  108. package/lib/build/representations.d.ts +6 -0
  109. package/lib/build/representations.js +46 -0
  110. package/lib/build/roof-clipping.d.ts +5 -0
  111. package/lib/build/roof-clipping.js +79 -0
  112. package/lib/build/roofs.d.ts +4 -0
  113. package/lib/build/roofs.js +131 -0
  114. package/lib/build/site.d.ts +7 -0
  115. package/lib/build/site.js +112 -0
  116. package/lib/build/slab-openings.d.ts +4 -0
  117. package/lib/build/slab-openings.js +71 -0
  118. package/lib/build/slabs-columns-beams.d.ts +8 -0
  119. package/lib/build/slabs-columns-beams.js +73 -0
  120. package/lib/build/solids.d.ts +5 -0
  121. package/lib/build/solids.js +33 -0
  122. package/lib/build/spaces.d.ts +6 -0
  123. package/lib/build/spaces.js +55 -0
  124. package/lib/build/spatial.d.ts +17 -0
  125. package/lib/build/spatial.js +111 -0
  126. package/lib/build/type-objects.d.ts +4 -0
  127. package/lib/build/type-objects.js +9 -0
  128. package/lib/build/wall-edits.d.ts +5 -0
  129. package/lib/build/wall-edits.js +138 -0
  130. package/lib/build/wall-geometry.d.ts +15 -0
  131. package/lib/build/wall-geometry.js +159 -0
  132. package/lib/build/wall-parameters.d.ts +3 -0
  133. package/lib/build/wall-parameters.js +47 -0
  134. package/lib/build/walls.d.ts +12 -0
  135. package/lib/build/walls.js +238 -0
  136. package/lib/geometry/advanced.d.ts +27 -0
  137. package/lib/geometry/advanced.js +292 -0
  138. package/lib/geometry/colours.d.ts +3 -0
  139. package/lib/geometry/colours.js +109 -0
  140. package/lib/geometry/curves.d.ts +32 -0
  141. package/lib/geometry/curves.js +370 -0
  142. package/lib/geometry/edges.constants.d.ts +5 -0
  143. package/lib/geometry/edges.constants.js +5 -0
  144. package/lib/geometry/edges.d.ts +21 -0
  145. package/lib/geometry/edges.js +164 -0
  146. package/lib/geometry/elements.d.ts +3 -0
  147. package/lib/geometry/elements.js +152 -0
  148. package/lib/geometry/errors.d.ts +3 -0
  149. package/lib/geometry/errors.js +6 -0
  150. package/lib/geometry/faceted.d.ts +31 -0
  151. package/lib/geometry/faceted.js +214 -0
  152. package/lib/geometry/geometry-types.d.ts +103 -0
  153. package/lib/geometry/geometry-types.js +1 -0
  154. package/lib/geometry/groups.d.ts +21 -0
  155. package/lib/geometry/groups.js +106 -0
  156. package/lib/geometry/items.d.ts +34 -0
  157. package/lib/geometry/items.js +313 -0
  158. package/lib/geometry/operators.d.ts +3 -0
  159. package/lib/geometry/operators.js +65 -0
  160. package/lib/geometry/profiles.d.ts +4 -0
  161. package/lib/geometry/profiles.js +277 -0
  162. package/lib/geometry/recipe-builder.d.ts +14 -0
  163. package/lib/geometry/recipe-builder.js +48 -0
  164. package/lib/geometry/references.d.ts +4 -0
  165. package/lib/geometry/references.js +17 -0
  166. package/lib/geometry/regions.d.ts +4 -0
  167. package/lib/geometry/regions.js +26 -0
  168. package/lib/geometry/surfaces.constants.d.ts +17 -0
  169. package/lib/geometry/surfaces.constants.js +17 -0
  170. package/lib/geometry/surfaces.d.ts +6 -0
  171. package/lib/geometry/surfaces.js +306 -0
  172. package/lib/geometry/swept-solids.constants.d.ts +7 -0
  173. package/lib/geometry/swept-solids.constants.js +6 -0
  174. package/lib/geometry/swept-solids.d.ts +25 -0
  175. package/lib/geometry/swept-solids.js +243 -0
  176. package/lib/index.d.ts +6 -0
  177. package/lib/index.js +6 -0
  178. package/lib/model/constants.d.ts +30 -0
  179. package/lib/model/constants.js +30 -0
  180. package/lib/model/entity-lookup.d.ts +9 -0
  181. package/lib/model/entity-lookup.js +20 -0
  182. package/lib/model/guid.d.ts +7 -0
  183. package/lib/model/guid.js +60 -0
  184. package/lib/model/id-map.d.ts +10 -0
  185. package/lib/model/id-map.js +80 -0
  186. package/lib/model/index.d.ts +4 -0
  187. package/lib/model/index.js +2 -0
  188. package/lib/model/io.d.ts +6 -0
  189. package/lib/model/io.js +136 -0
  190. package/lib/model/is-model.d.ts +9 -0
  191. package/lib/model/is-model.js +11 -0
  192. package/lib/model/model-types.d.ts +111 -0
  193. package/lib/model/model-types.js +1 -0
  194. package/lib/model/overlay-indexes.d.ts +17 -0
  195. package/lib/model/overlay-indexes.js +69 -0
  196. package/lib/model/references.d.ts +2 -0
  197. package/lib/model/references.js +51 -0
  198. package/lib/model/rows-by-id.d.ts +8 -0
  199. package/lib/model/rows-by-id.js +39 -0
  200. package/lib/model/snapshot.d.ts +36 -0
  201. package/lib/model/snapshot.js +144 -0
  202. package/lib/model/source.d.ts +29 -0
  203. package/lib/model/source.js +172 -0
  204. package/lib/model/transaction.d.ts +39 -0
  205. package/lib/model/transaction.js +250 -0
  206. package/lib/model/upgrade.d.ts +2 -0
  207. package/lib/model/upgrade.js +78 -0
  208. package/lib/schema/constants.d.ts +3 -0
  209. package/lib/schema/constants.js +3 -0
  210. package/lib/schema/generated/ifc4.d.ts +2 -0
  211. package/lib/schema/generated/ifc4.js +1204 -0
  212. package/lib/schema/generated/ifc4x3.d.ts +2 -0
  213. package/lib/schema/generated/ifc4x3.js +1325 -0
  214. package/lib/schema/registry.d.ts +7 -0
  215. package/lib/schema/registry.js +37 -0
  216. package/lib/schema/schema-types.d.ts +45 -0
  217. package/lib/schema/schema-types.js +1 -0
  218. package/lib/schema/schema.d.ts +23 -0
  219. package/lib/schema/schema.js +136 -0
  220. package/lib/step/constants.d.ts +48 -0
  221. package/lib/step/constants.js +48 -0
  222. package/lib/step/encoder.d.ts +21 -0
  223. package/lib/step/encoder.js +321 -0
  224. package/lib/step/errors.d.ts +39 -0
  225. package/lib/step/errors.js +45 -0
  226. package/lib/step/file-index.d.ts +2 -0
  227. package/lib/step/file-index.js +221 -0
  228. package/lib/step/header.d.ts +4 -0
  229. package/lib/step/header.js +52 -0
  230. package/lib/step/numbers.d.ts +3 -0
  231. package/lib/step/numbers.js +73 -0
  232. package/lib/step/reader.d.ts +2 -0
  233. package/lib/step/reader.js +160 -0
  234. package/lib/step/scanner.d.ts +13 -0
  235. package/lib/step/scanner.js +203 -0
  236. package/lib/step/step-types.d.ts +170 -0
  237. package/lib/step/step-types.js +1 -0
  238. package/lib/step/strings.d.ts +2 -0
  239. package/lib/step/strings.js +150 -0
  240. package/lib/step/values.d.ts +13 -0
  241. package/lib/step/values.js +51 -0
  242. package/package.json +51 -5
@@ -0,0 +1,7 @@
1
+ import { IfcSchema } from "./schema";
2
+ export declare const SUPPORTED_SCHEMAS: readonly string[];
3
+ export declare function describeSupportedSchemas(): string;
4
+ export declare function isEditableSchema(name: string): boolean;
5
+ export declare function isSupportedSchema(identifier: string): boolean;
6
+ export declare function readingSchemaFor(identifier: string): IfcSchema | undefined;
7
+ export declare function schemaNamed(identifier: string): IfcSchema;
@@ -0,0 +1,37 @@
1
+ import { IFC4_SCHEMA } from "./generated/ifc4";
2
+ import { IFC4X3_ADD2_SCHEMA } from "./generated/ifc4x3";
3
+ import { IfcSchema } from "./schema";
4
+ const loaded = new Map();
5
+ const TABLES = new Map([[IFC4_SCHEMA.name, IFC4_SCHEMA], [IFC4X3_ADD2_SCHEMA.name, IFC4X3_ADD2_SCHEMA]]);
6
+ const READ_THROUGH = new Map([["IFC2X3", IFC4_SCHEMA.name], ["IFC4X3", IFC4X3_ADD2_SCHEMA.name]]);
7
+ const EDITABLE = new Set([IFC4_SCHEMA.name]);
8
+ export const SUPPORTED_SCHEMAS = [...TABLES.keys()];
9
+ export function describeSupportedSchemas() {
10
+ const through = [...READ_THROUGH].map(([file, table]) => `${file} through ${table}`);
11
+ return `${SUPPORTED_SCHEMAS.join(" and ")}, with ${through.join(" and ")}`;
12
+ }
13
+ export function isEditableSchema(name) {
14
+ return EDITABLE.has(name.trim().toUpperCase());
15
+ }
16
+ export function isSupportedSchema(identifier) {
17
+ return TABLES.has(identifier.trim().toUpperCase());
18
+ }
19
+ export function readingSchemaFor(identifier) {
20
+ const name = identifier.trim().toUpperCase();
21
+ const through = READ_THROUGH.get(name);
22
+ return TABLES.has(name) ? schemaNamed(name) : through === undefined ? undefined : schemaNamed(through);
23
+ }
24
+ export function schemaNamed(identifier) {
25
+ const name = identifier.trim().toUpperCase();
26
+ const known = loaded.get(name);
27
+ if (known) {
28
+ return known;
29
+ }
30
+ const table = TABLES.get(name);
31
+ if (!table) {
32
+ throw new Error(`The IFC schema ${identifier} is not supported; supported: ${SUPPORTED_SCHEMAS.join(", ")}`);
33
+ }
34
+ const schema = new IfcSchema(table);
35
+ loaded.set(name, schema);
36
+ return schema;
37
+ }
@@ -0,0 +1,45 @@
1
+ export type IfcAggregateKind = "LIST" | "SET" | "ARRAY" | "BAG";
2
+ export type IfcTypeSpec = string | IfcAggregateSpec;
3
+ export type IfcAggregateSpec = readonly [IfcAggregateKind, number, number | null, IfcTypeSpec];
4
+ export type CompactAttribute = readonly [string, IfcTypeSpec] | readonly [string, IfcTypeSpec, 1];
5
+ export type CompactInverse = readonly [string, IfcTypeSpec, string];
6
+ export interface CompactEntity {
7
+ readonly p: string | null;
8
+ readonly a: readonly CompactAttribute[];
9
+ readonly abs?: 1;
10
+ readonly d?: readonly string[];
11
+ readonly i?: readonly CompactInverse[];
12
+ }
13
+ export interface CompactDefinedType {
14
+ readonly t: IfcTypeSpec;
15
+ }
16
+ export interface CompactEnumerationType {
17
+ readonly e: readonly string[];
18
+ }
19
+ export interface CompactSelectType {
20
+ readonly s: readonly string[];
21
+ }
22
+ export type CompactType = CompactDefinedType | CompactEnumerationType | CompactSelectType;
23
+ export interface CompactSchema {
24
+ readonly name: string;
25
+ readonly release: string;
26
+ readonly types: Readonly<Record<string, CompactType>>;
27
+ readonly entities: Readonly<Record<string, CompactEntity>>;
28
+ }
29
+ export interface IfcAttributeInfo {
30
+ readonly name: string;
31
+ readonly type: IfcTypeSpec;
32
+ readonly optional: boolean;
33
+ readonly derived: boolean;
34
+ }
35
+ export interface IfcEntityInfo {
36
+ readonly name: string;
37
+ readonly supertype: string | null;
38
+ readonly abstract: boolean;
39
+ readonly attributes: readonly IfcAttributeInfo[];
40
+ readonly positions: ReadonlyMap<string, number>;
41
+ }
42
+ export interface SelectContents {
43
+ readonly entities: readonly string[];
44
+ readonly valueTypes: ReadonlySet<string>;
45
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { CompactSchema, CompactType, IfcEntityInfo, IfcTypeSpec, SelectContents } from "./schema-types";
2
+ export declare const SIMPLE_TYPES: ReadonlySet<string>;
3
+ export declare class IfcSchema {
4
+ readonly name: string;
5
+ readonly release: string;
6
+ private readonly table;
7
+ private readonly entityNames;
8
+ private readonly typeNames;
9
+ private readonly infos;
10
+ private subtypeLists;
11
+ private readonly selects;
12
+ constructor(table: CompactSchema);
13
+ entityName(name: string): string | undefined;
14
+ typeName(name: string): string | undefined;
15
+ hasEntity(name: string): boolean;
16
+ type(name: string): CompactType | undefined;
17
+ entity(name: string): IfcEntityInfo;
18
+ isSubtypeOf(name: string, ancestor: string): boolean;
19
+ subtypesOf(name: string): readonly string[];
20
+ selectContents(select: string): SelectContents;
21
+ underlying(spec: IfcTypeSpec): IfcTypeSpec;
22
+ private build;
23
+ }
@@ -0,0 +1,136 @@
1
+ export const SIMPLE_TYPES = new Set(["REAL", "INTEGER", "NUMBER", "STRING", "BOOLEAN", "LOGICAL", "BINARY"]);
2
+ export class IfcSchema {
3
+ constructor(table) {
4
+ this.infos = new Map();
5
+ this.selects = new Map();
6
+ this.table = table;
7
+ this.name = table.name;
8
+ this.release = table.release;
9
+ this.entityNames = new Map(Object.keys(table.entities).flatMap((name) => [[name, name], [name.toUpperCase(), name]]));
10
+ this.typeNames = new Map(Object.keys(table.types).map((name) => [name.toUpperCase(), name]));
11
+ }
12
+ entityName(name) {
13
+ var _a;
14
+ return (_a = this.entityNames.get(name)) !== null && _a !== void 0 ? _a : this.entityNames.get(name.toUpperCase());
15
+ }
16
+ typeName(name) {
17
+ return this.typeNames.get(name.toUpperCase());
18
+ }
19
+ hasEntity(name) {
20
+ return this.entityNames.has(name.toUpperCase());
21
+ }
22
+ type(name) {
23
+ const canonical = this.typeName(name);
24
+ return canonical === undefined ? undefined : this.table.types[canonical];
25
+ }
26
+ entity(name) {
27
+ const canonical = this.entityName(name);
28
+ if (canonical === undefined) {
29
+ throw new Error(`${this.name} has no entity named ${name}`);
30
+ }
31
+ const known = this.infos.get(canonical);
32
+ if (known) {
33
+ return known;
34
+ }
35
+ const info = this.build(canonical);
36
+ this.infos.set(canonical, info);
37
+ return info;
38
+ }
39
+ isSubtypeOf(name, ancestor) {
40
+ var _a;
41
+ const target = this.entityName(ancestor);
42
+ for (let current = this.entityName(name); current; current = (_a = this.table.entities[current]) === null || _a === void 0 ? void 0 : _a.p) {
43
+ if (current === target) {
44
+ return true;
45
+ }
46
+ }
47
+ return false;
48
+ }
49
+ subtypesOf(name) {
50
+ var _a, _b, _c;
51
+ const canonical = this.entityName(name);
52
+ if (canonical === undefined) {
53
+ return [];
54
+ }
55
+ if (!this.subtypeLists) {
56
+ this.subtypeLists = new Map();
57
+ for (const entity of Object.keys(this.table.entities)) {
58
+ for (let current = entity; current; current = (_a = this.table.entities[current]) === null || _a === void 0 ? void 0 : _a.p) {
59
+ const list = (_b = this.subtypeLists.get(current)) !== null && _b !== void 0 ? _b : [];
60
+ list.push(entity);
61
+ this.subtypeLists.set(current, list);
62
+ }
63
+ }
64
+ }
65
+ return (_c = this.subtypeLists.get(canonical)) !== null && _c !== void 0 ? _c : [];
66
+ }
67
+ selectContents(select) {
68
+ const known = this.selects.get(select);
69
+ if (known) {
70
+ return known;
71
+ }
72
+ const entities = [];
73
+ const valueTypes = new Set();
74
+ const seen = new Set();
75
+ const visit = (name) => {
76
+ if (seen.has(name)) {
77
+ return;
78
+ }
79
+ seen.add(name);
80
+ const entity = this.entityName(name);
81
+ if (entity !== undefined) {
82
+ entities.push(entity);
83
+ return;
84
+ }
85
+ const type = this.type(name);
86
+ if (type && "s" in type) {
87
+ type.s.forEach(visit);
88
+ }
89
+ else if (type) {
90
+ valueTypes.add(this.typeName(name));
91
+ }
92
+ };
93
+ visit(select);
94
+ const contents = { entities, valueTypes };
95
+ this.selects.set(select, contents);
96
+ return contents;
97
+ }
98
+ underlying(spec) {
99
+ let current = spec;
100
+ for (;;) {
101
+ if (typeof current !== "string") {
102
+ return current;
103
+ }
104
+ const type = this.type(current);
105
+ if (!type || !("t" in type)) {
106
+ return current;
107
+ }
108
+ current = type.t;
109
+ }
110
+ }
111
+ build(name) {
112
+ var _a, _b, _c;
113
+ const chain = [];
114
+ for (let current = name; current; current = (_a = this.table.entities[current]) === null || _a === void 0 ? void 0 : _a.p) {
115
+ chain.unshift(current);
116
+ }
117
+ const derived = new Set();
118
+ for (const link of chain) {
119
+ (_c = (_b = this.table.entities[link]) === null || _b === void 0 ? void 0 : _b.d) === null || _c === void 0 ? void 0 : _c.forEach((attribute) => derived.add(attribute));
120
+ }
121
+ const attributes = [];
122
+ for (const link of chain) {
123
+ for (const attribute of this.table.entities[link].a) {
124
+ attributes.push({ name: attribute[0], type: attribute[1], optional: attribute[2] === 1, derived: derived.has(attribute[0]) });
125
+ }
126
+ }
127
+ const entity = this.table.entities[name];
128
+ return {
129
+ name,
130
+ supertype: entity.p,
131
+ abstract: entity.abs === 1,
132
+ attributes,
133
+ positions: new Map(attributes.map((attribute, index) => [attribute.name, index])),
134
+ };
135
+ }
136
+ }
@@ -0,0 +1,48 @@
1
+ export declare const PRINTABLE_FIRST = 32;
2
+ export declare const PRINTABLE_LAST = 126;
3
+ export declare const BMP_LIMIT = 65535;
4
+ export declare const MAX_CODE_POINT = 1114111;
5
+ export declare const HEX_RADIX = 16;
6
+ export declare const DECIMAL_RADIX = 10;
7
+ export declare const UCS2_DIGITS = 4;
8
+ export declare const UCS4_DIGITS = 8;
9
+ export declare const BYTE_DIGITS = 2;
10
+ export declare const UPPER_HALF_OFFSET = 128;
11
+ export declare const CHARACTERS_PER_CHUNK = 8192;
12
+ export declare const LATIN1_PART = 1;
13
+ export declare const MAX_NESTING = 64;
14
+ export declare const INITIAL_ROWS = 1024;
15
+ export declare const MAX_EXPRESS_ID = 2147483647;
16
+ export declare const MAX_FILE_BYTES: number;
17
+ export declare const MAX_TYPE_CODES = 65536;
18
+ export declare const TYPE_HASH_PRIME = 16777619;
19
+ export declare const UPPER_CASE_OFFSET = 32;
20
+ export declare const BOM: readonly [239, 187, 191];
21
+ export declare const CHAR_HASH = 35;
22
+ export declare const CHAR_EQUALS = 61;
23
+ export declare const CHAR_OPEN = 40;
24
+ export declare const CHAR_CLOSE = 41;
25
+ export declare const CHAR_COMMA = 44;
26
+ export declare const CHAR_SEMICOLON = 59;
27
+ export declare const CHAR_APOSTROPHE = 39;
28
+ export declare const CHAR_QUOTE = 34;
29
+ export declare const CHAR_DOT = 46;
30
+ export declare const CHAR_DOLLAR = 36;
31
+ export declare const CHAR_STAR = 42;
32
+ export declare const CHAR_SLASH = 47;
33
+ export declare const CHAR_MINUS = 45;
34
+ export declare const CHAR_PLUS = 43;
35
+ export declare const CHAR_ZERO = 48;
36
+ export declare const CHAR_NINE = 57;
37
+ export declare const CHAR_UPPER_A = 65;
38
+ export declare const CHAR_UPPER_Z = 90;
39
+ export declare const CHAR_LOWER_A = 97;
40
+ export declare const CHAR_LOWER_Z = 122;
41
+ export declare const CHAR_UNDERSCORE = 95;
42
+ export declare const CHAR_UPPER_E = 69;
43
+ export declare const CHAR_LOWER_E = 101;
44
+ export declare const CHAR_SPACE = 32;
45
+ export declare const CHAR_BACKSLASH = 92;
46
+ export declare const CHAR_TILDE = 126;
47
+ export declare const DEFAULT_IMPLEMENTATION_LEVEL = "2;1";
48
+ export declare const HEADER_ENTITIES_READ: readonly ["FILE_DESCRIPTION", "FILE_NAME", "FILE_SCHEMA"];
@@ -0,0 +1,48 @@
1
+ export const PRINTABLE_FIRST = 0x20;
2
+ export const PRINTABLE_LAST = 0x7e;
3
+ export const BMP_LIMIT = 0xffff;
4
+ export const MAX_CODE_POINT = 0x10ffff;
5
+ export const HEX_RADIX = 16;
6
+ export const DECIMAL_RADIX = 10;
7
+ export const UCS2_DIGITS = 4;
8
+ export const UCS4_DIGITS = 8;
9
+ export const BYTE_DIGITS = 2;
10
+ export const UPPER_HALF_OFFSET = 0x80;
11
+ export const CHARACTERS_PER_CHUNK = 8192;
12
+ export const LATIN1_PART = 1;
13
+ export const MAX_NESTING = 64;
14
+ export const INITIAL_ROWS = 1024;
15
+ export const MAX_EXPRESS_ID = 2147483647;
16
+ export const MAX_FILE_BYTES = Math.pow(2, 32) - 1;
17
+ export const MAX_TYPE_CODES = 0x10000;
18
+ export const TYPE_HASH_PRIME = 16777619;
19
+ export const UPPER_CASE_OFFSET = 0x20;
20
+ export const BOM = [0xef, 0xbb, 0xbf];
21
+ export const CHAR_HASH = 0x23;
22
+ export const CHAR_EQUALS = 0x3d;
23
+ export const CHAR_OPEN = 0x28;
24
+ export const CHAR_CLOSE = 0x29;
25
+ export const CHAR_COMMA = 0x2c;
26
+ export const CHAR_SEMICOLON = 0x3b;
27
+ export const CHAR_APOSTROPHE = 0x27;
28
+ export const CHAR_QUOTE = 0x22;
29
+ export const CHAR_DOT = 0x2e;
30
+ export const CHAR_DOLLAR = 0x24;
31
+ export const CHAR_STAR = 0x2a;
32
+ export const CHAR_SLASH = 0x2f;
33
+ export const CHAR_MINUS = 0x2d;
34
+ export const CHAR_PLUS = 0x2b;
35
+ export const CHAR_ZERO = 0x30;
36
+ export const CHAR_NINE = 0x39;
37
+ export const CHAR_UPPER_A = 0x41;
38
+ export const CHAR_UPPER_Z = 0x5a;
39
+ export const CHAR_LOWER_A = 0x61;
40
+ export const CHAR_LOWER_Z = 0x7a;
41
+ export const CHAR_UNDERSCORE = 0x5f;
42
+ export const CHAR_UPPER_E = 0x45;
43
+ export const CHAR_LOWER_E = 0x65;
44
+ export const CHAR_SPACE = 0x20;
45
+ export const CHAR_BACKSLASH = 0x5c;
46
+ export const CHAR_TILDE = 0x7e;
47
+ export const DEFAULT_IMPLEMENTATION_LEVEL = "2;1";
48
+ export const HEADER_ENTITIES_READ = ["FILE_DESCRIPTION", "FILE_NAME", "FILE_SCHEMA"];
@@ -0,0 +1,21 @@
1
+ import type { IfcSchema } from "../schema/schema";
2
+ import type { IfcEntityInfo, IfcTypeSpec } from "../schema/schema-types";
3
+ import type { IfcEntity, IfcValue } from "./step-types";
4
+ export declare class IfcEncoder {
5
+ private readonly schema;
6
+ constructor(schema: IfcSchema);
7
+ normalizeArguments(type: string, args: readonly IfcValue[], path: string): IfcValue[];
8
+ normalizeAttribute(info: IfcEntityInfo, index: number, value: IfcValue, path: string): IfcValue;
9
+ encodeEntity(entity: IfcEntity): string;
10
+ encodeValue(spec: IfcTypeSpec, value: IfcValue, path: string): string;
11
+ private writable;
12
+ private located;
13
+ private enumMember;
14
+ private selected;
15
+ private definedValue;
16
+ private checkGlobalId;
17
+ private normalize;
18
+ private normalizeList;
19
+ private format;
20
+ }
21
+ export declare function encoderFor(schema: IfcSchema): IfcEncoder;