@ifc-lite/export 2.9.4 → 3.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.
Files changed (72) hide show
  1. package/dist/csv-cell.d.ts +101 -0
  2. package/dist/csv-cell.d.ts.map +1 -0
  3. package/dist/csv-cell.js +90 -0
  4. package/dist/csv-cell.js.map +1 -0
  5. package/dist/demesh-session.d.ts.map +1 -1
  6. package/dist/demesh-session.js +2 -1
  7. package/dist/demesh-session.js.map +1 -1
  8. package/dist/effective-index.js +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +9 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/lod1-generator.d.ts +0 -2
  14. package/dist/lod1-generator.d.ts.map +1 -1
  15. package/dist/lod1-generator.js +1 -1
  16. package/dist/lod1-generator.js.map +1 -1
  17. package/dist/merged-exporter.d.ts.map +1 -1
  18. package/dist/merged-exporter.js +23 -41
  19. package/dist/merged-exporter.js.map +1 -1
  20. package/dist/reference-collector.js +1 -1
  21. package/dist/step-attribute-mutations.d.ts +91 -0
  22. package/dist/step-attribute-mutations.d.ts.map +1 -0
  23. package/dist/step-attribute-mutations.js +302 -0
  24. package/dist/step-attribute-mutations.js.map +1 -0
  25. package/dist/step-collection.d.ts +55 -0
  26. package/dist/step-collection.d.ts.map +1 -0
  27. package/dist/step-collection.js +125 -0
  28. package/dist/step-collection.js.map +1 -0
  29. package/dist/step-export-contexts.d.ts +63 -0
  30. package/dist/step-export-contexts.d.ts.map +1 -0
  31. package/dist/step-export-contexts.js +51 -0
  32. package/dist/step-export-contexts.js.map +1 -0
  33. package/dist/step-export-types.d.ts +262 -0
  34. package/dist/step-export-types.d.ts.map +1 -0
  35. package/dist/step-export-types.js +22 -0
  36. package/dist/step-export-types.js.map +1 -0
  37. package/dist/step-exporter.d.ts +20 -351
  38. package/dist/step-exporter.d.ts.map +1 -1
  39. package/dist/step-exporter.js +73 -1257
  40. package/dist/step-exporter.js.map +1 -1
  41. package/dist/step-geometry-types.d.ts +19 -0
  42. package/dist/step-geometry-types.d.ts.map +1 -0
  43. package/dist/step-geometry-types.js +57 -0
  44. package/dist/step-geometry-types.js.map +1 -0
  45. package/dist/step-header.d.ts +43 -0
  46. package/dist/step-header.d.ts.map +1 -0
  47. package/dist/step-header.js +70 -0
  48. package/dist/step-header.js.map +1 -0
  49. package/dist/step-omission-predicates.d.ts +51 -0
  50. package/dist/step-omission-predicates.d.ts.map +1 -0
  51. package/dist/step-omission-predicates.js +268 -0
  52. package/dist/step-omission-predicates.js.map +1 -0
  53. package/dist/step-overlay-entities.d.ts +64 -0
  54. package/dist/step-overlay-entities.d.ts.map +1 -0
  55. package/dist/step-overlay-entities.js +119 -0
  56. package/dist/step-overlay-entities.js.map +1 -0
  57. package/dist/step-pass-builder.d.ts +44 -0
  58. package/dist/step-pass-builder.d.ts.map +1 -0
  59. package/dist/step-pass-builder.js +249 -0
  60. package/dist/step-pass-builder.js.map +1 -0
  61. package/dist/step-property-sets.d.ts +7 -5
  62. package/dist/step-property-sets.d.ts.map +1 -1
  63. package/dist/step-property-sets.js.map +1 -1
  64. package/dist/step-serialization.d.ts +16 -1
  65. package/dist/step-serialization.d.ts.map +1 -1
  66. package/dist/step-serialization.js +50 -3
  67. package/dist/step-serialization.js.map +1 -1
  68. package/dist/step-source-iteration.d.ts +95 -0
  69. package/dist/step-source-iteration.d.ts.map +1 -0
  70. package/dist/step-source-iteration.js +178 -0
  71. package/dist/step-source-iteration.js.map +1 -0
  72. package/package.json +7 -7
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The collection phase of `StepExporter.export()` (#2475, the collection
3
+ * block): builds the visible-only closure (`pass.allowedEntityIds` /
4
+ * `hiddenProductIds`), groups the overlay's mutation history by entity and
5
+ * kind, and applies the georeferencing edits. Nothing here WRITES a STEP
6
+ * line — every write happens in a later phase (`step-source-iteration.ts`,
7
+ * `step-property-sets.ts`, `step-georeferencing.ts`'s own new-entity lines,
8
+ * `step-overlay-entities.ts`) that reads what this phase left on `pass`.
9
+ *
10
+ * `PropertyMutationGroups` (`step-property-sets.ts`) already names the
11
+ * boundary this module sits behind: "the mutation groupings `export()`
12
+ * builds before the collection phase runs." This is that builder, plus the
13
+ * two collection calls (`buildRelDefinesByPropertiesIndex` /
14
+ * `collectPropertyAndQuantitySetMutations`) it was already handing them to.
15
+ *
16
+ * `hasAnyUnreadableSourceRef` and the `mayNameOmittedRefs` /
17
+ * `isOmittedFromOutput` predicates it feeds do NOT live here: they read
18
+ * `pass.effective` and this phase's OUTPUT (`allowedEntityIds`,
19
+ * `overlayActive`), but nothing in THIS module reads them back, so moving them
20
+ * here would not shrink a dependency, only relocate it. That argument was
21
+ * always about this module specifically. They live in
22
+ * `step-omission-predicates.ts`, called from `export()` immediately after this
23
+ * phase returns (#2475).
24
+ */
25
+ import type { IfcDataStore } from '@ifc-lite/parser';
26
+ import type { MutablePropertyView } from '@ifc-lite/mutations';
27
+ import { type PropertySetContext } from './step-property-sets.js';
28
+ import { type GeorefContext } from './step-georeferencing.js';
29
+ import type { ExportPass, StepExportOptions } from './step-exporter.js';
30
+ /**
31
+ * The exporter state this phase cannot read off the pass.
32
+ *
33
+ * `propertySetContext` and `georefContext` are thunks, not values, matching
34
+ * every other call site of theirs in `export()`: this phase calls
35
+ * `propertySetContext()` twice (once for `buildRelDefinesByPropertiesIndex`,
36
+ * once for `collectPropertyAndQuantitySetMutations`) and moving that call
37
+ * out from under the two sites — deriving one value up front instead —
38
+ * would be a behaviour change nothing here asked for.
39
+ */
40
+ export interface CollectionContext {
41
+ readonly dataStore: IfcDataStore;
42
+ readonly mutationView: MutablePropertyView | null;
43
+ readonly propertySetContext: () => PropertySetContext;
44
+ readonly georefContext: (deltaOnly: boolean) => GeorefContext;
45
+ }
46
+ /**
47
+ * Populate `pass` with everything the overlay's edits and `options` imply,
48
+ * in place. The caller owns three gates and this phase does not re-derive
49
+ * any of them: `applyMutations` (`options.applyMutations !== false`, read
50
+ * once in `export()` — see the "read ONCE" comment there for why a second
51
+ * read would be a bug, not a style choice), `options.visibleOnly`, and
52
+ * `options.georefMutations`.
53
+ */
54
+ export declare function collectModifications(pass: ExportPass, options: StepExportOptions, applyMutations: boolean, ctx: CollectionContext): void;
55
+ //# sourceMappingURL=step-collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-collection.d.ts","sourceRoot":"","sources":["../src/step-collection.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;IACtD,QAAQ,CAAC,aAAa,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,aAAa,CAAC;CAC/D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EAAE,OAAO,EACvB,GAAG,EAAE,iBAAiB,GACrB,IAAI,CAsIN"}
@@ -0,0 +1,125 @@
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
+ import { collectReferencedEntityIds, getVisibleEntityIds, collectStyleEntities } from './reference-collector.js';
5
+ import { buildRelDefinesByPropertiesIndex, collectPropertyAndQuantitySetMutations, } from './step-property-sets.js';
6
+ import { applyGeoreferencingMutations } from './step-georeferencing.js';
7
+ /**
8
+ * Populate `pass` with everything the overlay's edits and `options` imply,
9
+ * in place. The caller owns three gates and this phase does not re-derive
10
+ * any of them: `applyMutations` (`options.applyMutations !== false`, read
11
+ * once in `export()` — see the "read ONCE" comment there for why a second
12
+ * read would be a bug, not a style choice), `options.visibleOnly`, and
13
+ * `options.georefMutations`.
14
+ */
15
+ export function collectModifications(pass, options, applyMutations, ctx) {
16
+ if (options.visibleOnly && ctx.dataStore.source) {
17
+ const visible = getVisibleEntityIds(ctx.dataStore, options.hiddenEntityIds ?? new Set(), options.isolatedEntityIds ?? null, pass.effective);
18
+ pass.hiddenProductIds = visible.hiddenProductIds;
19
+ pass.allowedEntityIds = collectReferencedEntityIds(visible.roots, ctx.dataStore.source, pass.effective, visible.hiddenProductIds, pass.isRefExcludedDuringClosureWalk);
20
+ // Second pass: collect IFCSTYLEDITEM entities that reference included
21
+ // geometry. Styled items reference geometry items but nothing references
22
+ // them back, so the forward closure misses them.
23
+ collectStyleEntities(pass.allowedEntityIds, ctx.dataStore.source, { byId: pass.effective, byType: pass.effective.byType });
24
+ }
25
+ // Process mutations if we have a mutation view
26
+ if (ctx.mutationView && applyMutations) {
27
+ const mutationView = ctx.mutationView;
28
+ const mutations = mutationView.getMutations();
29
+ // Attribute values come from the *overlay*, never from the mutation
30
+ // history. The history is append-only and undo writes its reverse edit
31
+ // with `skipHistory: true`, so a superseded UPDATE_ATTRIBUTE record keeps
32
+ // its stale `newValue` forever — replaying it resurrects edits the user
33
+ // undid (#1957). The overlay is what the editor shows, and it is already
34
+ // the source for psets, quantities, positional attributes and retypes
35
+ // below, so attributes were the sole outlier.
36
+ for (const [entityId, attrs] of mutationView.getAttributeMutationsByEntity()) {
37
+ pass.modifiedEntities.add(entityId);
38
+ let target = pass.modifiedAttributes.get(entityId);
39
+ if (!target) {
40
+ target = new Map();
41
+ pass.modifiedAttributes.set(entityId, target);
42
+ }
43
+ for (const [name, value] of attrs)
44
+ target.set(name, value);
45
+ }
46
+ // Group mutations by entity, separating property vs quantity mutations
47
+ const entityPropMutations = new Map();
48
+ const entityQuantMutations = new Map();
49
+ for (const mutation of mutations) {
50
+ // Handled above, off the overlay. Skipped explicitly because an
51
+ // UPDATE_ATTRIBUTE record can also carry a `psetName` (georef fields
52
+ // encode their target entity there) and must not be mistaken for a
53
+ // property-set edit.
54
+ if (mutation.type === 'UPDATE_ATTRIBUTE')
55
+ continue;
56
+ if (!mutation.psetName)
57
+ continue;
58
+ const isQuantity = mutation.type === 'CREATE_QUANTITY' || mutation.type === 'UPDATE_QUANTITY'
59
+ || mutation.type === 'DELETE_QUANTITY' || mutation.type === 'DELETE_QUANTITY_SET';
60
+ const targetMap = isQuantity ? entityQuantMutations : entityPropMutations;
61
+ if (!targetMap.has(mutation.entityId)) {
62
+ targetMap.set(mutation.entityId, new Set());
63
+ }
64
+ targetMap.get(mutation.entityId).add(mutation.psetName);
65
+ }
66
+ // Build a reverse index of IfcRelDefinesByProperties → (relId, psetId)
67
+ // pairs keyed on each related entity. The two property/quantity loops
68
+ // below previously walked every entity in `entityIndex.byId` per
69
+ // modified entity (O(E·N)); the index keeps the per-entity step
70
+ // O(K) where K is the number of rels referencing that entity.
71
+ const { byEntity: relDefinesByEntity, relatedByRel } = buildRelDefinesByPropertiesIndex(ctx.propertySetContext());
72
+ // A source IfcRelDefinesByProperties whose EVERY related object the
73
+ // session deleted has nothing left to relate, and emitting it leaves a
74
+ // `#id` pointing at a record the export skipped. Dropped only when all of
75
+ // them are gone: a rel that still names a live entity is that entity's
76
+ // only link to its psets, and nothing here rewrites a RelatedObjects list.
77
+ for (const [relId, related] of relatedByRel) {
78
+ if (related.length > 0 && related.every((id) => pass.effective.isDeleted(id))) {
79
+ pass.skipRelationshipIds.add(relId);
80
+ }
81
+ }
82
+ collectPropertyAndQuantitySetMutations(pass, options, { entityPropMutations, entityQuantMutations, relDefinesByEntity }, ctx.propertySetContext());
83
+ for (const [entityId] of pass.modifiedAttributes) {
84
+ // An overlay-CREATED entity carrying attribute edits is emitted once,
85
+ // by the new-entities pass, and already counted in `newEntityCount`.
86
+ // Counting it here too made the header claim two affected entities for
87
+ // one created-then-renamed wall.
88
+ if (pass.isOverlayCreated(entityId))
89
+ continue;
90
+ // A source entity with no bytes never gets its line rewritten (the
91
+ // source-iteration pass skips it), so an attribute edit against it
92
+ // must not inflate the count either.
93
+ if (!pass.hasEmittableHostBytes(entityId))
94
+ continue;
95
+ // Under `deltaOnly` this only NOMINATES the host's ATTRIBUTE edits:
96
+ // nothing writes an in-place attribute edit into a delta except the
97
+ // type-object line rewrite, so the ledger drops it at settle time
98
+ // unless that pass reports having carried it (#2462). That nomination
99
+ // is deliberately made at INTENT: the per-kind warning exists to NAME
100
+ // an edit the delta could not carry, and an undeliverable edit is
101
+ // exactly the one that must still be named.
102
+ //
103
+ // A FULL export has no such warning, so an edit that resolved to
104
+ // nothing has nothing to say and nothing to claim — it waits for the
105
+ // rewrite instead. `setAttribute` to the value already in the slot, and
106
+ // `setAttribute` naming a slot the class does not declare, both leave
107
+ // the line byte-identical and used to count anyway (#2483).
108
+ //
109
+ // Recorded unconditionally. It used to be skipped for a host that also
110
+ // had a pset or qset edit, because the count was per entity and the
111
+ // other loop had already nominated it — which is exactly what let a
112
+ // pset emission mark the rename delivered and suppress its warning. The
113
+ // ledger de-duplicates the COUNT per entity now, so the two edits can
114
+ // and must be nominated separately.
115
+ pass.inPlaceNominees.attribute.add(entityId);
116
+ if (options.deltaOnly === true)
117
+ pass.modifications.nominate(entityId, 'attribute');
118
+ }
119
+ }
120
+ // Process georeferencing mutations (only when applyMutations is enabled)
121
+ if (applyMutations && options.georefMutations) {
122
+ applyGeoreferencingMutations(pass, options.georefMutations, ctx.georefContext(options.deltaOnly === true));
123
+ }
124
+ }
125
+ //# sourceMappingURL=step-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-collection.js","sourceRoot":"","sources":["../src/step-collection.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA6B/D,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACjH,OAAO,EACL,gCAAgC,EAChC,sCAAsC,GAEvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAsB,MAAM,0BAA0B,CAAC;AAoB5F;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAgB,EAChB,OAA0B,EAC1B,cAAuB,EACvB,GAAsB;IAEtB,IAAI,OAAO,CAAC,WAAW,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,OAAO,GAAG,mBAAmB,CACjC,GAAG,CAAC,SAAS,EACb,OAAO,CAAC,eAAe,IAAI,IAAI,GAAG,EAAE,EACpC,OAAO,CAAC,iBAAiB,IAAI,IAAI,EACjC,IAAI,CAAC,SAAS,CACf,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,0BAA0B,CAChD,OAAO,CAAC,KAAK,EACb,GAAG,CAAC,SAAS,CAAC,MAAM,EACpB,IAAI,CAAC,SAAS,EACd,OAAO,CAAC,gBAAgB,EACxB,IAAI,CAAC,8BAA8B,CACpC,CAAC;QACF,sEAAsE;QACtE,yEAAyE;QACzE,iDAAiD;QACjD,oBAAoB,CAClB,IAAI,CAAC,gBAAgB,EACrB,GAAG,CAAC,SAAS,CAAC,MAAM,EACpB,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CACxD,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,IAAI,GAAG,CAAC,YAAY,IAAI,cAAc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AAkB,EAAE,CAAC;YACjD,sEAAsE;YACtE,qEAAqE;YACrE,uEAAuE;YACvE,iCAAiC;YACjC,IAAI,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;gBAAE,SAAS;YAC9C,mEAAmE;YACnE,mEAAmE;YACnE,qCAAqC;YACrC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC;gBAAE,SAAS;YACpD,oEAAoE;YACpE,oEAAoE;YACpE,kEAAkE;YAClE,sEAAsE;YACtE,sEAAsE;YACtE,kEAAkE;YAClE,4CAA4C;YAC5C,EAAE;YACF,iEAAiE;YACjE,qEAAqE;YACrE,wEAAwE;YACxE,sEAAsE;YACtE,4DAA4D;YAC5D,EAAE;YACF,uEAAuE;YACvE,oEAAoE;YACpE,oEAAoE;YACpE,wEAAwE;YACxE,sEAAsE;YACtE,oCAAoC;YACpC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC7C,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI;gBAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;IAED,yEAAyE;IACzE,IAAI,cAAc,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC9C,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC;IAC7G,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The per-phase contexts that do NOT allocate express ids.
3
+ *
4
+ * Split out of `StepExporter` for #2475. These two are pure forwarders: they
5
+ * assemble what a phase cannot read off the pass, out of values handed to
6
+ * them, and touch no exporter state of their own.
7
+ *
8
+ * WHY ONLY THESE TWO. `georefContext` and `propertySetContext` stay methods on
9
+ * `StepExporter`, and `collectionContext` stays with them because it forwards
10
+ * to both. Those two are the only places that mint express ids, via
11
+ * `allocateExpressId: () => this.nextExpressId++` — two closures over ONE
12
+ * instance counter. Moving them would mean re-establishing that shared
13
+ * identity through a parameter, and capturing the counter's value instead of
14
+ * its closure gives each builder its own sequence, silently emitting two
15
+ * entities with the same `#N` — well-formed STEP in which every reference
16
+ * still resolves, and two different entities.
17
+ *
18
+ * That failure used to be invisible: `findDanglingRefs` collects defined ids
19
+ * into a `Set`, which absorbs a duplicate rather than reporting it. It is now
20
+ * caught — `step-georeferencing.test.ts`'s "mints distinct ids for generated
21
+ * psets and for created georeferencing" drives both allocating paths in one
22
+ * export and asserts no id is defined twice. Freezing both closures fails that
23
+ * test and only that test.
24
+ *
25
+ * So the reason this module holds two functions rather than five is written
26
+ * down here AND checkable, which is the only reason it is safe to leave the
27
+ * other three where they are.
28
+ */
29
+ import type { IfcDataStore } from '@ifc-lite/parser';
30
+ import type { MutablePropertyView } from '@ifc-lite/mutations';
31
+ import type { SourceIterationContext } from './step-source-iteration.js';
32
+ import type { OverlayEntitiesContext } from './step-overlay-entities.js';
33
+ import type { PropertySetContext } from './step-property-sets.js';
34
+ /**
35
+ * The state `step-source-iteration.ts` cannot read off the pass (#2475 2d).
36
+ *
37
+ * No `allocateExpressId`: that phase never allocates an id, it only rewrites
38
+ * lines that already have one. `applySourceLineMutations` (a free function in
39
+ * `step-attribute-mutations.ts`, closed over `mutationView` here) and
40
+ * `isGeometryEntity` are injected rather than read off the pass because each
41
+ * has readers outside this phase — the mutation pipeline is shared with the
42
+ * type-object `HasPropertySets` rewrite (see `StepExporter`'s
43
+ * `propertySetContext`, which stays a method because it mints express ids) and
44
+ * with the overlay-created-entities block in `export()`; `isGeometryEntity`
45
+ * with the visible-only setup closure and that same block.
46
+ *
47
+ * `propertySetContext` arrives as a THUNK, not a value: the phase calls it
48
+ * per use and the original method rebuilt it per call, which is the behaviour
49
+ * being preserved.
50
+ */
51
+ export declare function buildSourceIterationContext(dataStore: IfcDataStore, mutationView: MutablePropertyView | null, propertySetContext: () => PropertySetContext): SourceIterationContext;
52
+ /**
53
+ * The state `step-overlay-entities.ts` cannot read off the pass (#2475
54
+ * step 2e). `applyOverlayEntityOverrides` is the free function
55
+ * `step-attribute-mutations.ts` exports — it and its two
56
+ * `serializeNamedAttribute` / `serializePositionalOverride` helpers moved
57
+ * together, since those two have no reader outside this cluster;
58
+ * `isGeometryEntity` and `relationshipWithheldWarning` are the same shared
59
+ * readers {@link buildSourceIterationContext} already injects into the other
60
+ * output pass.
61
+ */
62
+ export declare function buildOverlayEntitiesContext(mutationView: MutablePropertyView | null): OverlayEntitiesContext;
63
+ //# sourceMappingURL=step-export-contexts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-export-contexts.d.ts","sourceRoot":"","sources":["../src/step-export-contexts.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,YAAY,EACvB,YAAY,EAAE,mBAAmB,GAAG,IAAI,EACxC,kBAAkB,EAAE,MAAM,kBAAkB,GAC3C,sBAAsB,CASxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,mBAAmB,GAAG,IAAI,GACvC,sBAAsB,CAOxB"}
@@ -0,0 +1,51 @@
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
+ import { applySourceLineMutations, applyOverlayEntityOverrides } from './step-attribute-mutations.js';
5
+ import { relationshipWithheldWarning } from './step-export-types.js';
6
+ import { isGeometryEntity } from './step-geometry-types.js';
7
+ /**
8
+ * The state `step-source-iteration.ts` cannot read off the pass (#2475 2d).
9
+ *
10
+ * No `allocateExpressId`: that phase never allocates an id, it only rewrites
11
+ * lines that already have one. `applySourceLineMutations` (a free function in
12
+ * `step-attribute-mutations.ts`, closed over `mutationView` here) and
13
+ * `isGeometryEntity` are injected rather than read off the pass because each
14
+ * has readers outside this phase — the mutation pipeline is shared with the
15
+ * type-object `HasPropertySets` rewrite (see `StepExporter`'s
16
+ * `propertySetContext`, which stays a method because it mints express ids) and
17
+ * with the overlay-created-entities block in `export()`; `isGeometryEntity`
18
+ * with the visible-only setup closure and that same block.
19
+ *
20
+ * `propertySetContext` arrives as a THUNK, not a value: the phase calls it
21
+ * per use and the original method rebuilt it per call, which is the behaviour
22
+ * being preserved.
23
+ */
24
+ export function buildSourceIterationContext(dataStore, mutationView, propertySetContext) {
25
+ return {
26
+ dataStore,
27
+ applySourceLineMutations: (expressId, entityText, recordType, attributeMutations, sourceSchema, overlayActive, onRejected) => applySourceLineMutations(mutationView, expressId, entityText, recordType, attributeMutations, sourceSchema, overlayActive, onRejected),
28
+ isGeometryEntity,
29
+ propertySetContext,
30
+ relationshipWithheldWarning,
31
+ };
32
+ }
33
+ /**
34
+ * The state `step-overlay-entities.ts` cannot read off the pass (#2475
35
+ * step 2e). `applyOverlayEntityOverrides` is the free function
36
+ * `step-attribute-mutations.ts` exports — it and its two
37
+ * `serializeNamedAttribute` / `serializePositionalOverride` helpers moved
38
+ * together, since those two have no reader outside this cluster;
39
+ * `isGeometryEntity` and `relationshipWithheldWarning` are the same shared
40
+ * readers {@link buildSourceIterationContext} already injects into the other
41
+ * output pass.
42
+ */
43
+ export function buildOverlayEntitiesContext(mutationView) {
44
+ return {
45
+ mutationView,
46
+ applyOverlayEntityOverrides,
47
+ isGeometryEntity,
48
+ relationshipWithheldWarning,
49
+ };
50
+ }
51
+ //# sourceMappingURL=step-export-contexts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-export-contexts.js","sourceRoot":"","sources":["../src/step-export-contexts.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiC/D,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAAuB,EACvB,YAAwC,EACxC,kBAA4C;IAE5C,OAAO;QACL,SAAS;QACT,wBAAwB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,CAC3H,wBAAwB,CAAC,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,CAAC;QACxI,gBAAgB;QAChB,kBAAkB;QAClB,2BAA2B;KAC5B,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAwC;IAExC,OAAO;QACL,YAAY;QACZ,2BAA2B;QAC3B,gBAAgB;QAChB,2BAA2B;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,262 @@
1
+ /**
2
+ * The vocabulary of a STEP export: what a caller asks for, what it gets back,
3
+ * and the state one `export()` call threads through its phases.
4
+ *
5
+ * Split out of `step-exporter.ts` for #2475. These are declarations only -- no
6
+ * behaviour lives here beyond one message builder -- which is why they could
7
+ * move without touching a single guard.
8
+ *
9
+ * Two ways in, deliberately. The seven sibling modules that already imported
10
+ * `ExportPass` / `SourceLineMutations` still import them from
11
+ * `step-exporter.js`, which re-exports this file, so no existing call site
12
+ * moved and the package's public entry point is untouched. Code written since
13
+ * the split imports straight from here instead -- `step-pass-builder.ts` does
14
+ * -- because the re-export exists to avoid churning callers, not as a channel
15
+ * anything new should be routed through.
16
+ */
17
+ import type { IfcAttributeValue, IfcSourceHeader, MapConversion, ProjectedCRS } from '@ifc-lite/parser';
18
+ import type { PropertySet, QuantitySet } from '@ifc-lite/data';
19
+ import type { RandomSource } from '@ifc-lite/encoding';
20
+ import type { IfcSchemaVersion } from './schema-converter.js';
21
+ import type { ModificationLedger, SourceLineDelivery } from './delta-modification-ledger.js';
22
+ import type { EffectiveEntityIndex } from './effective-index.js';
23
+ import type { createSourceRefReader } from './source-ref-bounds.js';
24
+ /**
25
+ * Options for STEP export
26
+ */
27
+ export interface StepExportOptions {
28
+ /** IFC schema version for the output file (any version, will convert if needed) */
29
+ schema: 'IFC2X3' | 'IFC4' | 'IFC4X3' | 'IFC5';
30
+ /** File description */
31
+ description?: string;
32
+ /** Author name */
33
+ author?: string;
34
+ /** Organization name */
35
+ organization?: string;
36
+ /** Application name (defaults to 'ifc-lite') */
37
+ application?: string;
38
+ /** Output filename */
39
+ filename?: string;
40
+ /** Include original geometry entities (default: true) */
41
+ includeGeometry?: boolean;
42
+ /** Include property sets (default: true) */
43
+ includeProperties?: boolean;
44
+ /** Include quantity sets (default: true) */
45
+ includeQuantities?: boolean;
46
+ /** Include relationships (default: true) */
47
+ includeRelationships?: boolean;
48
+ /** Apply mutations from MutablePropertyView (default: true if provided) */
49
+ applyMutations?: boolean;
50
+ /** Only export entities with mutations (delta export) */
51
+ deltaOnly?: boolean;
52
+ /** Only export entities currently visible in the viewer */
53
+ visibleOnly?: boolean;
54
+ /** Hidden entity IDs (local expressIds) — required when visibleOnly is true */
55
+ hiddenEntityIds?: Set<number>;
56
+ /** Isolated entity IDs (local expressIds, null = no isolation active) */
57
+ isolatedEntityIds?: Set<number> | null;
58
+ /** Georeferencing mutations to apply (IfcProjectedCRS / IfcMapConversion edits) */
59
+ georefMutations?: {
60
+ projectedCRS?: Partial<ProjectedCRS>;
61
+ mapConversion?: Partial<MapConversion>;
62
+ };
63
+ /**
64
+ * Seeded randomness for the GlobalIds this exporter SYNTHESIZES:
65
+ * the `IfcPropertySet` / `IfcElementQuantity` roots regenerated for
66
+ * mutated (or overlay-created) property and quantity sets, their
67
+ * `IfcRelDefinesByProperties` links. Without it those come from the platform
68
+ * CSPRNG, so two exports of the same model differ in exactly those bytes -
69
+ * which breaks byte-reproducibility for in-store builds that call
70
+ * `addPropertySet` / `addQuantitySet` (the sets themselves live in the
71
+ * mutation overlay and only become IFC roots here). Pass the same seeded
72
+ * source used for `SpatialAnchor.guidRandom` to close that gap. Default
73
+ * (omitted) behaviour for THESE ids is unchanged: random.
74
+ *
75
+ * NOT the `IFCPROXY` placeholders any more (#2733). Those used to be minted
76
+ * from this source too, so an omitted `guidRandom` made every downgraded
77
+ * IFC4X3 entity differ on re-export. They are now derived from the source
78
+ * line when this is omitted, and only fall back to this source when it is
79
+ * supplied - so passing a seeded source still pins them, but NOT passing one
80
+ * no longer makes them random. See `convertStepLine`.
81
+ */
82
+ guidRandom?: RandomSource;
83
+ /**
84
+ * Pin the STEP header `FILE_NAME` timestamp (STEP format, e.g.
85
+ * `20240101T000000`). Omitted = the wall clock, as before. Required for
86
+ * genuinely byte-identical exports, since the header otherwise carries the
87
+ * export instant.
88
+ */
89
+ timeStamp?: string;
90
+ /** Progress callback for async export */
91
+ onProgress?: (progress: StepExportProgress) => void;
92
+ }
93
+ /**
94
+ * Progress information during STEP export
95
+ */
96
+ export interface StepExportProgress {
97
+ /** Current phase of export */
98
+ phase: 'preparing' | 'entities' | 'assembling';
99
+ /** Progress 0-1 */
100
+ percent: number;
101
+ /** Number of entities processed so far */
102
+ entitiesProcessed: number;
103
+ /** Total entities to process */
104
+ entitiesTotal: number;
105
+ }
106
+ /**
107
+ * Result of STEP export
108
+ */
109
+ export interface StepExportResult {
110
+ /** STEP file content as bytes (avoids V8 string length limit for large files) */
111
+ content: Uint8Array;
112
+ /** Statistics about the export */
113
+ stats: {
114
+ /** Total entities exported */
115
+ entityCount: number;
116
+ /** New entities created for mutations */
117
+ newEntityCount: number;
118
+ /** Entities modified by mutations */
119
+ modifiedEntityCount: number;
120
+ /** File size in bytes */
121
+ fileSize: number;
122
+ /**
123
+ * Non-fatal refusals: things the caller asked for that this export could
124
+ * not write. Empty when the export did everything it was asked to do.
125
+ *
126
+ * A requested `georefMutations.mapConversion` is one case: with no
127
+ * `IfcGeometricRepresentationContext` to reference as `SourceCRS`, the
128
+ * `IfcMapConversion` is skipped (writing it would produce a dangling
129
+ * reference) while the `IfcProjectedCRS` is still written — so the output
130
+ * is indistinguishable from "no map conversion was requested" unless the
131
+ * caller reads this (#2067).
132
+ *
133
+ * A WITHHELD RELATIONSHIP is the other: when a relationship names an
134
+ * entity this export is not writing, in a slot with no spelling for an
135
+ * omitted reference, the whole relationship line is dropped rather than
136
+ * shipped dangling — see {@link relationshipWithheldWarning}. This can
137
+ * happen on a plain full export with no options set at all, so it is
138
+ * reported rather than left to be discovered by a diff.
139
+ *
140
+ * Same `string[]` shape as `MergeExportResult.stats.warnings`.
141
+ */
142
+ warnings: string[];
143
+ };
144
+ }
145
+ /**
146
+ * Message for a relationship this export DROPPED rather than rewrote.
147
+ *
148
+ * `filterHiddenRefsFromRelationshipLine` removes an omitted `#N` from a
149
+ * SET/LIST attribute, but a single-valued attribute has no STEP spelling for
150
+ * "omitted" and an empty SET is not the same statement as the original — so in
151
+ * both of those cases it withholds the whole line and the relationship simply
152
+ * is not in the output. Withholding beats shipping a dangling `#N`, but it is
153
+ * not free: every OTHER entity that relationship named loses the association.
154
+ * A visible element can therefore come out of a plain full export with one
155
+ * fewer pset than it went in with, and before this warning existed nothing in
156
+ * the result said so (adversarial review of #2668).
157
+ *
158
+ * Deliberately reports the relationship rather than the omitted target: the
159
+ * target's own omission is already the caller's own doing in every reason but
160
+ * the unreadable-ref one, whereas the lost association is the surprise.
161
+ */
162
+ export declare const relationshipWithheldWarning: (expressId: number, type: string) => string;
163
+ /**
164
+ * What `step-attribute-mutations.ts`'s `applySourceLineMutations` produced: the rewritten
165
+ * line, plus which edit kinds that rewrite actually delivered. The delivery
166
+ * half is {@link SourceLineDelivery} rather than three loose booleans so that
167
+ * the pipeline and the ledger cannot disagree about what a source line carries
168
+ * — an added kind has one place to be added.
169
+ */
170
+ export type SourceLineMutations = SourceLineDelivery & {
171
+ text: string;
172
+ };
173
+ /**
174
+ * The state one `export()` call shares across its seven phases.
175
+ *
176
+ * Introduced by step 1 of #2475: `export()` is ~1267 lines and the phases a
177
+ * split would separate are held together by ~30 local bindings, most of which
178
+ * are read in three or more phases. Naming that set once — as an interface
179
+ * with a single construction site at the top of `export()` — is what lets a
180
+ * later phase extraction take one parameter instead of fifteen.
181
+ *
182
+ * Two properties of this object are load-bearing and must survive every later
183
+ * move:
184
+ *
185
+ * 1. **The predicates are members, not duplicated expressions.** Six of them
186
+ * (`isOverlayCreated`, `isReadableSourceRef`, `isGeometryExcluded`,
187
+ * `hasEmittableHostBytes`, `willBeEmitted`,
188
+ * `isRefExcludedDuringClosureWalk`) exist precisely so two phases cannot
189
+ * disagree about a gate — see the comments at their construction sites for
190
+ * the corrupt files the earlier, per-phase versions let through (#2491,
191
+ * #2414, #2398, #2637). A phase that reimplements one of these instead of
192
+ * reading it off the pass reintroduces exactly that class of defect.
193
+ * 2. **`allowedEntityIds` and `hiddenProductIds` are mutable, and the
194
+ * predicates close over the pass rather than over a snapshot.** Both are
195
+ * assigned AFTER construction, in `step-collection.ts`, and the order there
196
+ * matters more than it looks: `hiddenProductIds` is set first, and
197
+ * `allowedEntityIds` is the value the closure walk on the next line is
198
+ * computing — so `isRefExcludedDuringClosureWalk` is handed to that walk
199
+ * as one of that call's own arguments — while `allowedEntityIds`, and only
200
+ * it, is still null. The
201
+ * output-line filter reads both later, through `isOmittedFromOutput` ->
202
+ * `willBeEmitted`, so neither can be a snapshot taken before the walk ran —
203
+ * that is the invariant the #2637 regression broke.
204
+ *
205
+ * Deliberately NOT on the pass, and why: `isOmittedFromOutput`,
206
+ * `mayNameOmittedRefs` and
207
+ * `overlayNewEntityCount` are eagerly-computed values whose value is only
208
+ * defined after work that runs past this construction site, so hoisting them
209
+ * would change what they compute rather than where they are named;
210
+ * `generatedTypeOwnedPsetIds` is read in one phase only — a local inside
211
+ * `step-property-sets.ts:generatePropertyAndQuantitySetEntities`, which holds
212
+ * both the loop that writes it and the loop that reads it (#2475).
213
+ */
214
+ export interface ExportPass {
215
+ /** Output accumulator: every DATA-section line this export will write. */
216
+ readonly entities: string[];
217
+ /** Lines contributed by entities that have no source record. */
218
+ newEntityCount: number;
219
+ readonly schema: IfcSchemaVersion;
220
+ readonly sourceSchema: IfcSchemaVersion;
221
+ readonly converting: boolean;
222
+ readonly sourceHeader: IfcSourceHeader | undefined;
223
+ readonly schemaToken: string;
224
+ readonly overlayActive: boolean;
225
+ readonly effective: EffectiveEntityIndex;
226
+ readonly modifications: ModificationLedger;
227
+ /** Widened from the imported `InPlaceNominees` (whose sets are readonly)
228
+ * because the collection passes below add to them. */
229
+ readonly inPlaceNominees: {
230
+ attribute: Set<number>;
231
+ georeferencing: Set<number>;
232
+ };
233
+ allowedEntityIds: Set<number> | null;
234
+ hiddenProductIds: ReadonlySet<number> | null;
235
+ readonly modifiedEntities: Set<number>;
236
+ readonly modifiedAttributes: Map<number, Map<string, string>>;
237
+ readonly newPropertySets: Array<{
238
+ entityId: number;
239
+ psets: PropertySet[];
240
+ }>;
241
+ readonly newQuantitySets: Array<{
242
+ entityId: number;
243
+ qsets: QuantitySet[];
244
+ }>;
245
+ readonly typeOwnedPsetNamesByEntity: Map<number, Set<string>>;
246
+ readonly typeOwnedPsetIdsByEntity: Map<number, number[]>;
247
+ readonly rewrittenEntityIds: Set<number>;
248
+ readonly rewrittenEntityLines: Map<number, string>;
249
+ readonly overlayTypeOwnedPsets: Map<number, IfcAttributeValue>;
250
+ readonly skipPropertySetIds: Set<number>;
251
+ readonly skipRelationshipIds: Set<number>;
252
+ readonly newGeorefLines: string[];
253
+ readonly warnings: string[];
254
+ readonly buildHeader: (modifications: number) => string;
255
+ readonly isOverlayCreated: (entityId: number) => boolean;
256
+ readonly isReadableSourceRef: ReturnType<typeof createSourceRefReader>;
257
+ readonly isGeometryExcluded: (entityId: number, recordType: string) => boolean;
258
+ readonly hasEmittableHostBytes: (entityId: number) => boolean;
259
+ readonly willBeEmitted: (entityId: number) => boolean;
260
+ readonly isRefExcludedDuringClosureWalk: (id: number) => boolean;
261
+ }
262
+ //# sourceMappingURL=step-export-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-export-types.d.ts","sourceRoot":"","sources":["../src/step-export-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IACh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,CAAC,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAG5B,QAAQ,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,QAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IACvE,QAAQ,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/E,QAAQ,CAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9D,QAAQ,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACtD,QAAQ,CAAC,8BAA8B,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CAClE"}
@@ -0,0 +1,22 @@
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
+ * Message for a relationship this export DROPPED rather than rewrote.
6
+ *
7
+ * `filterHiddenRefsFromRelationshipLine` removes an omitted `#N` from a
8
+ * SET/LIST attribute, but a single-valued attribute has no STEP spelling for
9
+ * "omitted" and an empty SET is not the same statement as the original — so in
10
+ * both of those cases it withholds the whole line and the relationship simply
11
+ * is not in the output. Withholding beats shipping a dangling `#N`, but it is
12
+ * not free: every OTHER entity that relationship named loses the association.
13
+ * A visible element can therefore come out of a plain full export with one
14
+ * fewer pset than it went in with, and before this warning existed nothing in
15
+ * the result said so (adversarial review of #2668).
16
+ *
17
+ * Deliberately reports the relationship rather than the omitted target: the
18
+ * target's own omission is already the caller's own doing in every reason but
19
+ * the unreadable-ref one, whereas the lost association is the surprise.
20
+ */
21
+ export const relationshipWithheldWarning = (expressId, type) => `Relationship #${expressId} (${type}) was withheld from the export: it names at least one entity that has no line in this export, in a slot with no spelling for an omitted reference (a single-valued attribute, or a set whose every member is omitted). Anything else that relationship associated is no longer associated in the output.`;
22
+ //# sourceMappingURL=step-export-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-export-types.js","sourceRoot":"","sources":["../src/step-export-types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkK/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAiB,EAAE,IAAY,EAAU,EAAE,CACrF,iBAAiB,SAAS,KAAK,IAAI,0SAA0S,CAAC"}