@itwin/presentation-shared 2.0.0-alpha.8 → 2.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 (190) hide show
  1. package/CHANGELOG.md +736 -1
  2. package/README.md +59 -27
  3. package/lib/presentation-shared.d.ts +24 -0
  4. package/lib/presentation-shared.d.ts.map +1 -0
  5. package/lib/presentation-shared.js +22 -0
  6. package/lib/presentation-shared.js.map +1 -0
  7. package/lib/shared/ConcatenatedValue.d.ts.map +1 -0
  8. package/lib/shared/ConcatenatedValue.js.map +1 -0
  9. package/lib/{cjs/shared → shared}/ECSqlCore.d.ts +16 -2
  10. package/lib/shared/ECSqlCore.d.ts.map +1 -0
  11. package/lib/shared/ECSqlCore.js +37 -0
  12. package/lib/shared/ECSqlCore.js.map +1 -0
  13. package/lib/shared/EachValueFrom.d.ts +30 -0
  14. package/lib/shared/EachValueFrom.d.ts.map +1 -0
  15. package/lib/shared/EachValueFrom.js +115 -0
  16. package/lib/shared/EachValueFrom.js.map +1 -0
  17. package/lib/shared/Event.d.ts.map +1 -0
  18. package/lib/{esm/shared → shared}/Event.js.map +1 -1
  19. package/lib/shared/Formatting.d.ts.map +1 -0
  20. package/lib/{esm/shared → shared}/Formatting.js +10 -6
  21. package/lib/shared/Formatting.js.map +1 -0
  22. package/lib/shared/HiddenClasses.d.ts +21 -0
  23. package/lib/shared/HiddenClasses.d.ts.map +1 -0
  24. package/lib/shared/HiddenClasses.js +52 -0
  25. package/lib/shared/HiddenClasses.js.map +1 -0
  26. package/lib/{esm/shared → shared}/InstanceLabelSelectClauseFactory.d.ts +3 -63
  27. package/lib/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -0
  28. package/lib/shared/InstanceLabelSelectClauseFactory.js +27 -0
  29. package/lib/shared/InstanceLabelSelectClauseFactory.js.map +1 -0
  30. package/lib/shared/Logging.d.ts.map +1 -0
  31. package/lib/{esm/shared → shared}/Logging.js +2 -1
  32. package/lib/shared/Logging.js.map +1 -0
  33. package/lib/shared/MappedTypes.d.ts +55 -0
  34. package/lib/shared/MappedTypes.d.ts.map +1 -0
  35. package/lib/shared/MappedTypes.js.map +1 -0
  36. package/lib/shared/Metadata.d.ts +572 -0
  37. package/lib/shared/Metadata.d.ts.map +1 -0
  38. package/lib/{esm/shared → shared}/Metadata.js +7 -3
  39. package/lib/shared/Metadata.js.map +1 -0
  40. package/lib/{cjs/shared → shared}/Utils.d.ts +6 -7
  41. package/lib/shared/Utils.d.ts.map +1 -0
  42. package/lib/{esm/shared → shared}/Utils.js +21 -27
  43. package/lib/shared/Utils.js.map +1 -0
  44. package/lib/shared/Values.d.ts +144 -0
  45. package/lib/shared/Values.d.ts.map +1 -0
  46. package/lib/shared/Values.js +121 -0
  47. package/lib/shared/Values.js.map +1 -0
  48. package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.d.ts +40 -0
  49. package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.d.ts.map +1 -0
  50. package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.js +66 -0
  51. package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.js.map +1 -0
  52. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +174 -0
  53. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -0
  54. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.js +177 -0
  55. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -0
  56. package/lib/{cjs/shared → shared}/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +10 -2
  57. package/lib/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -0
  58. package/lib/{esm/shared → shared}/ecsql-snippets/ECSqlValueSelectorSnippets.js +22 -8
  59. package/lib/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -0
  60. package/lib/shared/ecsql-snippets/index.d.ts +4 -0
  61. package/lib/shared/ecsql-snippets/index.d.ts.map +1 -0
  62. package/lib/shared/ecsql-snippets/index.js +8 -0
  63. package/lib/shared/ecsql-snippets/index.js.map +1 -0
  64. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts +17 -0
  65. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  66. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js +48 -0
  67. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js.map +1 -0
  68. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts +39 -0
  69. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  70. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js +60 -0
  71. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js.map +1 -0
  72. package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts +12 -0
  73. package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  74. package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js +37 -0
  75. package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js.map +1 -0
  76. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts +198 -0
  77. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts.map +1 -0
  78. package/lib/{esm/shared/ECSqlCore.js → shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js} +4 -1
  79. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js.map +1 -0
  80. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts +34 -0
  81. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  82. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js +332 -0
  83. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js.map +1 -0
  84. package/lib/shared/instance-label-factory-impls/Utils.d.ts +7 -0
  85. package/lib/shared/instance-label-factory-impls/Utils.d.ts.map +1 -0
  86. package/lib/shared/instance-label-factory-impls/Utils.js +21 -0
  87. package/lib/shared/instance-label-factory-impls/Utils.js.map +1 -0
  88. package/package.json +22 -31
  89. package/lib/cjs/package.json +0 -1
  90. package/lib/cjs/presentation-shared.d.ts +0 -17
  91. package/lib/cjs/presentation-shared.d.ts.map +0 -1
  92. package/lib/cjs/presentation-shared.js +0 -71
  93. package/lib/cjs/presentation-shared.js.map +0 -1
  94. package/lib/cjs/shared/ConcatenatedValue.d.ts.map +0 -1
  95. package/lib/cjs/shared/ConcatenatedValue.js +0 -49
  96. package/lib/cjs/shared/ConcatenatedValue.js.map +0 -1
  97. package/lib/cjs/shared/ECSqlCore.d.ts.map +0 -1
  98. package/lib/cjs/shared/ECSqlCore.js +0 -7
  99. package/lib/cjs/shared/ECSqlCore.js.map +0 -1
  100. package/lib/cjs/shared/Event.d.ts.map +0 -1
  101. package/lib/cjs/shared/Event.js +0 -7
  102. package/lib/cjs/shared/Event.js.map +0 -1
  103. package/lib/cjs/shared/Formatting.d.ts.map +0 -1
  104. package/lib/cjs/shared/Formatting.js +0 -114
  105. package/lib/cjs/shared/Formatting.js.map +0 -1
  106. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts +0 -133
  107. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts.map +0 -1
  108. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js +0 -166
  109. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js.map +0 -1
  110. package/lib/cjs/shared/Logging.d.ts.map +0 -1
  111. package/lib/cjs/shared/Logging.js +0 -20
  112. package/lib/cjs/shared/Logging.js.map +0 -1
  113. package/lib/cjs/shared/MappedTypes.d.ts +0 -17
  114. package/lib/cjs/shared/MappedTypes.d.ts.map +0 -1
  115. package/lib/cjs/shared/MappedTypes.js +0 -7
  116. package/lib/cjs/shared/MappedTypes.js.map +0 -1
  117. package/lib/cjs/shared/Metadata.d.ts +0 -291
  118. package/lib/cjs/shared/Metadata.d.ts.map +0 -1
  119. package/lib/cjs/shared/Metadata.js +0 -53
  120. package/lib/cjs/shared/Metadata.js.map +0 -1
  121. package/lib/cjs/shared/Utils.d.ts.map +0 -1
  122. package/lib/cjs/shared/Utils.js +0 -114
  123. package/lib/cjs/shared/Utils.js.map +0 -1
  124. package/lib/cjs/shared/Values.d.ts +0 -107
  125. package/lib/cjs/shared/Values.d.ts.map +0 -1
  126. package/lib/cjs/shared/Values.js +0 -155
  127. package/lib/cjs/shared/Values.js.map +0 -1
  128. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +0 -51
  129. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +0 -1
  130. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js +0 -140
  131. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +0 -1
  132. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +0 -1
  133. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +0 -260
  134. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +0 -1
  135. package/lib/cjs/shared/ecsql-snippets/index.d.ts +0 -3
  136. package/lib/cjs/shared/ecsql-snippets/index.d.ts.map +0 -1
  137. package/lib/cjs/shared/ecsql-snippets/index.js +0 -18
  138. package/lib/cjs/shared/ecsql-snippets/index.js.map +0 -1
  139. package/lib/esm/presentation-shared.d.ts +0 -17
  140. package/lib/esm/presentation-shared.d.ts.map +0 -1
  141. package/lib/esm/presentation-shared.js +0 -14
  142. package/lib/esm/presentation-shared.js.map +0 -1
  143. package/lib/esm/shared/ConcatenatedValue.d.ts +0 -46
  144. package/lib/esm/shared/ConcatenatedValue.d.ts.map +0 -1
  145. package/lib/esm/shared/ConcatenatedValue.js.map +0 -1
  146. package/lib/esm/shared/ECSqlCore.d.ts +0 -94
  147. package/lib/esm/shared/ECSqlCore.d.ts.map +0 -1
  148. package/lib/esm/shared/ECSqlCore.js.map +0 -1
  149. package/lib/esm/shared/Event.d.ts +0 -27
  150. package/lib/esm/shared/Event.d.ts.map +0 -1
  151. package/lib/esm/shared/Formatting.d.ts +0 -44
  152. package/lib/esm/shared/Formatting.d.ts.map +0 -1
  153. package/lib/esm/shared/Formatting.js.map +0 -1
  154. package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts.map +0 -1
  155. package/lib/esm/shared/InstanceLabelSelectClauseFactory.js +0 -160
  156. package/lib/esm/shared/InstanceLabelSelectClauseFactory.js.map +0 -1
  157. package/lib/esm/shared/Logging.d.ts +0 -27
  158. package/lib/esm/shared/Logging.d.ts.map +0 -1
  159. package/lib/esm/shared/Logging.js.map +0 -1
  160. package/lib/esm/shared/MappedTypes.d.ts +0 -17
  161. package/lib/esm/shared/MappedTypes.d.ts.map +0 -1
  162. package/lib/esm/shared/MappedTypes.js.map +0 -1
  163. package/lib/esm/shared/Metadata.d.ts +0 -291
  164. package/lib/esm/shared/Metadata.d.ts.map +0 -1
  165. package/lib/esm/shared/Metadata.js.map +0 -1
  166. package/lib/esm/shared/Utils.d.ts +0 -61
  167. package/lib/esm/shared/Utils.d.ts.map +0 -1
  168. package/lib/esm/shared/Utils.js.map +0 -1
  169. package/lib/esm/shared/Values.d.ts +0 -107
  170. package/lib/esm/shared/Values.d.ts.map +0 -1
  171. package/lib/esm/shared/Values.js +0 -152
  172. package/lib/esm/shared/Values.js.map +0 -1
  173. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +0 -51
  174. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +0 -1
  175. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js +0 -137
  176. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +0 -1
  177. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +0 -122
  178. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +0 -1
  179. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +0 -1
  180. package/lib/esm/shared/ecsql-snippets/index.d.ts +0 -3
  181. package/lib/esm/shared/ecsql-snippets/index.d.ts.map +0 -1
  182. package/lib/esm/shared/ecsql-snippets/index.js +0 -7
  183. package/lib/esm/shared/ecsql-snippets/index.js.map +0 -1
  184. /package/lib/{cjs/shared → shared}/ConcatenatedValue.d.ts +0 -0
  185. /package/lib/{esm/shared → shared}/ConcatenatedValue.js +0 -0
  186. /package/lib/{cjs/shared → shared}/Event.d.ts +0 -0
  187. /package/lib/{esm/shared → shared}/Event.js +0 -0
  188. /package/lib/{cjs/shared → shared}/Formatting.d.ts +0 -0
  189. /package/lib/{cjs/shared → shared}/Logging.d.ts +0 -0
  190. /package/lib/{esm/shared → shared}/MappedTypes.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,640 @@
1
1
  # @itwin/presentation-shared
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#1222](https://github.com/iTwin/presentation/pull/1222): Enhance the `Props` type to only accept functions that have one object argument.
8
+
9
+ The term "props" refers to a props object, meaning there should only be one argument. For cases when a function has multiple arguments, use TypeScript's `Parameters` utility type instead.
10
+ - [#1445](https://github.com/iTwin/presentation/pull/1445): `EC.Class`: Added `getOwnProperties` method that returns only the properties defined directly on the class, excluding those inherited from base classes.
11
+ - [#1446](https://github.com/iTwin/presentation/pull/1446): `EC.EntityClass`: Added `getMixins` method that returns the mixins applied directly to the entity class.
12
+ - [#1200](https://github.com/iTwin/presentation/pull/1200): Made `EC.RelationshipConstraint.multiplicity` required.
13
+ - [#1531](https://github.com/iTwin/presentation/pull/1531): `EC.RelationshipConstraintMultiplicity`: Changed `upperLimit` type from `number` to `number | "unbounded"`.
14
+
15
+ Previously, `createECSchemaProvider` from `@itwin/presentation-core-interop` reported an unbounded (`*`) upper limit as `0`, which silently made the natural `upperLimit > 1` check treat many-valued relationships as single-valued. The limit is now an explicit `"unbounded"` value that consumers must handle:
16
+
17
+ ```ts
18
+ const isManyValued = constraint.multiplicity.upperLimit === "unbounded" || constraint.multiplicity.upperLimit > 1;
19
+ ```
20
+ - [#1360](https://github.com/iTwin/presentation/pull/1360): `createRelationshipPathJoinClause` now returns `{ joins: string; bindings?: Record<string, ECSqlBinding> }` instead of a plain `string`. Callers must be updated to read the SQL clause from the `joins` property:
21
+
22
+ ```ts
23
+ // Before
24
+ const joinClause = await createRelationshipPathJoinClause({ schemaProvider, path });
25
+
26
+ // After
27
+ const { joins: joinClause, bindings } = await createRelationshipPathJoinClause({ schemaProvider, path });
28
+ ```
29
+
30
+ `RelationshipPathStep` now accepts an optional `instanceFilter` attribute. When provided, the resolved expression is appended as an `AND` condition to the relevant JOIN's `ON` clause. ECSQL parameter bindings declared in `instanceFilter.bindings` are collected across all steps and returned in the `bindings` field of the result.
31
+ - [#1640](https://github.com/iTwin/presentation/pull/1640): `ECSqlBinding`: The `idset` binding's `value` is now `readonly Id64String[]` (previously `Id64String[]`). This is non-breaking for consumers who only define bindings, but breaking for code that reads `idset` binding values and passes them to APIs expecting a mutable array (e.g., custom `ECSqlQueryExecutor` implementations).
32
+
33
+ Migration example:
34
+
35
+ ```ts
36
+ // Before
37
+ binder.bindIdSet(key, OrderedId64Iterable.sortArray(binding.value));
38
+
39
+ // After
40
+ binder.bindIdSet(key, OrderedId64Iterable.sortArray([...binding.value]));
41
+ ```
42
+ - [#1606](https://github.com/iTwin/presentation/pull/1606): `ECSchemaProvider`: Add a required `getHiddenClassesTree` method, which returns a tree of classes, derived from the given class, whose visibility is changed through `CoreCustomAttributes.HiddenClass` or `CoreCustomAttributes.HiddenSchema` custom attributes. Building the tree requires traversing the whole derived classes' hierarchy, so implementations are expected to cache the result and refresh it when the iModel's schemas change.
43
+
44
+ Additions:
45
+
46
+ - `HiddenClassesTreeNode` describes a node of the tree. Root nodes are the outermost hidden derived classes, their children are derived classes that are explicitly shown, and so on. The selected class is the visibility boundary: `HiddenClass` attributes on it and on its base classes are ignored, so it and its descendants are visible unless a descendant is hidden through its own `HiddenClass` attribute or the `HiddenSchema` attribute of its schema.
47
+ - `createHiddenClassesTree` builds the tree using the given schema provider. It doesn't cache the result, and is meant for implementing `ECSchemaProvider.getHiddenClassesTree`.
48
+ - `ECSql.createHiddenClassesFilter` creates a filter that excludes instances of classes, derived from the given base class and hidden through the above custom attributes. The tree is requested from the given schema provider once, and the filter's `createWhereClause` creates an ECSQL condition for the given class alias. The condition is an empty string when nothing needs to be excluded.
49
+
50
+ ```ts
51
+ const filter = await ECSql.createHiddenClassesFilter({ schemaProvider, baseClassName: "BisCore.GeometricElement3d" });
52
+ const condition = filter.createWhereClause("e");
53
+ const ecsql = `SELECT e.ECInstanceId FROM BisCore.GeometricElement3d e ${condition ? `WHERE ${condition}` : ""}`;
54
+ ```
55
+
56
+ Custom `ECSchemaProvider` implementations need to implement the new method. The one created by `createECSchemaProvider` from `@itwin/presentation-core-interop` already does that. Example of a custom implementation:
57
+
58
+ ```ts
59
+ const hiddenClassesTrees = new Map<string, Promise<HiddenClassesTreeNode[]>>();
60
+ const schemaProvider: ECSchemaProvider = {
61
+ getSchema: async (schemaName) => getMySchema(schemaName),
62
+ classDerivesFrom: async (derivedClassName, baseClassName) => myClassDerivesFrom(derivedClassName, baseClassName),
63
+ getHiddenClassesTree: async (selectClassName) => {
64
+ let tree = hiddenClassesTrees.get(selectClassName);
65
+ if (!tree) {
66
+ tree = createHiddenClassesTree({ schemaProvider, selectClassName });
67
+ tree.catch(() => hiddenClassesTrees.delete(selectClassName));
68
+ hiddenClassesTrees.set(selectClassName, tree);
69
+ }
70
+ return tree;
71
+ },
72
+ };
73
+ ```
74
+ - [#1454](https://github.com/iTwin/presentation/pull/1454): Dropped CommonJS support. These packages are now published as ES modules (ESM) only.
75
+ - [#1350](https://github.com/iTwin/presentation/pull/1350): `ECSqlQueryDef.bindings` is now `ECSqlBinding[] | Record<string, ECSqlBinding>` (previously `ECSqlBinding[]`). This is non-breaking for consumers who only define queries, but breaking for code that reads or forwards bindings (e.g., custom `ECSqlQueryExecutor` implementations) because it must now handle both formats.
76
+
77
+ Migration example:
78
+
79
+ ```ts
80
+ // Before
81
+ function handleBindings(bindings: ECSqlBinding[]) {
82
+ bindings.forEach((b, i) => bind(i + 1, b));
83
+ }
84
+
85
+ // After
86
+ function handleBindings(bindings: ECSqlBinding[] | Record<string, ECSqlBinding>) {
87
+ const entries: Array<[string | number, ECSqlBinding]> = Array.isArray(bindings)
88
+ ? bindings.map((b, i) => [i + 1, b])
89
+ : Object.entries(bindings);
90
+ for (const [key, b] of entries) {
91
+ bind(key, b);
92
+ }
93
+ }
94
+ ```
95
+
96
+ Alternatively, update to the latest `@itwin/presentation-core-interop` which handles both binding formats out of the box.
97
+ - [#1444](https://github.com/iTwin/presentation/pull/1444): `EC.Property`: Added `category` attribute that provides access to the property's `EC.PropertyCategory`. Also added a `description` attribute to `EC.SchemaItem`.
98
+ - [#1503](https://github.com/iTwin/presentation/pull/1503): Full class and property names are now compared case-sensitively. Provide names using the casing defined by their EC schemas.
99
+ - [#1493](https://github.com/iTwin/presentation/pull/1493): Expose access to enumerations, kind-of-quantities and property categories through `EC.Schema`, and extend `EC.KindOfQuantity` with `relativeError` and `persistenceUnit` attributes. Schemas returned by `createECSchemaProvider` now implement the new getters.
100
+
101
+ - `EC.Schema` now requires `getEnumeration`, `getKindOfQuantity` and `getPropertyCategory` methods (mirroring the existing `getClass`). Consumers that only use `EC.Schema` are unaffected, but custom implementations of the interface must add these getters:
102
+
103
+ ```ts
104
+ const schema: EC.Schema = {
105
+ name,
106
+ version,
107
+ isHidden,
108
+ getClass: (className) => classes.get(className),
109
+ // added:
110
+ getEnumeration: (enumName) => enumerations.get(enumName),
111
+ getKindOfQuantity: (koqName) => kindOfQuantities.get(koqName),
112
+ getPropertyCategory: (categoryName) => categories.get(categoryName),
113
+ };
114
+ ```
115
+
116
+ - `EC.KindOfQuantity` now requires `relativeError` (`number`) and `persistenceUnit` (`string`) attributes. Custom implementations must provide them.
117
+
118
+ - `createECSchemaProvider`: The `EC.Schema` returned by the provider now implements the new getters, giving access to enumerations, kind-of-quantities and property categories in addition to classes. Existing code keeps working without changes and can now read these additional schema items:
119
+
120
+ ```ts
121
+ const schemaProvider = createECSchemaProvider(imodel);
122
+ const schema = await schemaProvider.getSchema("BisCore");
123
+ const enumeration = schema?.getEnumeration("MySchema.MyEnum");
124
+ const koq = schema?.getKindOfQuantity("MySchema.MyKoq");
125
+ const category = schema?.getPropertyCategory("MySchema.MyCategory");
126
+ ```
127
+ - [#1491](https://github.com/iTwin/presentation/pull/1491): `ECSchemaProvider`: Added a `classDerivesFrom` method for checking whether one ECClass is the same as, or derives from, another. `createECSchemaProvider` (in `@itwin/presentation-core-interop`) implements it using the class hierarchy information it already loads, so the answer is returned synchronously once the hierarchy has been loaded and no additional round-trips to the iModel are needed.
128
+
129
+ Also, `ECClassHierarchyInspector` and `createCachingECClassHierarchyInspector` have been deprecated. Because `ECSchemaProvider` now exposes `classDerivesFrom` directly, a separate class hierarchy inspector is no longer needed when setting up iModel access:
130
+
131
+ ```ts
132
+ // Before:
133
+ import { createCachingECClassHierarchyInspector } from "@itwin/presentation-shared";
134
+ import { createECSchemaProvider, createECSqlQueryExecutor } from "@itwin/presentation-core-interop";
135
+
136
+ const schemaProvider = createECSchemaProvider(imodel);
137
+ const imodelAccess = {
138
+ ...schemaProvider,
139
+ ...createCachingECClassHierarchyInspector({ schemaProvider }),
140
+ ...createECSqlQueryExecutor(imodel),
141
+ };
142
+
143
+ // After:
144
+ import { createECSchemaProvider, createECSqlQueryExecutor } from "@itwin/presentation-core-interop";
145
+
146
+ const imodelAccess = {
147
+ ...createECSchemaProvider(imodel), // now also provides `classDerivesFrom`
148
+ ...createECSqlQueryExecutor(imodel),
149
+ };
150
+ ```
151
+
152
+ **Breaking changes:**
153
+
154
+ - `ECSchemaProvider` now requires a `classDerivesFrom` method. Objects created via `createECSchemaProvider` get it automatically, so most consumers don't need to change anything. Only custom, hand-written `ECSchemaProvider` implementations need to add the method.
155
+
156
+ - Renamed the `classHierarchyInspector` prop to `imodelAccess` on `createClassBasedInstanceLabelSelectClauseFactory`, `createBisInstanceLabelSelectClauseFactory` (both in `@itwin/presentation-shared`) and `createPredicateBasedHierarchyDefinition` (in `@itwin/presentation-hierarchies`). The prop's type is unchanged, so the value passed to it doesn't need to change - only the prop name:
157
+
158
+ ```ts
159
+ // Before:
160
+ const classHierarchyInspector = createCachingECClassHierarchyInspector({ schemaProvider: createECSchemaProvider(imodel) });
161
+ createPredicateBasedHierarchyDefinition({ classHierarchyInspector, hierarchy });
162
+
163
+ // After:
164
+ const imodelAccess = createECSchemaProvider(imodel);
165
+ createPredicateBasedHierarchyDefinition({ imodelAccess, hierarchy });
166
+ ```
167
+ - [#1363](https://github.com/iTwin/presentation/pull/1363): Add `version` property to `EC.Schema` interface. Any code that manually implements the `EC.Schema` interface must now provide a `version: { read: number; write: number; minor: number }` object matching the EC schema version format `"read.write.minor"`.
168
+
169
+ Consumers who obtain `EC.Schema` objects exclusively through `createECSchemaProvider` from `@itwin/presentation-core-interop` are unaffected — upgrading to the latest `@itwin/presentation-core-interop` is sufficient.
170
+
171
+ Migration example for custom `EC.Schema` implementations:
172
+
173
+ ```ts
174
+ // Before
175
+ const schema: EC.Schema = {
176
+ name: "MySchema",
177
+ getClass: async () => undefined,
178
+ };
179
+
180
+ // After
181
+ const schema: EC.Schema = {
182
+ name: "MySchema",
183
+ version: { read: 1, write: 0, minor: 0 },
184
+ getClass: async () => undefined,
185
+ };
186
+ ```
187
+ - [#1250](https://github.com/iTwin/presentation/pull/1250): Use type-safe full class names.
188
+
189
+ The full class names used in this package were defined as `string`, although we always expect them to be in specific format - either `Schema:Class` or `Schema.Class`. In many cases we rely on this format when parsing the name for compare or other purposes, so type safety for the format is highly beneficial. This change makes full class names type-safe(ier) through [TypeScript's template literal types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), so that we can be sure that they are always in correct format.
190
+
191
+ ## Additions
192
+
193
+ - Added 3 new types to the `EC` namespace:
194
+ - `FullClassNameColonNotation` - matches the format `Schema:Class`,
195
+ - `FullClassNameDotNotation` - matches the format `Schema.Class`,
196
+ - `FullClassName` - union of the above two.
197
+
198
+ ## Non-breaking changes
199
+
200
+ - Updated `normalizeFullClassName` to return `EC.FullClassNameDotNotation` instead of `string`. The returned value is still assignable to `string`, but it adds type safety for the expected format of the full class name.
201
+
202
+ ## Breaking changes
203
+
204
+ - Changed `EC.CustomAttribute.className` to be of type `EC.FullClassNameDotNotation` instead of `string`.
205
+ - Changed `EC.CustomAttributeSet.get` argument to be of type `EC.FullClassNameDotNotation` instead of `string`.
206
+ - Changed `EC.SchemaItem.fullName` to be of type `EC.FullClassNameDotNotation` instead of `string`.
207
+ - Changed `createClassBasedInstanceLabelSelectClauseFactory` prop `clauses` to take objects with `{ className: EC.FullClassNameDotNotation }` arguments instead of `{ className: string }`.
208
+ - Changed `IInstanceLabelSelectClauseFactory.createSelectClause` prop `className` to be of type `EC.FullClassNameDotNotation` instead of `string`.
209
+ - Changed `ECSql.createPrimitivePropertyValueSelectorProps` prop `propertyClassName` to be of type `EC.FullClassNameDotNotation` instead of `string`.
210
+ - Changed `ECSql.createRelationshipPathJoinClause` prop `path` to take class names (`relationshipName`, `sourceClassName` and `targetClassName`) of type `EC.FullClassNameDotNotation` instead of `string`.
211
+ - Changed `ECClassHierarchyInspector.classDerivesFrom` arguments to be of type `EC.FullClassNameDotNotation` instead of `string`.
212
+ - Changed the second argument of `getClass` to be of type `EC.FullClassNameDotNotation` instead of `string`.
213
+ - Changed `InstanceKey.className` to be of type `EC.FullClassNameDotNotation` instead of `string`. The value is now always in dot notation, so consumers no longer need to call `normalizeFullClassName` on it.
214
+ - Changed `RelationshipPathStep` class-name properties (`sourceClassName`, `targetClassName` and `relationshipName`) to be of type `EC.FullClassNameDotNotation` instead of `string`.
215
+ - Changed `NavigationValueDescriptor.targetClassName` to be of type `EC.FullClassNameDotNotation` instead of `string`.
216
+
217
+ In many cases migration will be seamless, as long as the input string matches the expected format. In some cases (e.g. when assigning a string variable to one of the affected properties), you may need to use `normalizeFullClassName` to ensure the value is of the correct type:
218
+
219
+ ```ts
220
+ const myClassName: string = "MySchema.MyClass";
221
+
222
+ // before
223
+ const myClass = getClass(schemaProvider, myClassName);
224
+
225
+ // after
226
+ const myClass = getClass(schemaProvider, normalizeFullClassName(myClassName));
227
+ ```
228
+ - [#1394](https://github.com/iTwin/presentation/pull/1394): `EC` namespace interfaces in `@itwin/presentation-shared` no longer use `Promise` wrappers — once a schema is loaded via the still-async `ECSchemaProvider.getSchema`, all further navigation (`baseClass`, `is()`, `getProperty()`, `getProperties()`, `kindOfQuantity`, `relationshipClass`, `enumeration`, `abstractConstraint`) is synchronous.
229
+
230
+ Additional changes:
231
+
232
+ - Added an `EC.Class.getOwnProperties()` method that returns only the properties defined on the class itself, without inherited properties.
233
+ - Added an `EC.EntityClass.getMixins()` method that returns all mixins applied to the entity class.
234
+ - Added an `isHidden: boolean` property to `EC.Schema`, `EC.Class` (optional) and `EC.Property`. The property represents the `HiddenSchema`, `HiddenClass` and `HiddenProperty` custom attributes.
235
+ - Added an optional `EC.Property.category` attribute.
236
+ - Added a required `EC.RelationshipConstraint.constraintClasses` attribute.
237
+ - Added missing optional `description` attributes to `EC.Schema` and `EC.Property`.
238
+ - [#954](https://github.com/iTwin/presentation/pull/954): Add additional `baseClass` and `getDerivedClassNames` members to the `EC.Class` objects, returned by `ECSchemaProvider`.
239
+
240
+ - `baseClass: EC.Class | undefined`
241
+ - `getDerivedClassNames(props?: { onlyDirect?: boolean }): string[]`
242
+
243
+ ### Minor Changes
244
+
245
+ - [#1379](https://github.com/iTwin/presentation/pull/1379): `ECSql.createClassSelector`: Add a utility that creates a bracket-quoted ECSQL class selector (`[SchemaName].[ClassName]`) from a full class name.
246
+ - [#1654](https://github.com/iTwin/presentation/pull/1654): `ECSqlBinding`: Allow `idset` bindings to use mutable or readonly sets of IDs in addition to arrays.
247
+ - [#1455](https://github.com/iTwin/presentation/pull/1455): Added `ECSqlBinding.create` for creating ECSQL bindings from typed primitive values.
248
+ - [#1507](https://github.com/iTwin/presentation/pull/1507): Add `eachValueFrom` for consuming subscribable streams through async iteration.
249
+ - [#1307](https://github.com/iTwin/presentation/pull/1307): Add `createIModelInstanceLabelSelectClauseFactory` — a new `IInstanceLabelSelectClauseFactory` implementation that applies `InstanceLabelOverride` rules stored in the iModel.
250
+
251
+ Rules are read from `PresentationRules.Ruleset` elements (top-level `rules[]` only) by querying the iModel via `ECSqlQueryExecutor`. All `InstanceLabelOverride` value specification types are supported: `String`, `Property`, `ClassName`, `ClassLabel`, `BriefcaseId`, `LocalId`, and `Composite`. Path-based specs (`RelatedInstanceLabel`, `Property` with `propertySource`) degrade silently to the next available value.
252
+
253
+ When the `PresentationRules` schema is not imported into the iModel, the factory falls back transparently to the provided `defaultClauseFactory` (defaults to `createBisInstanceLabelSelectClauseFactory`).
254
+ - [#1595](https://github.com/iTwin/presentation/pull/1595): `PrimitiveValueDescriptor`: Add an `extendedType` property that carries a primitive property's `extendedTypeName` (e.g. `"Json"`, `"BeGuid"`), when set, so consumers can refine how a `type`-typed value should be interpreted without re-reading schema. `@itwin/presentation-content` now populates it for primitive properties.
255
+ - [#1455](https://github.com/iTwin/presentation/pull/1455): Added exported `Point2dValue` and `Point3dValue` types for representing point primitive values.
256
+ - [#1452](https://github.com/iTwin/presentation/pull/1452): `Props`: Added support for overloaded functions.
257
+
258
+ When the given function has multiple overload signatures, `Props` now resolves to the union of the parameter types across all overloads instead of only reflecting the last signature.
259
+ - [#1606](https://github.com/iTwin/presentation/pull/1606): Export `DeepReadonly` type for recursively marking all properties as readonly with no depth limit.
260
+ - [#1452](https://github.com/iTwin/presentation/pull/1452): Add `ECSql.createRelationshipPathJoinInfo` that resolves a relationship path into a flat, structured list of join descriptors without producing ECSQL. The returned result lets callers inspect the resolved join structure — e.g. to count the number of join tables without re-reading the schema.
261
+
262
+ In addition, add a sync `ECSql.createRelationshipPathJoinClause(info)` overload that renders a pre-resolved result of `ECSql.createRelationshipPathJoinInfo` into an ECSQL JOIN clause without any async schema access.
263
+ - [#1361](https://github.com/iTwin/presentation/pull/1361): `TypedPrimitiveValue`: The `type` fields now use `Extract<PrimitiveValueType, ...>` to stay in sync with `PrimitiveValueType`. Additionally, the `koqName` property is now available for `"Integer"` and `"Long"` typed values, not just `"Double"`.
264
+ - [#1455](https://github.com/iTwin/presentation/pull/1455): `TypedPrimitiveValue.create`: The return type is now narrowed based on the given `type` argument, so the result only exposes the properties valid for that type. For example, creating a value with type `"Point3d"` no longer exposes the `koqName` property.
265
+ - [#1551](https://github.com/iTwin/presentation/pull/1551): Introduced `NavigationValue` for representing instances targeted by navigation properties.
266
+ - [#1204](https://github.com/iTwin/presentation/pull/1204): Add a `RaisableEvent` interface, which extends `Event` with additional `raiseEvent` method.
267
+ - [#1357](https://github.com/iTwin/presentation/pull/1357): Added new public APIs for describing and carrying property values:
268
+
269
+ - `ValueDescriptor` — a discriminated union (`PrimitiveValueDescriptor | StructValueDescriptor | ArrayValueDescriptor | NavigationValueDescriptor`) that describes the shape of a value without carrying the value itself.
270
+ - `NavigationValueDescriptor` — describes a navigation property value (a reference to another EC instance). The runtime value stays the referenced instance's id, while this descriptor additionally carries the reference's target class name (`targetClassName`) as metadata.
271
+ - `PrimitiveValueDescriptor` now carries optional enumeration metadata (via `enumeration`) for enumeration-backed values. Only available on `String | Integer | Long`-typed descriptors, with the enumerator value type discriminated by `type` (`String` → `string`, `Integer | Long` → `number`). The runtime value stays the raw backing primitive, while the descriptor preserves the enumeration's name, strictness, and declared enumerators (value, label, optional description) so consumers can map raw values to display labels without re-reading schema.
272
+ - `StructValue` and `ArrayValue` — composite value types complementing the existing `PrimitiveValue`. `Value` is the new top-level union (`PrimitiveValue | StructValue | ArrayValue | undefined`) that represents any value that can be assigned to an EC instance property.
273
+
274
+ ### Patch Changes
275
+
276
+ - [#1198](https://github.com/iTwin/presentation/pull/1198): Fix `Event` type to prohibit being assigned an event with no-argument listener (unless the target event uses a no-argument listener).
277
+
278
+ Now TS will complain about the following assignment, which it previously allowed:
279
+
280
+ ```ts
281
+ const noArg: Event<() => void> = {} as any;
282
+ const withArg: Event<(arg: number) => void> = noArg; // TS didn't complain, but it does
283
+ ```
284
+ - [#1429](https://github.com/iTwin/presentation/pull/1429): `createRelationshipPathJoinClause`: The step `instanceFilter` alias placeholders are now substituted in both their bare (`this.`, `rel.`) and bracket-quoted (`[this].`, `[rel].`) forms.
285
+
286
+ Previously only the bare form was replaced, so a bracket-quoted placeholder was left referencing a non-existent alias in the generated JOIN `ON` clause.
287
+ - [#1128](https://github.com/iTwin/presentation/pull/1128): Fix `InstanceKey` methods `equals` and `compare` not handling different schema-class separators and casing.
288
+ - [#985](https://github.com/iTwin/presentation/pull/985): Bump iTwin.js Core dependencies to `5.14.2`.
289
+
290
+ ## 2.0.0-alpha.16
291
+
292
+ ### Major Changes
293
+
294
+ - [#1640](https://github.com/iTwin/presentation/pull/1640): `ECSqlBinding`: The `idset` binding's `value` is now `readonly Id64String[]` (previously `Id64String[]`). This is non-breaking for consumers who only define bindings, but breaking for code that reads `idset` binding values and passes them to APIs expecting a mutable array (e.g., custom `ECSqlQueryExecutor` implementations).
295
+
296
+ Migration example:
297
+
298
+ ```ts
299
+ // Before
300
+ binder.bindIdSet(key, OrderedId64Iterable.sortArray(binding.value));
301
+
302
+ // After
303
+ binder.bindIdSet(key, OrderedId64Iterable.sortArray([...binding.value]));
304
+ ```
305
+ - [#1606](https://github.com/iTwin/presentation/pull/1606): `ECSchemaProvider`: Add a required `getHiddenClassesTree` method, which returns a tree of classes, derived from the given class, whose visibility is changed through `CoreCustomAttributes.HiddenClass` or `CoreCustomAttributes.HiddenSchema` custom attributes. Building the tree requires traversing the whole derived classes' hierarchy, so implementations are expected to cache the result and refresh it when the iModel's schemas change.
306
+
307
+ Additions:
308
+
309
+ - `HiddenClassesTreeNode` describes a node of the tree. Root nodes are the outermost hidden derived classes, their children are derived classes that are explicitly shown, and so on. The selected class itself is always considered visible.
310
+ - `createHiddenClassesTree` builds the tree using the given schema provider. It doesn't cache the result, and is meant for implementing `ECSchemaProvider.getHiddenClassesTree`.
311
+ - `ECSql.createHiddenClassesFilter` creates a filter that excludes instances of classes, derived from the given base class and hidden through the above custom attributes. The tree is requested from the given schema provider once, and the filter's `createWhereClause` creates an ECSQL condition for the given class alias. The condition is an empty string when nothing needs to be excluded.
312
+
313
+ ```ts
314
+ const filter = await ECSql.createHiddenClassesFilter({ schemaProvider, baseClassName: "BisCore.GeometricElement3d" });
315
+ const condition = filter.createWhereClause("e");
316
+ const ecsql = `SELECT e.ECInstanceId FROM BisCore.GeometricElement3d e ${condition ? `WHERE ${condition}` : ""}`;
317
+ ```
318
+
319
+ Custom `ECSchemaProvider` implementations need to implement the new method. The one created by `createECSchemaProvider` from `@itwin/presentation-core-interop` already does that. Example of a custom implementation:
320
+
321
+ ```ts
322
+ const hiddenClassesTrees = new Map<string, Promise<HiddenClassesTreeNode[]>>();
323
+ const schemaProvider: ECSchemaProvider = {
324
+ getSchema: async (schemaName) => getMySchema(schemaName),
325
+ classDerivesFrom: async (derivedClassName, baseClassName) => myClassDerivesFrom(derivedClassName, baseClassName),
326
+ getHiddenClassesTree: async (selectClassName) => {
327
+ let tree = hiddenClassesTrees.get(selectClassName);
328
+ if (!tree) {
329
+ tree = createHiddenClassesTree({ schemaProvider, selectClassName });
330
+ tree.catch(() => hiddenClassesTrees.delete(selectClassName));
331
+ hiddenClassesTrees.set(selectClassName, tree);
332
+ }
333
+ return tree;
334
+ },
335
+ };
336
+ ```
337
+
338
+ ### Minor Changes
339
+
340
+ - [#1654](https://github.com/iTwin/presentation/pull/1654): `ECSqlBinding`: Allow `idset` bindings to use mutable or readonly sets of IDs in addition to arrays.
341
+ - [#1606](https://github.com/iTwin/presentation/pull/1606): Export `DeepReadonly` type for recursively marking all properties as readonly with no depth limit.
342
+
343
+ ## 2.0.0-alpha.15
344
+
345
+ ### Minor Changes
346
+
347
+ - [#1595](https://github.com/iTwin/presentation/pull/1595): `PrimitiveValueDescriptor`: Add an `extendedType` property that carries a primitive property's `extendedTypeName` (e.g. `"Json"`, `"BeGuid"`), when set, so consumers can refine how a `type`-typed value should be interpreted without re-reading schema. `@itwin/presentation-content` now populates it for primitive properties.
348
+
349
+ ## 2.0.0-alpha.14
350
+
351
+ ### Minor Changes
352
+
353
+ - [#1551](https://github.com/iTwin/presentation/pull/1551): Introduced `NavigationValue` for representing instances targeted by navigation properties.
354
+
355
+ ## 2.0.0-alpha.13
356
+
357
+ ### Major Changes
358
+
359
+ - [#1531](https://github.com/iTwin/presentation/pull/1531): `EC.RelationshipConstraintMultiplicity`: Changed `upperLimit` type from `number` to `number | "unbounded"`.
360
+
361
+ Previously, `createECSchemaProvider` from `@itwin/presentation-core-interop` reported an unbounded (`*`) upper limit as `0`, which silently made the natural `upperLimit > 1` check treat many-valued relationships as single-valued. The limit is now an explicit `"unbounded"` value that consumers must handle:
362
+
363
+ ```ts
364
+ const isManyValued =
365
+ constraint.multiplicity.upperLimit === "unbounded" ||
366
+ constraint.multiplicity.upperLimit > 1;
367
+ ```
368
+
369
+ - [#1503](https://github.com/iTwin/presentation/pull/1503): Full class and property names are now compared case-sensitively. Provide names using the casing defined by their EC schemas.
370
+ - [#1493](https://github.com/iTwin/presentation/pull/1493): Expose access to enumerations, kind-of-quantities and property categories through `EC.Schema`, and extend `EC.KindOfQuantity` with `relativeError` and `persistenceUnit` attributes. Schemas returned by `createECSchemaProvider` now implement the new getters.
371
+
372
+ - `EC.Schema` now requires `getEnumeration`, `getKindOfQuantity` and `getPropertyCategory` methods (mirroring the existing `getClass`). Consumers that only use `EC.Schema` are unaffected, but custom implementations of the interface must add these getters:
373
+
374
+ ```ts
375
+ const schema: EC.Schema = {
376
+ name,
377
+ version,
378
+ isHidden,
379
+ getClass: (className) => classes.get(className),
380
+ // added:
381
+ getEnumeration: (enumName) => enumerations.get(enumName),
382
+ getKindOfQuantity: (koqName) => kindOfQuantities.get(koqName),
383
+ getPropertyCategory: (categoryName) => categories.get(categoryName),
384
+ };
385
+ ```
386
+
387
+ - `EC.KindOfQuantity` now requires `relativeError` (`number`) and `persistenceUnit` (`string`) attributes. Custom implementations must provide them.
388
+
389
+ - `createECSchemaProvider`: The `EC.Schema` returned by the provider now implements the new getters, giving access to enumerations, kind-of-quantities and property categories in addition to classes. Existing code keeps working without changes and can now read these additional schema items:
390
+
391
+ ```ts
392
+ const schemaProvider = createECSchemaProvider(imodel);
393
+ const schema = await schemaProvider.getSchema("BisCore");
394
+ const enumeration = schema?.getEnumeration("MySchema.MyEnum");
395
+ const koq = schema?.getKindOfQuantity("MySchema.MyKoq");
396
+ const category = schema?.getPropertyCategory("MySchema.MyCategory");
397
+ ```
398
+
399
+ - [#1491](https://github.com/iTwin/presentation/pull/1491): `ECSchemaProvider`: Added a `classDerivesFrom` method for checking whether one ECClass is the same as, or derives from, another. `createECSchemaProvider` (in `@itwin/presentation-core-interop`) implements it using the class hierarchy information it already loads, so the answer is returned synchronously once the hierarchy has been loaded and no additional round-trips to the iModel are needed.
400
+
401
+ Also, `ECClassHierarchyInspector` and `createCachingECClassHierarchyInspector` have been deprecated. Because `ECSchemaProvider` now exposes `classDerivesFrom` directly, a separate class hierarchy inspector is no longer needed when setting up iModel access:
402
+
403
+ ```ts
404
+ // Before:
405
+ import { createCachingECClassHierarchyInspector } from "@itwin/presentation-shared";
406
+ import {
407
+ createECSchemaProvider,
408
+ createECSqlQueryExecutor,
409
+ } from "@itwin/presentation-core-interop";
410
+
411
+ const schemaProvider = createECSchemaProvider(imodel);
412
+ const imodelAccess = {
413
+ ...schemaProvider,
414
+ ...createCachingECClassHierarchyInspector({ schemaProvider }),
415
+ ...createECSqlQueryExecutor(imodel),
416
+ };
417
+
418
+ // After:
419
+ import {
420
+ createECSchemaProvider,
421
+ createECSqlQueryExecutor,
422
+ } from "@itwin/presentation-core-interop";
423
+
424
+ const imodelAccess = {
425
+ ...createECSchemaProvider(imodel), // now also provides `classDerivesFrom`
426
+ ...createECSqlQueryExecutor(imodel),
427
+ };
428
+ ```
429
+
430
+ **Breaking changes:**
431
+
432
+ - `ECSchemaProvider` now requires a `classDerivesFrom` method. Objects created via `createECSchemaProvider` get it automatically, so most consumers don't need to change anything. Only custom, hand-written `ECSchemaProvider` implementations need to add the method.
433
+
434
+ - Renamed the `classHierarchyInspector` prop to `imodelAccess` on `createClassBasedInstanceLabelSelectClauseFactory`, `createBisInstanceLabelSelectClauseFactory` (both in `@itwin/presentation-shared`) and `createPredicateBasedHierarchyDefinition` (in `@itwin/presentation-hierarchies`). The prop's type is unchanged, so the value passed to it doesn't need to change - only the prop name:
435
+
436
+ ```ts
437
+ // Before:
438
+ const classHierarchyInspector = createCachingECClassHierarchyInspector({
439
+ schemaProvider: createECSchemaProvider(imodel),
440
+ });
441
+ createPredicateBasedHierarchyDefinition({
442
+ classHierarchyInspector,
443
+ hierarchy,
444
+ });
445
+
446
+ // After:
447
+ const imodelAccess = createECSchemaProvider(imodel);
448
+ createPredicateBasedHierarchyDefinition({ imodelAccess, hierarchy });
449
+ ```
450
+
451
+ - [#1394](https://github.com/iTwin/presentation/pull/1394): `EC` namespace interfaces in `@itwin/presentation-shared` no longer use `Promise` wrappers — once a schema is loaded via the still-async `ECSchemaProvider.getSchema`, all further navigation (`baseClass`, `is()`, `getProperty()`, `getProperties()`, `kindOfQuantity`, `relationshipClass`, `enumeration`, `abstractConstraint`) is synchronous.
452
+
453
+ Additional changes:
454
+
455
+ - The `EC.Class.getDerivedClasses()` method was replaced with `getDerivedClassNames(props?: { onlyDirect?: boolean })`. `ECSchemaProvider` can be used to load the derived classes by name, if needed.
456
+ - The `getCustomAttributes()` method has been removed from `EC.Schema`, `EC.Class`, and `EC.Property` and replaced with an `isHidden: boolean` property. `EC.CustomAttributeSet` and `EC.CustomAttribute` types have been removed.
457
+ - Added an `EC.Class.getOwnProperties()` method that returns only the properties defined on the class itself, without inherited properties.
458
+ - Added an `EC.EntityClass.getMixins()` method that returns all mixins applied to the entity class.
459
+ - Added an optional `EC.Property.category` attribute.
460
+ - Added a required `EC.RelationshipConstraint.constraintClasses` attribute.
461
+ - Added missing optional `description` attributes to `EC.Schema` and `EC.Property`.
462
+
463
+ ### Minor Changes
464
+
465
+ - [#1507](https://github.com/iTwin/presentation/pull/1507): Add `eachValueFrom` for consuming subscribable streams through async iteration.
466
+
467
+ ### Patch Changes
468
+
469
+ - [#1524](https://github.com/iTwin/presentation/pull/1524): Fix `eachValueFrom` dropping legitimately emitted `undefined` values when they're buffered before the consumer requests them.
470
+ - [#1496](https://github.com/iTwin/presentation/pull/1496): `createRelationshipPathJoinClause`: The pre-resolved (sync) overload now accepts a rendering-only input — each step only needs its `joins`, plus an optional top-level `bindings` — instead of the full `RelationshipPathJoinInfo` shape. Callers that only need to render JOINs no longer have to supply the unused `relationshipClassIdSelector`, `sourceClassIdSelector`, and `targetClassIdSelector` fields per step.
471
+
472
+ ## 2.0.0-alpha.12
473
+
474
+ ### Major Changes
475
+
476
+ - [#1446](https://github.com/iTwin/presentation/pull/1446): `EC.EntityClass`: Added `getMixins` method that returns the mixins applied directly to the entity class.
477
+ - [#1454](https://github.com/iTwin/presentation/pull/1454): Dropped CommonJS support. These packages are now published as ES modules (ESM) only.
478
+
479
+ ### Minor Changes
480
+
481
+ - [#1455](https://github.com/iTwin/presentation/pull/1455): Added `ECSqlBinding.create` for creating ECSQL bindings from typed primitive values.
482
+ - [#1455](https://github.com/iTwin/presentation/pull/1455): Added exported `Point2dValue` and `Point3dValue` types for representing point primitive values.
483
+ - [#1452](https://github.com/iTwin/presentation/pull/1452): `Props`: Added support for overloaded functions.
484
+
485
+ When the given function has multiple overload signatures, `Props` now resolves to the union of the parameter types across all overloads instead of only reflecting the last signature.
486
+
487
+ - [#1452](https://github.com/iTwin/presentation/pull/1452): Add `createRelationshipPathJoinInfo` that resolves a relationship path into a flat, structured list of join descriptors without producing ECSQL. The returned result lets callers inspect the resolved join structure — e.g. to count the number of join tables without re-reading the schema.
488
+
489
+ In addition, add a sync `createRelationshipPathJoinClause(info)` overload that renders a pre-resolved result of `createRelationshipPathJoinInfo` into an ECSQL JOIN clause without any async schema access.
490
+
491
+ - [#1455](https://github.com/iTwin/presentation/pull/1455): `TypedPrimitiveValue.create`: The return type is now narrowed based on the given `type` argument, so the result only exposes the properties valid for that type. For example, creating a value with type `"Point3d"` no longer exposes the `koqName` property.
492
+ - [#1459](https://github.com/iTwin/presentation/pull/1459): `ECSql.createRelationshipPathJoinInfo`: The `joins` array moved from the top-level result into each entry of the returned `steps[]`, so every step now carries its own ordered `joins`. In addition, each step exposes selectors for the path step's concrete `ECClassId` — `relationshipClassIdSelector`, `sourceClassIdSelector` (`[sourceAlias].[ECClassId]`) and `targetClassIdSelector` (`[targetAlias].[ECClassId]`). For a link-table step the relationship selector is `[relationshipAlias].[ECClassId]`; for a navigation-property step it is `[ownerAlias].[navigationProperty].[RelECClassId]`. For `outer` joins the relationship and target selectors yield `NULL` when nothing is related.
493
+
494
+ ## 2.0.0-alpha.11
495
+
496
+ ### Major Changes
497
+
498
+ - [#1445](https://github.com/iTwin/presentation/pull/1445): `EC.Class`: Added `getOwnProperties` method that returns only the properties defined directly on the class, excluding those inherited from base classes.
499
+ - [#1360](https://github.com/iTwin/presentation/pull/1360): `createRelationshipPathJoinClause` now returns `{ joins: string; bindings?: Record<string, ECSqlBinding> }` instead of a plain `string`. Callers must be updated to read the SQL clause from the `joins` property:
500
+
501
+ ```ts
502
+ // Before
503
+ const joinClause = await createRelationshipPathJoinClause({
504
+ schemaProvider,
505
+ path,
506
+ });
507
+
508
+ // After
509
+ const { joins: joinClause, bindings } =
510
+ await createRelationshipPathJoinClause({ schemaProvider, path });
511
+ ```
512
+
513
+ `RelationshipPathStep` now accepts an optional `instanceFilter` attribute. When provided, the resolved expression is appended as an `AND` condition to the relevant JOIN's `ON` clause. ECSQL parameter bindings declared in `instanceFilter.bindings` are collected across all steps and returned in the `bindings` field of the result.
514
+
515
+ - [#1350](https://github.com/iTwin/presentation/pull/1350): `ECSqlQueryDef.bindings` is now `ECSqlBinding[] | Record<string, ECSqlBinding>` (previously `ECSqlBinding[]`). This is non-breaking for consumers who only define queries, but breaking for code that reads or forwards bindings (e.g., custom `ECSqlQueryExecutor` implementations) because it must now handle both formats.
516
+
517
+ Migration example:
518
+
519
+ ```ts
520
+ // Before
521
+ function handleBindings(bindings: ECSqlBinding[]) {
522
+ bindings.forEach((b, i) => bind(i + 1, b));
523
+ }
524
+
525
+ // After
526
+ function handleBindings(
527
+ bindings: ECSqlBinding[] | Record<string, ECSqlBinding>
528
+ ) {
529
+ const entries: Array<[string | number, ECSqlBinding]> = Array.isArray(
530
+ bindings
531
+ )
532
+ ? bindings.map((b, i) => [i + 1, b])
533
+ : Object.entries(bindings);
534
+ for (const [key, b] of entries) {
535
+ bind(key, b);
536
+ }
537
+ }
538
+ ```
539
+
540
+ Alternatively, update to the latest `@itwin/presentation-core-interop` which handles both binding formats out of the box.
541
+
542
+ - [#1444](https://github.com/iTwin/presentation/pull/1444): `EC.Property`: Added `category` attribute that provides access to the property's `EC.PropertyCategory`. Also added a `description` attribute to `EC.SchemaItem`.
543
+ - [#1363](https://github.com/iTwin/presentation/pull/1363): Add `version` property to `EC.Schema` interface. Any code that manually implements the `EC.Schema` interface must now provide a `version: { read: number; write: number; minor: number }` object matching the EC schema version format `"read.write.minor"`.
544
+
545
+ Consumers who obtain `EC.Schema` objects exclusively through `createECSchemaProvider` from `@itwin/presentation-core-interop` are unaffected — upgrading to the latest `@itwin/presentation-core-interop` is sufficient.
546
+
547
+ Migration example for custom `EC.Schema` implementations:
548
+
549
+ ```ts
550
+ // Before
551
+ const schema: EC.Schema = {
552
+ name: "MySchema",
553
+ getClass: async () => undefined,
554
+ getCustomAttributes: async () => new Map(),
555
+ };
556
+
557
+ // After
558
+ const schema: EC.Schema = {
559
+ name: "MySchema",
560
+ version: { read: 1, write: 0, minor: 0 },
561
+ getClass: async () => undefined,
562
+ getCustomAttributes: async () => new Map(),
563
+ };
564
+ ```
565
+
566
+ ### Minor Changes
567
+
568
+ - [#1379](https://github.com/iTwin/presentation/pull/1379): `ECSql.createClassSelector`: Add a utility that creates a bracket-quoted ECSQL class selector (`[SchemaName].[ClassName]`) from a full class name.
569
+ - [#1361](https://github.com/iTwin/presentation/pull/1361): `TypedPrimitiveValue`: The `type` fields now use `Extract<PrimitiveValueType, ...>` to stay in sync with `PrimitiveValueType`. Additionally, the `koqName` property is now available for `"Integer"` and `"Long"` typed values, not just `"Double"`.
570
+ - [#1357](https://github.com/iTwin/presentation/pull/1357): Added new public APIs for describing and carrying property values:
571
+
572
+ - `ValueDescriptor` — a discriminated union (`PrimitiveValueDescriptor | StructValueDescriptor | ArrayValueDescriptor | NavigationValueDescriptor`) that describes the shape of a value without carrying the value itself.
573
+ - `NavigationValueDescriptor` — describes a navigation property value (a reference to another EC instance). The runtime value stays the referenced instance's id, while this descriptor additionally carries the reference's target class name (`targetClassName`) as metadata.
574
+ - `PrimitiveValueDescriptor` now carries optional enumeration metadata (via `enumeration`) for enumeration-backed values. Only available on `String | Integer | Long`-typed descriptors, with the enumerator value type discriminated by `type` (`String` → `string`, `Integer | Long` → `number`). The runtime value stays the raw backing primitive, while the descriptor preserves the enumeration's name, strictness, and declared enumerators (value, label, optional description) so consumers can map raw values to display labels without re-reading schema.
575
+ - `StructValue` and `ArrayValue` — composite value types complementing the existing `PrimitiveValue`. `Value` is the new top-level union (`PrimitiveValue | StructValue | ArrayValue | undefined`) that represents any value that can be assigned to an EC instance property.
576
+
577
+ ### Patch Changes
578
+
579
+ - [#1429](https://github.com/iTwin/presentation/pull/1429): `createRelationshipPathJoinClause`: The step `instanceFilter` alias placeholders are now substituted in both their bare (`this.`, `rel.`) and bracket-quoted (`[this].`, `[rel].`) forms.
580
+
581
+ Previously only the bare form was replaced, so a bracket-quoted placeholder was left referencing a non-existent alias in the generated JOIN `ON` clause.
582
+
583
+ ## 2.0.0-alpha.10
584
+
585
+ ### Minor Changes
586
+
587
+ - [#1307](https://github.com/iTwin/presentation/pull/1307): Add `createIModelInstanceLabelSelectClauseFactory` — a new `IInstanceLabelSelectClauseFactory` implementation that applies `InstanceLabelOverride` rules stored in the iModel.
588
+
589
+ Rules are read from `PresentationRules.Ruleset` elements (top-level `rules[]` only) by querying the iModel via `ECSqlQueryExecutor`. All `InstanceLabelOverride` value specification types are supported: `String`, `Property`, `ClassName`, `ClassLabel`, `BriefcaseId`, `LocalId`, and `Composite`. Path-based specs (`RelatedInstanceLabel`, `Property` with `propertySource`) degrade silently to the next available value.
590
+
591
+ When the `PresentationRules` schema is not imported into the iModel, the factory falls back transparently to the provided `defaultClauseFactory` (defaults to `createBisInstanceLabelSelectClauseFactory`).
592
+
593
+ ## 2.0.0-alpha.9
594
+
595
+ ### Major Changes
596
+
597
+ - [#1250](https://github.com/iTwin/presentation/pull/1250): Use type-safe full class names.
598
+
599
+ The full class names used in this package were defined as `string`, although we always expect them to be in specific format - either `Schema:Class` or `Schema.Class`. In many cases we rely on this format when parsing the name for compare or other purposes, so type safety for the format is highly beneficial. This change makes full class names type-safe(ier) through [TypeScript's template literal types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), so that we can be sure that they are always in correct format.
600
+
601
+ ## Additions
602
+
603
+ - Added 3 new types to the `EC` namespace:
604
+ - `FullClassNameColonNotation` - matches the format `Schema:Class`,
605
+ - `FullClassNameDotNotation` - matches the format `Schema.Class`,
606
+ - `FullClassName` - union of the above two.
607
+
608
+ ## Non-breaking changes
609
+
610
+ - Updated `normalizeFullClassName` to return `EC.FullClassNameDotNotation` instead of `string`. The returned value is still assignable to `string`, but it adds type safety for the expected format of the full class name.
611
+
612
+ ## Breaking changes
613
+
614
+ - Changed `EC.CustomAttribute.className` to be of type `EC.FullClassName` instead of `string`.
615
+ - Changed `EC.CustomAttributeSet.get` argument to be of type `EC.FullClassName` instead of `string`.
616
+ - Changed `EC.SchemaItem.fullName` to be of type `EC.FullClassName` instead of `string`.
617
+ - Changed `compareFullClassNames` arguments to be of type `EC.FullClassName` instead of `string`.
618
+ - Changed `createClassBasedInstanceLabelSelectClauseFactory` prop `clauses` to take objects with `{ className: EC.FullClassName }` arguments instead of `{ className: string }`.
619
+ - Changed `IInstanceLabelSelectClauseFactory.createSelectClause` prop `className` to be of type `EC.FullClassName` instead of `string`.
620
+ - Changed `ECSql.createPrimitivePropertyValueSelectorProps` prop `propertyClassName` to be of type `EC.FullClassName` instead of `string`.
621
+ - Changed `ECSql.createRelationshipPathJoinClause` prop `path` to take class names (`relationshipName`, `sourceClassName` and `targetClassName`) of type `EC.FullClassName` instead of `string`.
622
+ - Changed `ECClassHierarchyInspector.classDerivesFrom` arguments to be of type `EC.FullClassName` instead of `string`.
623
+ - Changed the second argument of `getClass` to be of type `EC.FullClassName` instead of `string`.
624
+ - Changed `InstanceKey.className` to be of type `EC.FullClassName` instead of `string`.
625
+
626
+ In many cases migration will be seamless, as long as the input string matches the expected format. In some cases (e.g. when assigning a string variable to one of the affected properties), you may need to use `normalizeFullClassName` to ensure the value is of the correct type:
627
+
628
+ ```ts
629
+ const myClassName: string = "MySchema.MyClass";
630
+
631
+ // before
632
+ const myClass = getClass(schemaProvider, myClassName);
633
+
634
+ // after
635
+ const myClass = getClass(schemaProvider, normalizeFullClassName(myClassName));
636
+ ```
637
+
3
638
  ## 2.0.0-alpha.8
4
639
 
5
640
  ### Major Changes
@@ -72,6 +707,7 @@
72
707
  ### Major Changes
73
708
 
74
709
  - [#954](https://github.com/iTwin/presentation/pull/954): Add additional requirements for types in `EC` metadata namespace, whose objects are returned by `ECSchemaProvider`.
710
+
75
711
  - `EC.Schema`, `EC.Class` and `EC.Property` now all have an async `getCustomAttributes()` method that returns an `EC.CustomAttributeSet`, allowing consumers to access custom attributes of these schema items.
76
712
  - `EC.Class` now additionally has these members:
77
713
  - `baseClass: Promise<Class | undefined>`
@@ -81,6 +717,97 @@
81
717
 
82
718
  In reality, consumers will likely use `@itwin/presentation-core-interop` package for creating them, and the package has been updated to handle the change, so reacting to the breaking change is as simple as bumping the version of `@itwin/presentation-core-interop` package in the consumer's `package.json`.
83
719
 
720
+ ## 1.2.24
721
+
722
+ ### Patch Changes
723
+
724
+ - [#1650](https://github.com/iTwin/presentation/pull/1650): Update iTwin.js Core dependencies to `5.14.3`.
725
+
726
+ ## 1.2.23
727
+
728
+ ### Patch Changes
729
+
730
+ - [#1580](https://github.com/iTwin/presentation/pull/1580): Update iTwin.js Core dependencies to `5.14.2`.
731
+
732
+ ## 1.2.22
733
+
734
+ ### Patch Changes
735
+
736
+ - [#1543](https://github.com/iTwin/presentation/pull/1543): Update iTwin.js core dependencies to `^5.13.1` and refresh related tooling/test dependencies.
737
+
738
+ ## 1.2.21
739
+
740
+ ### Patch Changes
741
+
742
+ - [#1521](https://github.com/iTwin/presentation/pull/1521): `createRelationshipPathJoinClause`: fix produced ECSQL being invalid when joining with `joinType: "outer"`. The produced snippet used `OUTER JOIN`, which ECSQL fails to parse - now it uses `LEFT OUTER JOIN`.
743
+
744
+ ## 1.2.20
745
+
746
+ ### Patch Changes
747
+
748
+ - [#1500](https://github.com/iTwin/presentation/pull/1500): Update iTwin.js core dependencies to ^5.12.4 and refresh related tooling/test dependencies.
749
+
750
+ ## 1.2.19
751
+
752
+ ### Patch Changes
753
+
754
+ - [#1473](https://github.com/iTwin/presentation/pull/1473): Bump dependencies.
755
+
756
+ ## 1.2.18
757
+
758
+ ### Patch Changes
759
+
760
+ - [#1430](https://github.com/iTwin/presentation/pull/1430): Bump dependencies.
761
+
762
+ ## 1.2.17
763
+
764
+ ### Patch Changes
765
+
766
+ - [#1400](https://github.com/iTwin/presentation/pull/1400): Bump dependencies.
767
+
768
+ ## 1.2.16
769
+
770
+ ### Patch Changes
771
+
772
+ - [#1390](https://github.com/iTwin/presentation/pull/1390): Update `@itwin/core-*` dependencies to `^5.10.0`.
773
+
774
+ ## 1.2.15
775
+
776
+ ### Patch Changes
777
+
778
+ - [#1383](https://github.com/iTwin/presentation/pull/1383): Optimize `parseFullClassName` parsing performance.
779
+
780
+ ## 1.2.14
781
+
782
+ ### Patch Changes
783
+
784
+ - [#1358](https://github.com/iTwin/presentation/pull/1358): Bump dependencies.
785
+
786
+ ## 1.2.13
787
+
788
+ ### Patch Changes
789
+
790
+ - [#1338](https://github.com/iTwin/presentation/pull/1338): Bump iTwin.js core dependencies to `^5.9.1`.
791
+
792
+ ## 1.2.12
793
+
794
+ ### Patch Changes
795
+
796
+ - [#1300](https://github.com/iTwin/presentation/pull/1300): Use more distinctive aliases in label select clauses to avoid collisions with aliases in outer FROM clause.
797
+ - [#1313](https://github.com/iTwin/presentation/pull/1313): Bump dependencies.
798
+
799
+ ## 1.2.11
800
+
801
+ ### Patch Changes
802
+
803
+ - [#1286](https://github.com/iTwin/presentation/pull/1286): Bump dependencies.
804
+
805
+ ## 1.2.10
806
+
807
+ ### Patch Changes
808
+
809
+ - [#1242](https://github.com/iTwin/presentation/pull/1242): Bump dependencies.
810
+
84
811
  ## 1.2.9
85
812
 
86
813
  ### Patch Changes
@@ -141,6 +868,7 @@
141
868
  ### Minor Changes
142
869
 
143
870
  - [#791](https://github.com/iTwin/presentation/pull/791): Added a number of mapped types:
871
+
144
872
  - `Props<TFunc>` obtains the type of the first `TFunc` function argument.
145
873
 
146
874
  ```ts
@@ -194,10 +922,12 @@
194
922
  - [#703](https://github.com/iTwin/presentation/pull/703): **BREAKING:** Removed the option to specify value + ECProperty identifier when creating a `ConcatenatedValue`.
195
923
 
196
924
  The change provides two benefits:
925
+
197
926
  1. Access to schema is not required to format `ConcatenatedValue` parts as they already contain all the necessary metadata required for formatting the value. This is a step towards supporting multiple data sources, where schema information might be not available during formatting.
198
927
  2. Previously, the property type information had to be extracted for every row in the result set, which was inefficient. Now, the type information is extracted only once, when creating an ECSql query.
199
928
 
200
929
  Full list of changes:
930
+
201
931
  - `ConcatenatedValuePart.isProperty` - removed, as the "property" type was removed from the type union.
202
932
  - `ECSql.createConcatenatedValueJsonSelector` and `ECSql.createConcatenatedValueStringSelector` don't accept an option to specify value + ECProperty identifier as a selector argument anymore. Instead, the option that specifies value selector + type information should be used. The latter kind of selector can be created using the newly added `ECSql.createPrimitivePropertyValueSelectorProps` function (see below).
203
933
  - Added `ECSql.createPrimitivePropertyValueSelectorProps` function to help create a selector that specifies a value selector + type information. See README for more details.
@@ -273,13 +1003,18 @@
273
1003
  ### Minor Changes
274
1004
 
275
1005
  - [#628](https://github.com/iTwin/presentation/pull/628): Added support for nested concatenated values by adding `ConcatenatedValue` to the `ConcatenatedValuePart` union. In addition:
1006
+
276
1007
  - A type guard `ConcatenatedValuePart.isConcatenatedValue` has been added to distinguish it from other types of `ConcatenatedValuePart`.
277
1008
  - `ConcatenatedValue.serialize` has been modified to handle the new type of part seamlessly, so the `partFormatter` prop function receives the same 3 types of `ConcatenatedValuePart`, expanded from nested `ConcatenatedValue` if necessary.
278
1009
 
279
1010
  The change makes combining multiple concatenated values easier, e.g. now you can do this:
280
1011
 
281
1012
  ```ts
282
- const value: ConcatenatedValue = [createConcatenatedValueX(), { type: "String", value: " - " }, createConcatenatedValueY()];
1013
+ const value: ConcatenatedValue = [
1014
+ createConcatenatedValueX(),
1015
+ { type: "String", value: " - " },
1016
+ createConcatenatedValueY(),
1017
+ ];
283
1018
  ```
284
1019
 
285
1020
  ## 0.2.0