@itwin/presentation-common 5.3.0-dev.2 → 5.3.0-dev.23

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 (89) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/Ruleset.schema.json +18 -18
  3. package/lib/cjs/presentation-common/KeySet.d.ts +4 -4
  4. package/lib/cjs/presentation-common/KeySet.js +3 -3
  5. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  6. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +5 -5
  7. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  8. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +4 -4
  9. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  10. package/lib/cjs/presentation-common/Update.d.ts +7 -7
  11. package/lib/cjs/presentation-common/Update.js.map +1 -1
  12. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -1
  13. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  14. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +10 -10
  15. package/lib/cjs/presentation-common/hierarchy/Key.js +2 -2
  16. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  17. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +2 -2
  18. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  19. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +2 -2
  20. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  21. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +9 -9
  22. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +2 -2
  23. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  24. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
  25. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  26. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +4 -4
  27. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +1 -1
  28. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  29. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +1 -1
  30. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  31. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +6 -6
  32. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +1 -1
  33. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  34. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +1 -1
  35. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  36. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +2 -2
  37. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  38. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +1 -1
  39. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  40. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +1 -1
  41. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  42. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -1
  43. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  44. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +1 -1
  45. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  46. package/lib/esm/presentation-common/KeySet.d.ts +4 -4
  47. package/lib/esm/presentation-common/KeySet.js +3 -3
  48. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  49. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +5 -5
  50. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  51. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +4 -4
  52. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  53. package/lib/esm/presentation-common/Update.d.ts +7 -7
  54. package/lib/esm/presentation-common/Update.js.map +1 -1
  55. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -1
  56. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  57. package/lib/esm/presentation-common/hierarchy/Key.d.ts +10 -10
  58. package/lib/esm/presentation-common/hierarchy/Key.js +2 -2
  59. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  60. package/lib/esm/presentation-common/hierarchy/Node.d.ts +2 -2
  61. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  62. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +2 -2
  63. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  64. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +9 -9
  65. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +2 -2
  66. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  67. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
  68. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  69. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +4 -4
  70. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +1 -1
  71. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  72. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +1 -1
  73. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  74. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +6 -6
  75. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +1 -1
  76. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  77. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +1 -1
  78. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  79. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +2 -2
  80. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  81. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +1 -1
  82. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  83. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +1 -1
  84. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  85. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -1
  86. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  87. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +1 -1
  88. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  89. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  # Change Log - @itwin/presentation-common
2
2
 
3
- This log was last generated on Wed, 24 Sep 2025 17:43:58 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 16 Oct 2025 23:02:22 GMT and should not be manually modified.
4
+
5
+ ## 5.2.3
6
+ Thu, 16 Oct 2025 23:00:32 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.2.2
11
+ Fri, 10 Oct 2025 14:49:15 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 5.2.1
16
+ Thu, 09 Oct 2025 17:10:26 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 5.2.0
21
+ Wed, 01 Oct 2025 20:22:54 GMT
22
+
23
+ ### Updates
24
+
25
+ - Fixed content formatting failure when struct property value has members with `undefined` value.
26
+ - Deprecated hierarchies-related APIs
27
+ - Fix `ContentTraverser` droping metadata available for struct member properties.
28
+ - Add ability to override format used by `FormatterSpec`/`ParserSpec` created by `KoqPropertyValueFormatter`.
4
29
 
5
30
  ## 5.1.9
6
31
  Wed, 24 Sep 2025 17:38:08 GMT
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "ChildNodeRule": {
76
76
  "additionalProperties": false,
77
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
77
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
78
78
  "description": "Child node rules are used to define child nodes in a hierarchy.",
79
79
  "properties": {
80
80
  "condition": {
@@ -149,12 +149,12 @@
149
149
  "$ref": "#/definitions/RelatedInstanceNodesSpecification"
150
150
  }
151
151
  ],
152
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
152
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
153
153
  "description": "Hierarchy rule specifications that define what nodes are going to be returned by the rule."
154
154
  },
155
155
  "ClassGroup": {
156
156
  "additionalProperties": false,
157
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
157
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
158
158
  "description": "Base class grouping allows grouping ECInstance nodes by their base class (as opposed to the hierarchy\nspecifications' `groupByClass` attribute, which always groups by direct class).",
159
159
  "properties": {
160
160
  "baseClass": {
@@ -475,7 +475,7 @@
475
475
  },
476
476
  "CustomNodeSpecification": {
477
477
  "additionalProperties": false,
478
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
478
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
479
479
  "description": "Returns a static custom-defined node that's not based on an ECInstance.",
480
480
  "properties": {
481
481
  "description": {
@@ -559,7 +559,7 @@
559
559
  },
560
560
  "CustomQueryInstanceNodesSpecification": {
561
561
  "additionalProperties": false,
562
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
562
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
563
563
  "description": "Returns nodes for instances returned by a provided ECSQL query.",
564
564
  "properties": {
565
565
  "doNotSort": {
@@ -757,7 +757,7 @@
757
757
  },
758
758
  "ECPropertyValueQuerySpecification": {
759
759
  "additionalProperties": false,
760
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
760
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
761
761
  "description": "The specification specifies the name of the parent node instance property whose value is the ECSQL\nused to query for instances.",
762
762
  "properties": {
763
763
  "class": {
@@ -829,7 +829,7 @@
829
829
  },
830
830
  "GroupingRule": {
831
831
  "additionalProperties": false,
832
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
832
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
833
833
  "description": "Grouping rules provide advanced ways to group instances when creating hierarchies.",
834
834
  "properties": {
835
835
  "class": {
@@ -889,7 +889,7 @@
889
889
  "$ref": "#/definitions/SameLabelInstanceGroup"
890
890
  }
891
891
  ],
892
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
892
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
893
893
  "description": "Grouping rule specifications."
894
894
  },
895
895
  "IdCategoryIdentifier": {
@@ -1187,7 +1187,7 @@
1187
1187
  },
1188
1188
  "InstanceNodesOfSpecificClassesSpecification": {
1189
1189
  "additionalProperties": false,
1190
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1190
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1191
1191
  "description": "Returns nodes for instances of specific ECClasses.",
1192
1192
  "properties": {
1193
1193
  "classes": {
@@ -1337,7 +1337,7 @@
1337
1337
  },
1338
1338
  "NodeArtifactsRule": {
1339
1339
  "additionalProperties": false,
1340
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1340
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1341
1341
  "description": "Node artifacts rules are used to create and assign artifacts to specific nodes. The artifacts can be\naccessed when evaluating parent node's `hideExpression` to decide whether it should be hidden or not.",
1342
1342
  "properties": {
1343
1343
  "condition": {
@@ -1599,7 +1599,7 @@
1599
1599
  },
1600
1600
  "PropertyGroup": {
1601
1601
  "additionalProperties": false,
1602
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1602
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1603
1603
  "description": "Property grouping allows grouping by a property of the instance by value or by given ranges of values.",
1604
1604
  "properties": {
1605
1605
  "createGroupForSingleItem": {
@@ -1644,7 +1644,7 @@
1644
1644
  },
1645
1645
  "PropertyRangeGroupSpecification": {
1646
1646
  "additionalProperties": false,
1647
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1647
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1648
1648
  "description": "Describes a grouping range.",
1649
1649
  "properties": {
1650
1650
  "fromValue": {
@@ -1807,7 +1807,7 @@
1807
1807
  "$ref": "#/definitions/ECPropertyValueQuerySpecification"
1808
1808
  }
1809
1809
  ],
1810
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1810
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1811
1811
  "description": "Query specifications used in `CustomQueryInstanceNodesSpecification`."
1812
1812
  },
1813
1813
  "RelatedInstanceByPathSpecification": {
@@ -1878,7 +1878,7 @@
1878
1878
  },
1879
1879
  "RelatedInstanceNodesSpecification": {
1880
1880
  "additionalProperties": false,
1881
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1881
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
1882
1882
  "description": "Produces ECInstance nodes that are related to some source ECInstance. The source instance is determined\nby traversing the hierarchy upwards until an ECInstance node is encountered.",
1883
1883
  "properties": {
1884
1884
  "doNotSort": {
@@ -2210,7 +2210,7 @@
2210
2210
  },
2211
2211
  "RootNodeRule": {
2212
2212
  "additionalProperties": false,
2213
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2213
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2214
2214
  "description": "Root node rules are used to define nodes that are displayed at the root hierarchy level.",
2215
2215
  "properties": {
2216
2216
  "autoExpand": {
@@ -2314,7 +2314,7 @@
2314
2314
  },
2315
2315
  "SameLabelInstanceGroup": {
2316
2316
  "additionalProperties": false,
2317
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2317
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2318
2318
  "description": "Allows grouping multiple instances with the same label into one ECInstances type of node. Similar to display label grouping,\nbut instead of showing a grouping node with multiple grouped ECInstance nodes, it shows a single ECInstances node which represents\nmultiple ECInstances.",
2319
2319
  "properties": {
2320
2320
  "applicationStage": {
@@ -2459,7 +2459,7 @@
2459
2459
  },
2460
2460
  "StringQuerySpecification": {
2461
2461
  "additionalProperties": false,
2462
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2462
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2463
2463
  "description": "The specification contains an ECSQL query which is used to query for instances.",
2464
2464
  "properties": {
2465
2465
  "class": {
@@ -2487,7 +2487,7 @@
2487
2487
  },
2488
2488
  "SubCondition": {
2489
2489
  "additionalProperties": false,
2490
- "deprecated": "in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2490
+ "deprecated": "in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\npackage for creating hierarchies.",
2491
2491
  "description": "This is a sub-rule which shares *placement attributes* and\nnested customization rules\nof the hierarchy rule. This means the attributes of hierarchy rule are still in effect and the sub-rules\ncan add additional condition of their own.",
2492
2492
  "properties": {
2493
2493
  "condition": {
@@ -15,7 +15,7 @@ export declare namespace Key {
15
15
  /**
16
16
  * Check if the supplied key is a `NodeKey`
17
17
  *
18
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
18
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
19
19
  * package for creating hierarchies.
20
20
  */
21
21
  function isNodeKey(key: Key): key is Extract<Key, Readonly<NodeKey>>;
@@ -39,7 +39,7 @@ export interface KeySetJSON {
39
39
  /**
40
40
  * An array of serialized node keys
41
41
  *
42
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
42
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
43
43
  * package for creating hierarchies.
44
44
  */
45
45
  nodeKeys: NodeKey[];
@@ -83,14 +83,14 @@ export declare class KeySet {
83
83
  *
84
84
  * **Warning**: getting node keys might be expensive for large KeySets.
85
85
  *
86
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
86
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
87
87
  * package for creating hierarchies.
88
88
  */
89
89
  get nodeKeys(): Set<NodeKey>;
90
90
  /**
91
91
  * Get node keys count
92
92
  *
93
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
93
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
94
94
  * package for creating hierarchies.
95
95
  */
96
96
  get nodeKeysCount(): number;
@@ -16,7 +16,7 @@ var Key;
16
16
  /**
17
17
  * Check if the supplied key is a `NodeKey`
18
18
  *
19
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
19
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
20
20
  * package for creating hierarchies.
21
21
  */
22
22
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -99,7 +99,7 @@ class KeySet {
99
99
  *
100
100
  * **Warning**: getting node keys might be expensive for large KeySets.
101
101
  *
102
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
102
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
103
103
  * package for creating hierarchies.
104
104
  */
105
105
  get nodeKeys() {
@@ -113,7 +113,7 @@ class KeySet {
113
113
  /**
114
114
  * Get node keys count
115
115
  *
116
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
116
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
117
117
  * package for creating hierarchies.
118
118
  */
119
119
  get nodeKeysCount() {
@@ -1 +1 @@
1
- {"version":3,"file":"KeySet.js","sourceRoot":"","sources":["../../../src/presentation-common/KeySet.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAoG;AAYpG,cAAc;AACd,2DAA2D;AAC3D,IAAiB,GAAG,CAsBnB;AAtBD,WAAiB,GAAG;IAClB;;;;;OAKG;IACH,4DAA4D;IAC5D,SAAgB,SAAS,CAAC,GAAQ;QAChC,4DAA4D;QAC5D,OAAO,CAAC,CAAE,GAAe,CAAC,IAAI,CAAC;IAC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,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;QACD,4DAA4D;QAC5D,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;YACpD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO;YACL,YAAY;YACZ,QAAQ;SACT,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAgB;QACrC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxaD,wBAwaC;AAED,SAAS,kBAAkB,CAAC,SAAiB;IAC3C,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,IAAI,GAAG,CAAQ,GAAe,EAAE,EAA4B,EAAE,EAAE;IACpE,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { assert, CompressedId64Set, Guid, GuidString, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { EntityProps } from \"@itwin/core-common\";\nimport { InstanceId, InstanceKey } from \"./EC.js\";\nimport { NodeKey } from \"./hierarchy/Key.js\";\n\n/**\n * A single key that identifies something in an iTwin.js application\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type Key = Readonly<NodeKey> | Readonly<InstanceKey> | Readonly<EntityProps>;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace Key {\n /**\n * Check if the supplied key is a `NodeKey`\n *\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n export function isNodeKey(key: Key): key is Extract<Key, Readonly<NodeKey>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return !!(key as NodeKey).type;\n }\n\n /** Check if the supplied key is an `InstanceKey` */\n export function isInstanceKey(key: Key): key is Extract<Key, Readonly<InstanceKey>> {\n return !!(key as InstanceKey).className && !!(key as InstanceKey).id;\n }\n\n /** Check if the supplied key is an `EntityProps` */\n export function isEntityProps(key: Key): key is Extract<Key, Readonly<EntityProps>> {\n return !!(key as EntityProps).classFullName && !!(key as EntityProps).id;\n }\n}\n\n/**\n * A type for multiple keys that identify something in iModel.js application\n * @public\n */\nexport type Keys = ReadonlyArray<Key> | Readonly<KeySet>;\n\n/**\n * A data structure of serialized [[KeySet]]\n * @public\n */\nexport interface KeySetJSON {\n /** JSON representation of a list of instance keys */\n instanceKeys: Array<[string, string]>;\n /**\n * An array of serialized node keys\n *\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n nodeKeys: NodeKey[];\n}\n\n/**\n * A class that holds multiple [[Key]] objects. It's basically\n * used as a container that holds multiple keys of different types.\n *\n * @public\n */\nexport class KeySet {\n // note: all keys are stored as strings because we need ability to find them by value\n private _instanceKeys: Map<string, Set<string>>; // lower case class name => instance ids\n private _lowerCaseMap: Map<string, string>; // lower case class name => most recent class name\n private _nodeKeys: Set<string>;\n private _guid!: GuidString;\n\n /**\n * Creates an instance of KeySet.\n * @param source Optional source to initialize from.\n */\n constructor(source?: Keys) {\n this._instanceKeys = new Map();\n this._lowerCaseMap = new Map();\n this._nodeKeys = new Set();\n this.recalculateGuid();\n if (source) {\n this.add(source);\n }\n }\n\n private recalculateGuid() {\n // empty keyset should have empty guid, otherwise use a random guid value\n this._guid = this.isEmpty ? Guid.empty : Guid.createValue();\n }\n\n /**\n * Get a GUID that identifies changes in this keyset. The value\n * does not uniquely identify contents of the keyset, but it can be\n * used to check whether keyset has changed.\n */\n public get guid(): GuidString {\n return this._guid;\n }\n\n /**\n * Get a map of instance keys stored in this KeySet\n *\n * **Warning**: getting instance keys might be expensive for\n * large KeySets.\n */\n public get instanceKeys(): Map<string, Set<InstanceId>> {\n const map = new Map<string, Set<InstanceId>>();\n for (const entry of this._instanceKeys) {\n map.set(this._lowerCaseMap.get(entry[\"0\"])!, new Set([...entry[\"1\"]].map((key: string) => Id64.fromJSON(key))));\n }\n return map;\n }\n\n /**\n * Get instance keys count\n */\n public get instanceKeysCount(): number {\n let count = 0;\n this._instanceKeys.forEach((set: Set<string>) => (count += set.size));\n return count;\n }\n\n /**\n * Get a set of node keys stored in this KeySet\n *\n * **Warning**: getting node keys might be expensive for large KeySets.\n *\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public get nodeKeys() {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const set = new Set<NodeKey>();\n for (const serialized of this._nodeKeys) {\n set.add(JSON.parse(serialized));\n }\n return set;\n }\n\n /**\n * Get node keys count\n *\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public get nodeKeysCount(): number {\n return this._nodeKeys.size;\n }\n\n private isKeySet(set: Keys | Key): set is Readonly<KeySet> {\n return !!(set as KeySet)._nodeKeys && !!(set as KeySet)._instanceKeys;\n }\n\n private isKeysArray(keys: Keys | Key): keys is ReadonlyArray<Key> {\n return Array.isArray(keys);\n }\n\n /**\n * Clear this KeySet.\n * @returns itself\n */\n public clear(): KeySet {\n if (this.isEmpty) {\n return this;\n }\n\n this._instanceKeys = new Map();\n this._lowerCaseMap = new Map();\n this._nodeKeys = new Set();\n this.recalculateGuid();\n return this;\n }\n\n private addKeySet(keyset: Readonly<KeySet>, pred?: (key: Key) => boolean): void {\n for (const key of (keyset as any)._nodeKeys) {\n if (!pred || pred(JSON.parse(key))) {\n this._nodeKeys.add(key);\n }\n }\n for (const entry of (keyset as any)._instanceKeys) {\n let set = this._instanceKeys.get(entry[\"0\"]);\n const className = (keyset as KeySet)._lowerCaseMap.get(entry[\"0\"])!;\n if (!set) {\n set = new Set();\n this._instanceKeys.set(entry[\"0\"], set);\n this._lowerCaseMap.set(entry[\"0\"], className);\n }\n entry[\"1\"].forEach((id: Id64String) => {\n if (!pred || pred({ className, id })) {\n set.add(id);\n }\n });\n }\n }\n\n private addKeySetJSON(keyset: Readonly<KeySetJSON>): void {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n for (const key of keyset.nodeKeys) {\n this._nodeKeys.add(JSON.stringify(key));\n }\n for (const entry of keyset.instanceKeys) {\n const normalizedClassName = normalizeClassName(entry[\"0\"]);\n const lcClassName = normalizedClassName.toLowerCase();\n const idsJson: string | Id64String[] = entry[\"1\"];\n const ids: Set<Id64String> =\n typeof idsJson === \"string\" ? (idsJson === Id64.invalid ? new Set([Id64.invalid]) : CompressedId64Set.decompressSet(idsJson)) : new Set(idsJson);\n this._instanceKeys.set(lcClassName, ids);\n this._lowerCaseMap.set(lcClassName, normalizedClassName);\n }\n }\n\n /**\n * Add a key or keys to this KeySet.\n * @param value A key or keys to add.\n * @param pred An optional predicate function that indicates whether a key should be added\n * @returns itself\n */\n public add(value: Keys | Key, pred?: (key: Key) => boolean): KeySet {\n const sizeBefore = this.size;\n if (this.isKeySet(value)) {\n this.addKeySet(value, pred);\n } else if (this.isKeysArray(value)) {\n value.forEach((key) => this.add(key, pred));\n } else if (!pred || pred(value)) {\n if (Key.isEntityProps(value)) {\n this.add({ className: value.classFullName, id: Id64.fromJSON(value.id) } as InstanceKey);\n } else if (Key.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const lcClassName = normalizedClassName.toLowerCase();\n if (!this._instanceKeys.has(lcClassName)) {\n this._instanceKeys.set(lcClassName, new Set());\n }\n this._lowerCaseMap.set(lcClassName, normalizedClassName);\n this._instanceKeys.get(lcClassName)!.add(value.id);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (Key.isNodeKey(value)) {\n this._nodeKeys.add(JSON.stringify(value));\n }\n }\n if (this.size !== sizeBefore) {\n this.recalculateGuid();\n }\n return this;\n }\n\n private deleteKeySet(keyset: Readonly<KeySet>): void {\n for (const key of (keyset as any)._nodeKeys) {\n this._nodeKeys.delete(key);\n }\n for (const entry of (keyset as any)._instanceKeys) {\n const set = this._instanceKeys.get(entry[\"0\"]);\n if (set) {\n entry[\"1\"].forEach((key: string) => {\n set.delete(key);\n });\n }\n }\n }\n\n /**\n * Deletes a key or keys from this KeySet.\n * @param value A key or keys to delete.\n * @returns itself\n */\n public delete(value: Keys | Key): KeySet {\n const sizeBefore = this.size;\n if (this.isKeySet(value)) {\n this.deleteKeySet(value);\n } else if (this.isKeysArray(value)) {\n for (const key of value) {\n this.delete(key);\n }\n } else if (Key.isEntityProps(value)) {\n this.delete({ className: value.classFullName, id: value.id! } as InstanceKey);\n } else if (Key.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const set = this._instanceKeys.get(normalizedClassName.toLowerCase());\n if (set) {\n set.delete(value.id);\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (Key.isNodeKey(value)) {\n this._nodeKeys.delete(JSON.stringify(value));\n }\n if (this.size !== sizeBefore) {\n this.recalculateGuid();\n }\n return this;\n }\n\n /**\n * Check if this KeySet contains the specified key.\n * @param value The key to check.\n */\n public has(value: Key): boolean {\n if (Key.isEntityProps(value)) {\n return this.has({ className: value.classFullName, id: value.id! } as InstanceKey);\n }\n if (Key.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const set = this._instanceKeys.get(normalizedClassName.toLowerCase());\n return !!(set && set.has(value.id));\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n assert(Key.isNodeKey(value));\n return this._nodeKeys.has(JSON.stringify(value));\n }\n\n private hasKeySet(readonlyKeys: Readonly<KeySet>, checkType: \"all\" | \"any\"): boolean {\n // note: cast-away read-onlyness to access private members...\n const keys = readonlyKeys as KeySet;\n\n if (checkType === \"all\") {\n if (this._nodeKeys.size < keys._nodeKeys.size || this._instanceKeys.size < keys._instanceKeys.size) {\n return false;\n }\n if ([...keys._nodeKeys].some((key) => !this._nodeKeys.has(key))) {\n return false;\n }\n for (const otherEntry of keys._instanceKeys) {\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"]);\n if (!thisEntryKeys || thisEntryKeys.size < otherEntry[\"1\"].size) {\n return false;\n }\n if ([...otherEntry[\"1\"]].some((key) => !thisEntryKeys.has(key))) {\n return false;\n }\n }\n return true;\n }\n\n // \"any\" check type\n if ([...keys._nodeKeys].some((key) => this._nodeKeys.has(key))) {\n return true;\n }\n for (const otherEntry of keys._instanceKeys) {\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"]);\n if (thisEntryKeys && [...otherEntry[\"1\"]].some((key) => thisEntryKeys.has(key))) {\n return true;\n }\n }\n return false;\n }\n\n private hasKeysArray(keys: ReadonlyArray<Key>, checkType: \"all\" | \"any\"): boolean {\n if (checkType === \"all\") {\n if (this.size < keys.length) {\n return false;\n }\n for (const key of keys) {\n if (!this.has(key)) {\n return false;\n }\n }\n return true;\n }\n\n // \"any\" check type\n for (const key of keys) {\n if (this.has(key)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Check if this KeySet contains all the specified keys.\n * @param keys The keys to check.\n */\n public hasAll(keys: Keys): boolean {\n if (this.isKeySet(keys)) {\n return this.hasKeySet(keys, \"all\");\n }\n assert(this.isKeysArray(keys));\n return this.hasKeysArray(keys, \"all\");\n }\n\n /**\n * Check if this KeySet contains any of the specified keys.\n * @param keys The keys to check.\n */\n public hasAny(keys: Keys): boolean {\n if (this.isKeySet(keys)) {\n return this.hasKeySet(keys, \"any\");\n }\n assert(this.isKeysArray(keys));\n return this.hasKeysArray(keys, \"any\");\n }\n\n /**\n * Get the number of keys stored in this KeySet.\n */\n public get size(): number {\n const nodeKeysCount = this._nodeKeys.size;\n let instanceIdsCount = 0;\n for (const set of this._instanceKeys.values()) {\n instanceIdsCount += set.size;\n }\n return nodeKeysCount + instanceIdsCount;\n }\n\n /**\n * Is this KeySet currently empty.\n */\n public get isEmpty(): boolean {\n return 0 === this.size;\n }\n\n /** Iterate over all keys in this keyset. */\n public some(callback: (key: Key) => boolean) {\n for (const entry of this._instanceKeys) {\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase())!;\n if (some(entry[1], (id: Id64String) => callback({ className, id }))) {\n return true;\n }\n }\n return some(this._nodeKeys, (serializedKey: string) => callback(JSON.parse(serializedKey)));\n }\n\n /** Iterate over all keys in this keyset. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public forEach(callback: (key: InstanceKey | NodeKey, index: number) => void) {\n let index = 0;\n this._instanceKeys.forEach((ids: Set<Id64String>, className: string) => {\n const recentClassName = this._lowerCaseMap.get(className.toLowerCase())!;\n ids.forEach((id: Id64String) => callback({ className: recentClassName, id }, index++));\n });\n this._nodeKeys.forEach((serializedKey: string) => {\n callback(JSON.parse(serializedKey), index++);\n });\n }\n\n /** Iterate over all keys in this keyset in batches */\n public forEachBatch(batchSize: number, callback: (batch: KeySet, index: number) => void) {\n const size = this.size;\n const count = Math.ceil(size / batchSize);\n if (1 === count) {\n callback(this, 0);\n return;\n }\n let batch = new KeySet();\n let batchIndex = 0;\n let currBatchSize = 0;\n this.forEach((key, index) => {\n batch.add(key);\n ++currBatchSize;\n if (currBatchSize === batchSize || index === size - 1) {\n callback(batch, batchIndex++);\n batch = new KeySet();\n currBatchSize = 0;\n }\n });\n }\n\n /**\n * Serializes this KeySet to JSON\n * @public\n */\n public toJSON(): KeySetJSON {\n const instanceKeys: [string, string][] = [];\n for (const entry of this._instanceKeys.entries()) {\n if (entry[\"1\"].size > 0) {\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase());\n const compressedIds = CompressedId64Set.sortAndCompress(entry[\"1\"]);\n instanceKeys.push([className!, compressedIds.length > 0 ? compressedIds : Id64.invalid]);\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const nodeKeys: NodeKey[] = [];\n for (const serializedKey of this._nodeKeys.values()) {\n nodeKeys.push(JSON.parse(serializedKey));\n }\n return {\n instanceKeys,\n nodeKeys,\n };\n }\n\n /**\n * Creates a KeySet from JSON\n * @public\n */\n public static fromJSON(json: KeySetJSON): KeySet {\n const keyset = new KeySet();\n keyset.addKeySetJSON(json);\n return keyset;\n }\n}\n\nfunction normalizeClassName(className: string) {\n return className.replace(\".\", \":\");\n}\n\nconst some = <TItem>(set: Set<TItem>, cb: (item: TItem) => boolean) => {\n for (const item of set) {\n if (cb(item)) {\n return true;\n }\n }\n return false;\n};\n"]}
1
+ {"version":3,"file":"KeySet.js","sourceRoot":"","sources":["../../../src/presentation-common/KeySet.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAoG;AAYpG,cAAc;AACd,2DAA2D;AAC3D,IAAiB,GAAG,CAsBnB;AAtBD,WAAiB,GAAG;IAClB;;;;;OAKG;IACH,4DAA4D;IAC5D,SAAgB,SAAS,CAAC,GAAQ;QAChC,4DAA4D;QAC5D,OAAO,CAAC,CAAE,GAAe,CAAC,IAAI,CA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,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;QACD,4DAA4D;QAC5D,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;YACpD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO;YACL,YAAY;YACZ,QAAQ;SACT,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAgB;QACrC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxaD,wBAwaC;AAED,SAAS,kBAAkB,CAAC,SAAiB;IAC3C,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,IAAI,GAAG,CAAQ,GAAe,EAAE,EAA4B,EAAE,EAAE;IACpE,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { assert, CompressedId64Set, Guid, GuidString, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { EntityProps } from \"@itwin/core-common\";\nimport { InstanceId, InstanceKey } from \"./EC.js\";\nimport { NodeKey } from \"./hierarchy/Key.js\";\n\n/**\n * A single key that identifies something in an iTwin.js application\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type Key = Readonly<NodeKey> | Readonly<InstanceKey> | Readonly<EntityProps>;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace Key {\n /**\n * Check if the supplied key is a `NodeKey`\n *\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n export function isNodeKey(key: Key): key is Extract<Key, Readonly<NodeKey>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return !!(key as NodeKey).type;\n }\n\n /** Check if the supplied key is an `InstanceKey` */\n export function isInstanceKey(key: Key): key is Extract<Key, Readonly<InstanceKey>> {\n return !!(key as InstanceKey).className && !!(key as InstanceKey).id;\n }\n\n /** Check if the supplied key is an `EntityProps` */\n export function isEntityProps(key: Key): key is Extract<Key, Readonly<EntityProps>> {\n return !!(key as EntityProps).classFullName && !!(key as EntityProps).id;\n }\n}\n\n/**\n * A type for multiple keys that identify something in iModel.js application\n * @public\n */\nexport type Keys = ReadonlyArray<Key> | Readonly<KeySet>;\n\n/**\n * A data structure of serialized [[KeySet]]\n * @public\n */\nexport interface KeySetJSON {\n /** JSON representation of a list of instance keys */\n instanceKeys: Array<[string, string]>;\n /**\n * An array of serialized node keys\n *\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n nodeKeys: NodeKey[];\n}\n\n/**\n * A class that holds multiple [[Key]] objects. It's basically\n * used as a container that holds multiple keys of different types.\n *\n * @public\n */\nexport class KeySet {\n // note: all keys are stored as strings because we need ability to find them by value\n private _instanceKeys: Map<string, Set<string>>; // lower case class name => instance ids\n private _lowerCaseMap: Map<string, string>; // lower case class name => most recent class name\n private _nodeKeys: Set<string>;\n private _guid!: GuidString;\n\n /**\n * Creates an instance of KeySet.\n * @param source Optional source to initialize from.\n */\n constructor(source?: Keys) {\n this._instanceKeys = new Map();\n this._lowerCaseMap = new Map();\n this._nodeKeys = new Set();\n this.recalculateGuid();\n if (source) {\n this.add(source);\n }\n }\n\n private recalculateGuid() {\n // empty keyset should have empty guid, otherwise use a random guid value\n this._guid = this.isEmpty ? Guid.empty : Guid.createValue();\n }\n\n /**\n * Get a GUID that identifies changes in this keyset. The value\n * does not uniquely identify contents of the keyset, but it can be\n * used to check whether keyset has changed.\n */\n public get guid(): GuidString {\n return this._guid;\n }\n\n /**\n * Get a map of instance keys stored in this KeySet\n *\n * **Warning**: getting instance keys might be expensive for\n * large KeySets.\n */\n public get instanceKeys(): Map<string, Set<InstanceId>> {\n const map = new Map<string, Set<InstanceId>>();\n for (const entry of this._instanceKeys) {\n map.set(this._lowerCaseMap.get(entry[\"0\"])!, new Set([...entry[\"1\"]].map((key: string) => Id64.fromJSON(key))));\n }\n return map;\n }\n\n /**\n * Get instance keys count\n */\n public get instanceKeysCount(): number {\n let count = 0;\n this._instanceKeys.forEach((set: Set<string>) => (count += set.size));\n return count;\n }\n\n /**\n * Get a set of node keys stored in this KeySet\n *\n * **Warning**: getting node keys might be expensive for large KeySets.\n *\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public get nodeKeys() {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const set = new Set<NodeKey>();\n for (const serialized of this._nodeKeys) {\n set.add(JSON.parse(serialized));\n }\n return set;\n }\n\n /**\n * Get node keys count\n *\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public get nodeKeysCount(): number {\n return this._nodeKeys.size;\n }\n\n private isKeySet(set: Keys | Key): set is Readonly<KeySet> {\n return !!(set as KeySet)._nodeKeys && !!(set as KeySet)._instanceKeys;\n }\n\n private isKeysArray(keys: Keys | Key): keys is ReadonlyArray<Key> {\n return Array.isArray(keys);\n }\n\n /**\n * Clear this KeySet.\n * @returns itself\n */\n public clear(): KeySet {\n if (this.isEmpty) {\n return this;\n }\n\n this._instanceKeys = new Map();\n this._lowerCaseMap = new Map();\n this._nodeKeys = new Set();\n this.recalculateGuid();\n return this;\n }\n\n private addKeySet(keyset: Readonly<KeySet>, pred?: (key: Key) => boolean): void {\n for (const key of (keyset as any)._nodeKeys) {\n if (!pred || pred(JSON.parse(key))) {\n this._nodeKeys.add(key);\n }\n }\n for (const entry of (keyset as any)._instanceKeys) {\n let set = this._instanceKeys.get(entry[\"0\"]);\n const className = (keyset as KeySet)._lowerCaseMap.get(entry[\"0\"])!;\n if (!set) {\n set = new Set();\n this._instanceKeys.set(entry[\"0\"], set);\n this._lowerCaseMap.set(entry[\"0\"], className);\n }\n entry[\"1\"].forEach((id: Id64String) => {\n if (!pred || pred({ className, id })) {\n set.add(id);\n }\n });\n }\n }\n\n private addKeySetJSON(keyset: Readonly<KeySetJSON>): void {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n for (const key of keyset.nodeKeys) {\n this._nodeKeys.add(JSON.stringify(key));\n }\n for (const entry of keyset.instanceKeys) {\n const normalizedClassName = normalizeClassName(entry[\"0\"]);\n const lcClassName = normalizedClassName.toLowerCase();\n const idsJson: string | Id64String[] = entry[\"1\"];\n const ids: Set<Id64String> =\n typeof idsJson === \"string\" ? (idsJson === Id64.invalid ? new Set([Id64.invalid]) : CompressedId64Set.decompressSet(idsJson)) : new Set(idsJson);\n this._instanceKeys.set(lcClassName, ids);\n this._lowerCaseMap.set(lcClassName, normalizedClassName);\n }\n }\n\n /**\n * Add a key or keys to this KeySet.\n * @param value A key or keys to add.\n * @param pred An optional predicate function that indicates whether a key should be added\n * @returns itself\n */\n public add(value: Keys | Key, pred?: (key: Key) => boolean): KeySet {\n const sizeBefore = this.size;\n if (this.isKeySet(value)) {\n this.addKeySet(value, pred);\n } else if (this.isKeysArray(value)) {\n value.forEach((key) => this.add(key, pred));\n } else if (!pred || pred(value)) {\n if (Key.isEntityProps(value)) {\n this.add({ className: value.classFullName, id: Id64.fromJSON(value.id) } as InstanceKey);\n } else if (Key.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const lcClassName = normalizedClassName.toLowerCase();\n if (!this._instanceKeys.has(lcClassName)) {\n this._instanceKeys.set(lcClassName, new Set());\n }\n this._lowerCaseMap.set(lcClassName, normalizedClassName);\n this._instanceKeys.get(lcClassName)!.add(value.id);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (Key.isNodeKey(value)) {\n this._nodeKeys.add(JSON.stringify(value));\n }\n }\n if (this.size !== sizeBefore) {\n this.recalculateGuid();\n }\n return this;\n }\n\n private deleteKeySet(keyset: Readonly<KeySet>): void {\n for (const key of (keyset as any)._nodeKeys) {\n this._nodeKeys.delete(key);\n }\n for (const entry of (keyset as any)._instanceKeys) {\n const set = this._instanceKeys.get(entry[\"0\"]);\n if (set) {\n entry[\"1\"].forEach((key: string) => {\n set.delete(key);\n });\n }\n }\n }\n\n /**\n * Deletes a key or keys from this KeySet.\n * @param value A key or keys to delete.\n * @returns itself\n */\n public delete(value: Keys | Key): KeySet {\n const sizeBefore = this.size;\n if (this.isKeySet(value)) {\n this.deleteKeySet(value);\n } else if (this.isKeysArray(value)) {\n for (const key of value) {\n this.delete(key);\n }\n } else if (Key.isEntityProps(value)) {\n this.delete({ className: value.classFullName, id: value.id! } as InstanceKey);\n } else if (Key.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const set = this._instanceKeys.get(normalizedClassName.toLowerCase());\n if (set) {\n set.delete(value.id);\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n } else if (Key.isNodeKey(value)) {\n this._nodeKeys.delete(JSON.stringify(value));\n }\n if (this.size !== sizeBefore) {\n this.recalculateGuid();\n }\n return this;\n }\n\n /**\n * Check if this KeySet contains the specified key.\n * @param value The key to check.\n */\n public has(value: Key): boolean {\n if (Key.isEntityProps(value)) {\n return this.has({ className: value.classFullName, id: value.id! } as InstanceKey);\n }\n if (Key.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const set = this._instanceKeys.get(normalizedClassName.toLowerCase());\n return !!(set && set.has(value.id));\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n assert(Key.isNodeKey(value));\n return this._nodeKeys.has(JSON.stringify(value));\n }\n\n private hasKeySet(readonlyKeys: Readonly<KeySet>, checkType: \"all\" | \"any\"): boolean {\n // note: cast-away read-onlyness to access private members...\n const keys = readonlyKeys as KeySet;\n\n if (checkType === \"all\") {\n if (this._nodeKeys.size < keys._nodeKeys.size || this._instanceKeys.size < keys._instanceKeys.size) {\n return false;\n }\n if ([...keys._nodeKeys].some((key) => !this._nodeKeys.has(key))) {\n return false;\n }\n for (const otherEntry of keys._instanceKeys) {\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"]);\n if (!thisEntryKeys || thisEntryKeys.size < otherEntry[\"1\"].size) {\n return false;\n }\n if ([...otherEntry[\"1\"]].some((key) => !thisEntryKeys.has(key))) {\n return false;\n }\n }\n return true;\n }\n\n // \"any\" check type\n if ([...keys._nodeKeys].some((key) => this._nodeKeys.has(key))) {\n return true;\n }\n for (const otherEntry of keys._instanceKeys) {\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"]);\n if (thisEntryKeys && [...otherEntry[\"1\"]].some((key) => thisEntryKeys.has(key))) {\n return true;\n }\n }\n return false;\n }\n\n private hasKeysArray(keys: ReadonlyArray<Key>, checkType: \"all\" | \"any\"): boolean {\n if (checkType === \"all\") {\n if (this.size < keys.length) {\n return false;\n }\n for (const key of keys) {\n if (!this.has(key)) {\n return false;\n }\n }\n return true;\n }\n\n // \"any\" check type\n for (const key of keys) {\n if (this.has(key)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Check if this KeySet contains all the specified keys.\n * @param keys The keys to check.\n */\n public hasAll(keys: Keys): boolean {\n if (this.isKeySet(keys)) {\n return this.hasKeySet(keys, \"all\");\n }\n assert(this.isKeysArray(keys));\n return this.hasKeysArray(keys, \"all\");\n }\n\n /**\n * Check if this KeySet contains any of the specified keys.\n * @param keys The keys to check.\n */\n public hasAny(keys: Keys): boolean {\n if (this.isKeySet(keys)) {\n return this.hasKeySet(keys, \"any\");\n }\n assert(this.isKeysArray(keys));\n return this.hasKeysArray(keys, \"any\");\n }\n\n /**\n * Get the number of keys stored in this KeySet.\n */\n public get size(): number {\n const nodeKeysCount = this._nodeKeys.size;\n let instanceIdsCount = 0;\n for (const set of this._instanceKeys.values()) {\n instanceIdsCount += set.size;\n }\n return nodeKeysCount + instanceIdsCount;\n }\n\n /**\n * Is this KeySet currently empty.\n */\n public get isEmpty(): boolean {\n return 0 === this.size;\n }\n\n /** Iterate over all keys in this keyset. */\n public some(callback: (key: Key) => boolean) {\n for (const entry of this._instanceKeys) {\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase())!;\n if (some(entry[1], (id: Id64String) => callback({ className, id }))) {\n return true;\n }\n }\n return some(this._nodeKeys, (serializedKey: string) => callback(JSON.parse(serializedKey)));\n }\n\n /** Iterate over all keys in this keyset. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public forEach(callback: (key: InstanceKey | NodeKey, index: number) => void) {\n let index = 0;\n this._instanceKeys.forEach((ids: Set<Id64String>, className: string) => {\n const recentClassName = this._lowerCaseMap.get(className.toLowerCase())!;\n ids.forEach((id: Id64String) => callback({ className: recentClassName, id }, index++));\n });\n this._nodeKeys.forEach((serializedKey: string) => {\n callback(JSON.parse(serializedKey), index++);\n });\n }\n\n /** Iterate over all keys in this keyset in batches */\n public forEachBatch(batchSize: number, callback: (batch: KeySet, index: number) => void) {\n const size = this.size;\n const count = Math.ceil(size / batchSize);\n if (1 === count) {\n callback(this, 0);\n return;\n }\n let batch = new KeySet();\n let batchIndex = 0;\n let currBatchSize = 0;\n this.forEach((key, index) => {\n batch.add(key);\n ++currBatchSize;\n if (currBatchSize === batchSize || index === size - 1) {\n callback(batch, batchIndex++);\n batch = new KeySet();\n currBatchSize = 0;\n }\n });\n }\n\n /**\n * Serializes this KeySet to JSON\n * @public\n */\n public toJSON(): KeySetJSON {\n const instanceKeys: [string, string][] = [];\n for (const entry of this._instanceKeys.entries()) {\n if (entry[\"1\"].size > 0) {\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase());\n const compressedIds = CompressedId64Set.sortAndCompress(entry[\"1\"]);\n instanceKeys.push([className!, compressedIds.length > 0 ? compressedIds : Id64.invalid]);\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const nodeKeys: NodeKey[] = [];\n for (const serializedKey of this._nodeKeys.values()) {\n nodeKeys.push(JSON.parse(serializedKey));\n }\n return {\n instanceKeys,\n nodeKeys,\n };\n }\n\n /**\n * Creates a KeySet from JSON\n * @public\n */\n public static fromJSON(json: KeySetJSON): KeySet {\n const keyset = new KeySet();\n keyset.addKeySetJSON(json);\n return keyset;\n }\n}\n\nfunction normalizeClassName(className: string) {\n return className.replace(\".\", \":\");\n}\n\nconst some = <TItem>(set: Set<TItem>, cb: (item: TItem) => boolean) => {\n for (const item of set) {\n if (cb(item)) {\n return true;\n }\n }\n return false;\n};\n"]}
@@ -42,7 +42,7 @@ export interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVa
42
42
  /**
43
43
  * Request type for hierarchy requests.
44
44
  * @public
45
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
45
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
46
46
  * package for creating hierarchies.
47
47
  */
48
48
  export interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
@@ -70,7 +70,7 @@ export interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = R
70
70
  /**
71
71
  * Params for hierarchy level descriptor requests.
72
72
  * @public
73
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
73
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
74
74
  * package for creating hierarchies.
75
75
  */
76
76
  export interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
@@ -80,7 +80,7 @@ export interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRule
80
80
  /**
81
81
  * Request type of filtering hierarchies by given ECInstance paths.
82
82
  * @public
83
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
83
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
84
84
  * package for creating hierarchies.
85
85
  */
86
86
  export interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
@@ -95,7 +95,7 @@ export interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetV
95
95
  /**
96
96
  * Request type of filtering hierarchies by given text.
97
97
  * @public
98
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
98
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
99
99
  * package for creating hierarchies.
100
100
  */
101
101
  export interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
@@ -268,7 +268,7 @@ export interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<
268
268
  /**
269
269
  * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.
270
270
  * @public
271
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
271
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
272
272
  * package for creating hierarchies.
273
273
  */
274
274
  export interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationManagerOptions.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AAqWH,0FAIC;AARD;;;GAGG;AACH,SAAgB,uCAAuC,CACrD,OAAuH;IAEvH,OAAQ,OAA0D,CAAC,SAAS,KAAK,SAAS,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent, Id64String } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { Descriptor, SelectionInfo } from \"./content/Descriptor.js\";\nimport { FieldDescriptor } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { InstanceKey } from \"./EC.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { InstanceFilterDefinition } from \"./InstanceFilterDefinition.js\";\nimport { Ruleset } from \"./rules/Ruleset.js\";\nimport { RulesetVariable } from \"./RulesetVariables.js\";\nimport { SelectionScopeProps } from \"./selection/SelectionScope.js\";\n\n/**\n * A generic request options type used for both hierarchy and content requests.\n * @public\n */\nexport interface RequestOptions<TIModel> {\n /** iModel to request data from */\n imodel: TIModel;\n\n /** Optional locale to use when formatting / localizing data */\n locale?: string;\n\n /**\n * Unit system to use when formatting property values with units. Default presentation\n * unit is used if unit system is not specified.\n */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Options for requests that require presentation ruleset. Not\n * meant to be used directly, see one of the subclasses.\n *\n * @public\n */\nexport interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptions<TIModel> {\n /** Ruleset or id of the ruleset to use when requesting data */\n rulesetOrId: Ruleset | string;\n\n /** Ruleset variables to use when requesting data */\n rulesetVariables?: TRulesetVariable[];\n}\n\n/**\n * Request type for hierarchy requests.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get children for */\n parentKey?: TNodeKey;\n\n /**\n * An instance filter that should be applied for this hierarchy level.\n *\n * **Note:** May only be used on hierarchy levels that support filtering - check [[NavNode.supportsFiltering]] before\n * requesting filtered children.\n */\n instanceFilter?: InstanceFilterDefinition;\n\n /**\n * A limit to how many instances at most should be loaded for a hierarchy level. If the limit is exceeded,\n * the request fails with [[PresentationError]] having [[PresentationStatus.ResultSetTooLarge]] error number.\n *\n * Specifying the limit is useful when creating unlimited size result sets is not meaningful - this allows the library\n * to return early as soon as the limit is reached, instead of creating a very large result that's possibly too large to\n * be useful to be displayed to end users.\n *\n * @see [Hierarchies' filtering and limiting]($docs/presentation/hierarchies/FilteringLimiting.md)\n */\n sizeLimit?: number;\n}\n\n/**\n * Params for hierarchy level descriptor requests.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get hierarchy level descriptor for. */\n parentKey?: TNodeKey;\n}\n\n/**\n * Request type of filtering hierarchies by given ECInstance paths.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** A list of paths from root ECInstance to target ECInstance. */\n instancePaths: InstanceKey[][];\n\n /**\n * An optional index (`0 <= markedIndex < instancePaths.length`) to mark one of the instance paths. The\n * path is marked using `NodePathElement.isMarked` flag in the result.\n */\n markedIndex?: number;\n}\n\n/**\n * Request type of filtering hierarchies by given text.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Text to filter the hierarchy by. */\n filterText: string;\n}\n\n/**\n * Request type for content sources requests.\n * @public\n */\nexport interface ContentSourcesRequestOptions<TIModel> extends RequestOptions<TIModel> {\n /** Full names of classes to get content sources for. Format for a full class name: `SchemaName:ClassName`. */\n classes: string[];\n}\n\n/**\n * Request type for content descriptor requests.\n * @public\n */\nexport interface ContentDescriptorRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType: string;\n /**\n * Content flags used for content customization.\n * @see [[ContentFlags]]\n */\n contentFlags?: number;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Information about the selection event that was the cause of this content request */\n selection?: SelectionInfo;\n}\n\n/**\n * Request type for content requests.\n * @public\n */\nexport interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /**\n * Flag that specifies whether value formatting should be omitted or not.\n * Content is returned without `displayValues` when this is set to `true`.\n */\n omitFormattedValues?: boolean;\n}\n\n/**\n * Request type for distinct values' requests.\n * @public\n */\nexport interface DistinctValuesRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Descriptor for a field distinct values are requested for */\n fieldDescriptor: FieldDescriptor;\n}\n\n/**\n * Request type for element properties requests\n * @public\n * @deprecated in 4.4.0 - will not be removed until after 2026-06-13. Use [[SingleElementPropertiesRequestOptions]] or [[MultiElementPropertiesRequestOptions]] directly.\n */\nexport type ElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | SingleElementPropertiesRequestOptions<TIModel>\n | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for single element properties requests.\n * @public\n */\nexport interface SingleElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /** ID of the element to get properties for. */\n elementId: Id64String;\n\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n}\n\n/**\n * Base request type for multiple elements properties requests.\n * @public\n */\nexport interface MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n\n /**\n * The properties of multiple elements are going to be retrieved and returned in batches. Depending on the batch\n * size load on CPU vs MEMORY load may vary, so changing this attribute allows to fine tune the performance.\n * Defaults to `1000`.\n */\n batchSize?: number;\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by class.\n * @public\n */\nexport interface MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes\n * are used. Classes should be specified in one of these formats: \"<schema name or alias>.<class_name>\" or\n * \"<schema name or alias>:<class_name>\".\n */\n elementClasses?: string[];\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by element id.\n * @public\n */\nexport interface MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * A list of `bis.Element` IDs to get properties for.\n */\n elementIds?: Id64String[];\n}\n/**\n * Request type for multiple elements properties requests.\n * @public\n */\nexport type MultiElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent>\n | MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for content instance keys' requests.\n * @public\n */\nexport interface ContentInstanceKeysRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType?: string;\n /** Input keys for getting the content. */\n keys: TKeySet;\n}\n\n/**\n * Request type for label requests\n * @public\n */\nexport interface DisplayLabelRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Key of ECInstance to get label for */\n key: TInstanceKey;\n}\n\n/**\n * Request type for labels requests\n * @public\n */\nexport interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Keys of ECInstances to get labels for */\n keys: TInstanceKey[];\n}\n\n/**\n * Request options used for selection scope related requests\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * Request options used for calculating selection based on given instance keys and selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {\n elementIds: Id64String[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scope: SelectionScopeProps;\n}\n\n/**\n * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n prev: {\n rulesetOrId?: Ruleset | string;\n rulesetVariables?: TRulesetVariable[];\n };\n expandedNodeKeys?: TNodeKey[];\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n resultSetSize?: number;\n}\n\n/**\n * Paging options\n * @public\n */\nexport interface PageOptions {\n /** Inclusive start 0-based index of the page */\n start?: number;\n /** Maximum size of the page */\n size?: number;\n}\n\n/**\n * A wrapper type that injects [[PageOptions]] into supplied type\n * @public\n */\nexport type Paged<TOptions extends object> = TOptions & {\n /** Optional paging parameters */\n paging?: PageOptions;\n};\n\n/**\n * A wrapper type that injects priority into supplied type.\n * @public\n */\nexport type Prioritized<TOptions extends object> = TOptions & {\n /** Optional priority */\n priority?: number;\n};\n\n/**\n * Checks if supplied request options are for single or multiple element properties.\n * @internal\n */\nexport function isSingleElementPropertiesRequestOptions<TIModel, TParsedContent = any>(\n options: SingleElementPropertiesRequestOptions<TIModel> | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>,\n): options is SingleElementPropertiesRequestOptions<TIModel> {\n return (options as SingleElementPropertiesRequestOptions<TIModel>).elementId !== undefined;\n}\n\n/**\n * A wrapper type that injects cancelEvent into supplied type.\n * @public\n */\nexport type WithCancelEvent<TOptions extends object> = TOptions & {\n /** Event which is triggered when the request is canceled */\n cancelEvent?: BeEvent<() => void>;\n};\n"]}
1
+ {"version":3,"file":"PresentationManagerOptions.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AAqWH,0FAIC;AARD;;;GAGG;AACH,SAAgB,uCAAuC,CACrD,OAAuH;IAEvH,OAAQ,OAA0D,CAAC,SAAS,KAAK,SAAS,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent, Id64String } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { Descriptor, SelectionInfo } from \"./content/Descriptor.js\";\nimport { FieldDescriptor } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { InstanceKey } from \"./EC.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { InstanceFilterDefinition } from \"./InstanceFilterDefinition.js\";\nimport { Ruleset } from \"./rules/Ruleset.js\";\nimport { RulesetVariable } from \"./RulesetVariables.js\";\nimport { SelectionScopeProps } from \"./selection/SelectionScope.js\";\n\n/**\n * A generic request options type used for both hierarchy and content requests.\n * @public\n */\nexport interface RequestOptions<TIModel> {\n /** iModel to request data from */\n imodel: TIModel;\n\n /** Optional locale to use when formatting / localizing data */\n locale?: string;\n\n /**\n * Unit system to use when formatting property values with units. Default presentation\n * unit is used if unit system is not specified.\n */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Options for requests that require presentation ruleset. Not\n * meant to be used directly, see one of the subclasses.\n *\n * @public\n */\nexport interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptions<TIModel> {\n /** Ruleset or id of the ruleset to use when requesting data */\n rulesetOrId: Ruleset | string;\n\n /** Ruleset variables to use when requesting data */\n rulesetVariables?: TRulesetVariable[];\n}\n\n/**\n * Request type for hierarchy requests.\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get children for */\n parentKey?: TNodeKey;\n\n /**\n * An instance filter that should be applied for this hierarchy level.\n *\n * **Note:** May only be used on hierarchy levels that support filtering - check [[NavNode.supportsFiltering]] before\n * requesting filtered children.\n */\n instanceFilter?: InstanceFilterDefinition;\n\n /**\n * A limit to how many instances at most should be loaded for a hierarchy level. If the limit is exceeded,\n * the request fails with [[PresentationError]] having [[PresentationStatus.ResultSetTooLarge]] error number.\n *\n * Specifying the limit is useful when creating unlimited size result sets is not meaningful - this allows the library\n * to return early as soon as the limit is reached, instead of creating a very large result that's possibly too large to\n * be useful to be displayed to end users.\n *\n * @see [Hierarchies' filtering and limiting]($docs/presentation/hierarchies/FilteringLimiting.md)\n */\n sizeLimit?: number;\n}\n\n/**\n * Params for hierarchy level descriptor requests.\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get hierarchy level descriptor for. */\n parentKey?: TNodeKey;\n}\n\n/**\n * Request type of filtering hierarchies by given ECInstance paths.\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** A list of paths from root ECInstance to target ECInstance. */\n instancePaths: InstanceKey[][];\n\n /**\n * An optional index (`0 <= markedIndex < instancePaths.length`) to mark one of the instance paths. The\n * path is marked using `NodePathElement.isMarked` flag in the result.\n */\n markedIndex?: number;\n}\n\n/**\n * Request type of filtering hierarchies by given text.\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Text to filter the hierarchy by. */\n filterText: string;\n}\n\n/**\n * Request type for content sources requests.\n * @public\n */\nexport interface ContentSourcesRequestOptions<TIModel> extends RequestOptions<TIModel> {\n /** Full names of classes to get content sources for. Format for a full class name: `SchemaName:ClassName`. */\n classes: string[];\n}\n\n/**\n * Request type for content descriptor requests.\n * @public\n */\nexport interface ContentDescriptorRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType: string;\n /**\n * Content flags used for content customization.\n * @see [[ContentFlags]]\n */\n contentFlags?: number;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Information about the selection event that was the cause of this content request */\n selection?: SelectionInfo;\n}\n\n/**\n * Request type for content requests.\n * @public\n */\nexport interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /**\n * Flag that specifies whether value formatting should be omitted or not.\n * Content is returned without `displayValues` when this is set to `true`.\n */\n omitFormattedValues?: boolean;\n}\n\n/**\n * Request type for distinct values' requests.\n * @public\n */\nexport interface DistinctValuesRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Descriptor for a field distinct values are requested for */\n fieldDescriptor: FieldDescriptor;\n}\n\n/**\n * Request type for element properties requests\n * @public\n * @deprecated in 4.4.0 - will not be removed until after 2026-06-13. Use [[SingleElementPropertiesRequestOptions]] or [[MultiElementPropertiesRequestOptions]] directly.\n */\nexport type ElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | SingleElementPropertiesRequestOptions<TIModel>\n | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for single element properties requests.\n * @public\n */\nexport interface SingleElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /** ID of the element to get properties for. */\n elementId: Id64String;\n\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n}\n\n/**\n * Base request type for multiple elements properties requests.\n * @public\n */\nexport interface MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n\n /**\n * The properties of multiple elements are going to be retrieved and returned in batches. Depending on the batch\n * size load on CPU vs MEMORY load may vary, so changing this attribute allows to fine tune the performance.\n * Defaults to `1000`.\n */\n batchSize?: number;\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by class.\n * @public\n */\nexport interface MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes\n * are used. Classes should be specified in one of these formats: \"<schema name or alias>.<class_name>\" or\n * \"<schema name or alias>:<class_name>\".\n */\n elementClasses?: string[];\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by element id.\n * @public\n */\nexport interface MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * A list of `bis.Element` IDs to get properties for.\n */\n elementIds?: Id64String[];\n}\n/**\n * Request type for multiple elements properties requests.\n * @public\n */\nexport type MultiElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent>\n | MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for content instance keys' requests.\n * @public\n */\nexport interface ContentInstanceKeysRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType?: string;\n /** Input keys for getting the content. */\n keys: TKeySet;\n}\n\n/**\n * Request type for label requests\n * @public\n */\nexport interface DisplayLabelRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Key of ECInstance to get label for */\n key: TInstanceKey;\n}\n\n/**\n * Request type for labels requests\n * @public\n */\nexport interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Keys of ECInstances to get labels for */\n keys: TInstanceKey[];\n}\n\n/**\n * Request options used for selection scope related requests\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * Request options used for calculating selection based on given instance keys and selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {\n elementIds: Id64String[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scope: SelectionScopeProps;\n}\n\n/**\n * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n prev: {\n rulesetOrId?: Ruleset | string;\n rulesetVariables?: TRulesetVariable[];\n };\n expandedNodeKeys?: TNodeKey[];\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n resultSetSize?: number;\n}\n\n/**\n * Paging options\n * @public\n */\nexport interface PageOptions {\n /** Inclusive start 0-based index of the page */\n start?: number;\n /** Maximum size of the page */\n size?: number;\n}\n\n/**\n * A wrapper type that injects [[PageOptions]] into supplied type\n * @public\n */\nexport type Paged<TOptions extends object> = TOptions & {\n /** Optional paging parameters */\n paging?: PageOptions;\n};\n\n/**\n * A wrapper type that injects priority into supplied type.\n * @public\n */\nexport type Prioritized<TOptions extends object> = TOptions & {\n /** Optional priority */\n priority?: number;\n};\n\n/**\n * Checks if supplied request options are for single or multiple element properties.\n * @internal\n */\nexport function isSingleElementPropertiesRequestOptions<TIModel, TParsedContent = any>(\n options: SingleElementPropertiesRequestOptions<TIModel> | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>,\n): options is SingleElementPropertiesRequestOptions<TIModel> {\n return (options as SingleElementPropertiesRequestOptions<TIModel>).elementId !== undefined;\n}\n\n/**\n * A wrapper type that injects cancelEvent into supplied type.\n * @public\n */\nexport type WithCancelEvent<TOptions extends object> = TOptions & {\n /** Event which is triggered when the request is canceled */\n cancelEvent?: BeEvent<() => void>;\n};\n"]}
@@ -56,28 +56,28 @@ export type PresentationRpcResponse<TResult = undefined> = Promise<PresentationR
56
56
  /**
57
57
  * Data structure for hierarchy request options.
58
58
  * @public
59
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
59
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
60
60
  * package for creating hierarchies.
61
61
  */
62
62
  export type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;
63
63
  /**
64
64
  * Data structure for hierarchy level descriptor RPC request options.
65
65
  * @public
66
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
66
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
67
67
  * package for creating hierarchies.
68
68
  */
69
69
  export type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>>;
70
70
  /**
71
71
  * Data structure for filtering hierarchy by ECInstance paths request options.
72
72
  * @public
73
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
73
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
74
74
  * package for creating hierarchies.
75
75
  */
76
76
  export type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>>;
77
77
  /**
78
78
  * Data structure for filtering hierarchy by text request options.
79
79
  * @public
80
- * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
80
+ * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
81
81
  * package for creating hierarchies.
82
82
  */
83
83
  export type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;