@itwin/presentation-hierarchies 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +46 -49
  3. package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +64 -0
  4. package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +1 -0
  5. package/lib/cjs/hierarchies/HierarchyFiltering.js +80 -0
  6. package/lib/cjs/hierarchies/HierarchyFiltering.js.map +1 -0
  7. package/lib/cjs/hierarchies/HierarchyNode.d.ts +29 -233
  8. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNode.js +25 -8
  10. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  11. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +7 -11
  12. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
  13. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +9 -8
  14. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
  15. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +31 -6
  16. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  17. package/lib/cjs/hierarchies/HierarchyNodeKey.js +26 -23
  18. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
  19. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +24 -89
  20. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  21. package/lib/cjs/hierarchies/HierarchyProvider.js +24 -382
  22. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  23. package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/FilteringHierarchyDefinition.d.ts +9 -9
  24. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -0
  25. package/lib/cjs/hierarchies/{internal → imodel}/FilteringHierarchyDefinition.js +35 -73
  26. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -0
  27. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts +18 -0
  28. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
  29. package/lib/cjs/hierarchies/{internal/ChildNodeObservablesCache.js → imodel/HierarchyCache.js} +4 -4
  30. package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +1 -0
  31. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +121 -0
  32. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
  33. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +21 -0
  34. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
  35. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +234 -0
  36. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
  37. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +29 -0
  38. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
  39. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +77 -0
  40. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
  41. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +428 -0
  42. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
  43. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  44. package/lib/cjs/hierarchies/{LimitingECSqlQueryExecutor.js → imodel/LimitingECSqlQueryExecutor.js} +3 -3
  45. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
  46. package/lib/{esm/hierarchies → cjs/hierarchies/imodel}/NodeSelectQueryFactory.d.ts +4 -3
  47. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
  48. package/lib/cjs/hierarchies/{NodeSelectQueryFactory.js → imodel/NodeSelectQueryFactory.js} +37 -11
  49. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
  50. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +140 -0
  51. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
  52. package/lib/cjs/hierarchies/{HierarchyDefinition.js → imodel/PredicateBasedHierarchyDefinition.js} +26 -36
  53. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
  54. package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/TreeNodesReader.d.ts +6 -6
  55. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
  56. package/lib/cjs/hierarchies/{internal → imodel}/TreeNodesReader.js +2 -2
  57. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +1 -0
  58. package/lib/cjs/hierarchies/imodel/Utils.d.ts +4 -0
  59. package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +1 -0
  60. package/lib/cjs/hierarchies/imodel/Utils.js +59 -0
  61. package/lib/cjs/hierarchies/imodel/Utils.js.map +1 -0
  62. package/lib/cjs/hierarchies/{internal → imodel}/operators/DetermineChildren.d.ts +1 -1
  63. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
  64. package/lib/cjs/hierarchies/{internal → imodel}/operators/DetermineChildren.js +3 -3
  65. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
  66. package/lib/cjs/hierarchies/{internal → imodel}/operators/Grouping.d.ts +2 -1
  67. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
  68. package/lib/cjs/hierarchies/{internal → imodel}/operators/Grouping.js +5 -5
  69. package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +1 -0
  70. package/lib/cjs/hierarchies/{internal → imodel}/operators/HideIfNoChildren.d.ts +1 -1
  71. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
  72. package/lib/cjs/hierarchies/{internal → imodel}/operators/HideIfNoChildren.js +5 -5
  73. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
  74. package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/HideNodesInHierarchy.d.ts +1 -1
  75. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
  76. package/lib/cjs/hierarchies/{internal → imodel}/operators/HideNodesInHierarchy.js +22 -9
  77. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
  78. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
  79. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
  80. package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/grouping/BaseClassGrouping.d.ts +2 -1
  81. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  82. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
  83. package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/grouping/ClassGrouping.d.ts +2 -1
  84. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
  85. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
  86. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
  87. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
  88. package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.d.ts +1 -1
  89. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
  90. package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.js +2 -2
  91. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
  92. package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/grouping/PropertiesGrouping.d.ts +2 -1
  93. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  94. package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/PropertiesGrouping.js +10 -5
  95. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
  96. package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/Shared.d.ts +1 -1
  97. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
  98. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
  99. package/lib/cjs/hierarchies/internal/Common.d.ts +7 -4
  100. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
  101. package/lib/cjs/hierarchies/internal/Common.js +0 -66
  102. package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
  103. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts +3 -2
  104. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
  105. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
  106. package/lib/cjs/presentation-hierarchies.d.ts +10 -6
  107. package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
  108. package/lib/cjs/presentation-hierarchies.js +18 -10
  109. package/lib/cjs/presentation-hierarchies.js.map +1 -1
  110. package/lib/esm/hierarchies/HierarchyFiltering.d.ts +64 -0
  111. package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +1 -0
  112. package/lib/esm/hierarchies/HierarchyFiltering.js +76 -0
  113. package/lib/esm/hierarchies/HierarchyFiltering.js.map +1 -0
  114. package/lib/esm/hierarchies/HierarchyNode.d.ts +29 -233
  115. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  116. package/lib/esm/hierarchies/HierarchyNode.js +24 -7
  117. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  118. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +7 -11
  119. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
  120. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js +9 -8
  121. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
  122. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +31 -6
  123. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  124. package/lib/esm/hierarchies/HierarchyNodeKey.js +26 -23
  125. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
  126. package/lib/esm/hierarchies/HierarchyProvider.d.ts +24 -89
  127. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  128. package/lib/esm/hierarchies/HierarchyProvider.js +25 -383
  129. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  130. package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/FilteringHierarchyDefinition.d.ts +9 -9
  131. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -0
  132. package/lib/esm/hierarchies/{internal → imodel}/FilteringHierarchyDefinition.js +36 -74
  133. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -0
  134. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +18 -0
  135. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
  136. package/lib/esm/hierarchies/{internal/ChildNodeObservablesCache.js → imodel/HierarchyCache.js} +2 -2
  137. package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +1 -0
  138. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts +121 -0
  139. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
  140. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js +18 -0
  141. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
  142. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +234 -0
  143. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
  144. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js +26 -0
  145. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
  146. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +77 -0
  147. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
  148. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +425 -0
  149. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
  150. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  151. package/lib/esm/hierarchies/{LimitingECSqlQueryExecutor.js → imodel/LimitingECSqlQueryExecutor.js} +3 -3
  152. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
  153. package/lib/{cjs/hierarchies → esm/hierarchies/imodel}/NodeSelectQueryFactory.d.ts +4 -3
  154. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
  155. package/lib/esm/hierarchies/{NodeSelectQueryFactory.js → imodel/NodeSelectQueryFactory.js} +38 -12
  156. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
  157. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +140 -0
  158. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
  159. package/lib/esm/hierarchies/{HierarchyDefinition.js → imodel/PredicateBasedHierarchyDefinition.js} +25 -34
  160. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
  161. package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/TreeNodesReader.d.ts +6 -6
  162. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
  163. package/lib/esm/hierarchies/{internal → imodel}/TreeNodesReader.js +2 -2
  164. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +1 -0
  165. package/lib/esm/hierarchies/imodel/Utils.d.ts +4 -0
  166. package/lib/esm/hierarchies/imodel/Utils.d.ts.map +1 -0
  167. package/lib/esm/hierarchies/imodel/Utils.js +56 -0
  168. package/lib/esm/hierarchies/imodel/Utils.js.map +1 -0
  169. package/lib/esm/hierarchies/{internal → imodel}/operators/DetermineChildren.d.ts +1 -1
  170. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
  171. package/lib/esm/hierarchies/{internal → imodel}/operators/DetermineChildren.js +3 -3
  172. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
  173. package/lib/esm/hierarchies/{internal → imodel}/operators/Grouping.d.ts +2 -1
  174. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
  175. package/lib/esm/hierarchies/{internal → imodel}/operators/Grouping.js +6 -6
  176. package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +1 -0
  177. package/lib/esm/hierarchies/{internal → imodel}/operators/HideIfNoChildren.d.ts +1 -1
  178. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
  179. package/lib/esm/hierarchies/{internal → imodel}/operators/HideIfNoChildren.js +5 -5
  180. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
  181. package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/HideNodesInHierarchy.d.ts +1 -1
  182. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
  183. package/lib/esm/hierarchies/{internal → imodel}/operators/HideNodesInHierarchy.js +22 -9
  184. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
  185. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
  186. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
  187. package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/grouping/BaseClassGrouping.d.ts +2 -1
  188. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  189. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
  190. package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/grouping/ClassGrouping.d.ts +2 -1
  191. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
  192. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
  193. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
  194. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
  195. package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.d.ts +1 -1
  196. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
  197. package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.js +2 -2
  198. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
  199. package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/grouping/PropertiesGrouping.d.ts +2 -1
  200. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  201. package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/PropertiesGrouping.js +12 -7
  202. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
  203. package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/Shared.d.ts +1 -1
  204. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
  205. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
  206. package/lib/esm/hierarchies/internal/Common.d.ts +7 -4
  207. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
  208. package/lib/esm/hierarchies/internal/Common.js +0 -65
  209. package/lib/esm/hierarchies/internal/Common.js.map +1 -1
  210. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +3 -2
  211. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
  212. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -1
  213. package/lib/esm/presentation-hierarchies.d.ts +10 -6
  214. package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
  215. package/lib/esm/presentation-hierarchies.js +8 -4
  216. package/lib/esm/presentation-hierarchies.js.map +1 -1
  217. package/package.json +8 -7
  218. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts +0 -251
  219. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts.map +0 -1
  220. package/lib/cjs/hierarchies/HierarchyDefinition.js.map +0 -1
  221. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  222. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js.map +0 -1
  223. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts.map +0 -1
  224. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js.map +0 -1
  225. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts +0 -40
  226. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +0 -1
  227. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js.map +0 -1
  228. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +0 -1
  229. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js.map +0 -1
  230. package/lib/cjs/hierarchies/internal/TreeNodesReader.d.ts.map +0 -1
  231. package/lib/cjs/hierarchies/internal/TreeNodesReader.js.map +0 -1
  232. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts.map +0 -1
  233. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js.map +0 -1
  234. package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts.map +0 -1
  235. package/lib/cjs/hierarchies/internal/operators/Grouping.js.map +0 -1
  236. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +0 -1
  237. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js.map +0 -1
  238. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +0 -1
  239. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js.map +0 -1
  240. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +0 -1
  241. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js.map +0 -1
  242. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  243. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +0 -1
  244. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +0 -1
  245. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js.map +0 -1
  246. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +0 -1
  247. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js.map +0 -1
  248. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +0 -1
  249. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js.map +0 -1
  250. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  251. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +0 -1
  252. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.d.ts.map +0 -1
  253. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js.map +0 -1
  254. package/lib/esm/hierarchies/HierarchyDefinition.d.ts +0 -251
  255. package/lib/esm/hierarchies/HierarchyDefinition.d.ts.map +0 -1
  256. package/lib/esm/hierarchies/HierarchyDefinition.js.map +0 -1
  257. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  258. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js.map +0 -1
  259. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts.map +0 -1
  260. package/lib/esm/hierarchies/NodeSelectQueryFactory.js.map +0 -1
  261. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts +0 -40
  262. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +0 -1
  263. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js.map +0 -1
  264. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +0 -1
  265. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js.map +0 -1
  266. package/lib/esm/hierarchies/internal/TreeNodesReader.d.ts.map +0 -1
  267. package/lib/esm/hierarchies/internal/TreeNodesReader.js.map +0 -1
  268. package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts.map +0 -1
  269. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js.map +0 -1
  270. package/lib/esm/hierarchies/internal/operators/Grouping.d.ts.map +0 -1
  271. package/lib/esm/hierarchies/internal/operators/Grouping.js.map +0 -1
  272. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +0 -1
  273. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js.map +0 -1
  274. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +0 -1
  275. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js.map +0 -1
  276. package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +0 -1
  277. package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.js.map +0 -1
  278. package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  279. package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +0 -1
  280. package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +0 -1
  281. package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.js.map +0 -1
  282. package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +0 -1
  283. package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.js.map +0 -1
  284. package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +0 -1
  285. package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.js.map +0 -1
  286. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  287. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +0 -1
  288. package/lib/esm/hierarchies/internal/operators/grouping/Shared.d.ts.map +0 -1
  289. package/lib/esm/hierarchies/internal/operators/grouping/Shared.js.map +0 -1
  290. /package/lib/cjs/hierarchies/{LimitingECSqlQueryExecutor.d.ts → imodel/LimitingECSqlQueryExecutor.d.ts} +0 -0
  291. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.d.ts +0 -0
  292. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.js +0 -0
  293. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/BaseClassGrouping.js +0 -0
  294. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/ClassGrouping.js +0 -0
  295. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.d.ts +0 -0
  296. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.js +0 -0
  297. /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/Shared.js +0 -0
  298. /package/lib/esm/hierarchies/{LimitingECSqlQueryExecutor.d.ts → imodel/LimitingECSqlQueryExecutor.d.ts} +0 -0
  299. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.d.ts +0 -0
  300. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.js +0 -0
  301. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/BaseClassGrouping.js +0 -0
  302. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/ClassGrouping.js +0 -0
  303. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.d.ts +0 -0
  304. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.js +0 -0
  305. /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/Shared.js +0 -0
@@ -1,4 +1,29 @@
1
1
  import { InstanceKey } from "@itwin/presentation-shared";
2
+ /**
3
+ * An instance key that may be associated with specific iModel.
4
+ * @beta
5
+ */
6
+ export interface IModelInstanceKey extends InstanceKey {
7
+ imodelKey?: string;
8
+ }
9
+ /**
10
+ * A key for a generic node.
11
+ * @beta
12
+ */
13
+ export interface GenericNodeKey {
14
+ /** Type of the node */
15
+ type: "generic";
16
+ /**
17
+ * Node key identifier, which uniquely identifies the node within the hierarchy level the node is used.
18
+ * The format of the identifier is not specified and is up to the data source.
19
+ */
20
+ id: string;
21
+ /**
22
+ * Optional data source identifier. Useful when a hierarchy is built using multiple hierarchy providers - in that
23
+ * case each provider can assign a unique source identifier to its nodes.
24
+ */
25
+ source?: string;
26
+ }
2
27
  /**
3
28
  * A key for a node that represents one or more ECInstances.
4
29
  * @beta
@@ -10,7 +35,7 @@ export interface InstancesNodeKey {
10
35
  * Keys of ECInstances that are represented by the node. Generally, one node represents a single
11
36
  * ECInstance, but in some cases (e.g. node merging) there could be more.
12
37
  */
13
- instanceKeys: InstanceKey[];
38
+ instanceKeys: IModelInstanceKey[];
14
39
  }
15
40
  /**
16
41
  * A key for a class-grouping node.
@@ -95,18 +120,18 @@ export type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | Prop
95
120
  * A key for either an instance node or one of the instance grouping nodes.
96
121
  * @beta
97
122
  */
98
- export type StandardHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;
123
+ export type IModelHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;
99
124
  /**
100
125
  * A key that uniquely identifies a node in a hierarchy level.
101
126
  * @beta
102
127
  */
103
- export type HierarchyNodeKey = StandardHierarchyNodeKey | string;
128
+ export type HierarchyNodeKey = IModelHierarchyNodeKey | GenericNodeKey;
104
129
  /** @beta */
105
130
  export declare namespace HierarchyNodeKey {
106
- /** Checks whether the given node key is a custom node key. */
107
- function isCustom(key: HierarchyNodeKey): key is string;
131
+ /** Checks whether the given node key is a generic node key. */
132
+ function isGeneric(key: HierarchyNodeKey): key is GenericNodeKey;
108
133
  /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */
109
- function isStandard(key: HierarchyNodeKey): key is StandardHierarchyNodeKey;
134
+ function isIModelNodeKey(key: HierarchyNodeKey): key is IModelHierarchyNodeKey;
110
135
  /** Checks whether the given node key is an `InstancesNodeKey`. */
111
136
  function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey;
112
137
  /** Checks whether the given node key is a `GroupingNodeKey`. */
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyNodeKey.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,WAAW,CAAC;IAElB;;;OAGG;IACH,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IAEvB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IAEvB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,uBAAuB;IACvB,IAAI,EAAE,yBAAyB,CAAC;IA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,EAAE,gBAAgB,GAAG,GAAG,IAAI,4BAA4B,CAElG;IAED,wEAAwE;IACxE,SAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,uBAAuB,CAExF;IAED;;;;;OAKG;IACH,SAAgB,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAwF5E;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAE5E;CACF"}
@@ -8,49 +8,49 @@ import { InstanceKey } from "@itwin/presentation-shared";
8
8
  // eslint-disable-next-line @typescript-eslint/no-redeclare
9
9
  export var HierarchyNodeKey;
10
10
  (function (HierarchyNodeKey) {
11
- /** Checks whether the given node key is a custom node key. */
12
- function isCustom(key) {
13
- return typeof key === "string";
11
+ /** Checks whether the given node key is a generic node key. */
12
+ function isGeneric(key) {
13
+ return key.type === "generic";
14
14
  }
15
- HierarchyNodeKey.isCustom = isCustom;
15
+ HierarchyNodeKey.isGeneric = isGeneric;
16
16
  /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */
17
- function isStandard(key) {
18
- return !!key.type;
17
+ function isIModelNodeKey(key) {
18
+ return !isGeneric(key);
19
19
  }
20
- HierarchyNodeKey.isStandard = isStandard;
20
+ HierarchyNodeKey.isIModelNodeKey = isIModelNodeKey;
21
21
  /** Checks whether the given node key is an `InstancesNodeKey`. */
22
22
  function isInstances(key) {
23
- return isStandard(key) && key.type === "instances";
23
+ return key.type === "instances";
24
24
  }
25
25
  HierarchyNodeKey.isInstances = isInstances;
26
26
  /** Checks whether the given node key is a `GroupingNodeKey`. */
27
27
  function isGrouping(key) {
28
- return isStandard(key) && !isInstances(key);
28
+ return !isGeneric(key) && !isInstances(key);
29
29
  }
30
30
  HierarchyNodeKey.isGrouping = isGrouping;
31
31
  /** Checks whether the given node key is a `ClassGroupingNodeKey`. */
32
32
  function isClassGrouping(key) {
33
- return isStandard(key) && key.type === "class-grouping";
33
+ return key.type === "class-grouping";
34
34
  }
35
35
  HierarchyNodeKey.isClassGrouping = isClassGrouping;
36
36
  /** Checks whether the given node key is a `LabelGroupingNodeKey`. */
37
37
  function isLabelGrouping(key) {
38
- return isStandard(key) && key.type === "label-grouping";
38
+ return key.type === "label-grouping";
39
39
  }
40
40
  HierarchyNodeKey.isLabelGrouping = isLabelGrouping;
41
41
  /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */
42
42
  function isPropertyOtherValuesGrouping(key) {
43
- return isStandard(key) && key.type === "property-grouping:other";
43
+ return key.type === "property-grouping:other";
44
44
  }
45
45
  HierarchyNodeKey.isPropertyOtherValuesGrouping = isPropertyOtherValuesGrouping;
46
46
  /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */
47
47
  function isPropertyValueRangeGrouping(key) {
48
- return isStandard(key) && key.type === "property-grouping:range";
48
+ return key.type === "property-grouping:range";
49
49
  }
50
50
  HierarchyNodeKey.isPropertyValueRangeGrouping = isPropertyValueRangeGrouping;
51
51
  /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */
52
52
  function isPropertyValueGrouping(key) {
53
- return isStandard(key) && key.type === "property-grouping:value";
53
+ return key.type === "property-grouping:value";
54
54
  }
55
55
  HierarchyNodeKey.isPropertyValueGrouping = isPropertyValueGrouping;
56
56
  /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */
@@ -65,20 +65,19 @@ export var HierarchyNodeKey;
65
65
  * - `positive value` if lhs key is more than rhs key.
66
66
  */
67
67
  function compare(lhs, rhs) {
68
- if (typeof lhs === "string") {
69
- if (typeof rhs !== "string") {
70
- return 1;
71
- }
72
- return compareStrings(lhs, rhs);
73
- }
74
- if (typeof rhs === "string") {
75
- return -1;
76
- }
77
68
  const typeCompareResult = compareStrings(lhs.type, rhs.type);
78
69
  if (typeCompareResult !== 0) {
79
70
  return typeCompareResult;
80
71
  }
81
72
  switch (lhs.type) {
73
+ case "generic": {
74
+ assert(rhs.type === "generic");
75
+ const idCompareResult = compareStrings(lhs.id, rhs.id);
76
+ if (idCompareResult !== 0) {
77
+ return idCompareResult;
78
+ }
79
+ return compareStringsOrUndefined(lhs.source, rhs.source);
80
+ }
82
81
  case "instances": {
83
82
  assert(rhs.type === "instances");
84
83
  if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {
@@ -89,6 +88,10 @@ export var HierarchyNodeKey;
89
88
  if (instanceKeyCompareResult !== 0) {
90
89
  return instanceKeyCompareResult;
91
90
  }
91
+ const imodelKeyCompareResult = compareStringsOrUndefined(lhs.instanceKeys[0].imodelKey, rhs.instanceKeys[0].imodelKey);
92
+ if (imodelKeyCompareResult !== 0) {
93
+ return imodelKeyCompareResult;
94
+ }
92
95
  }
93
96
  return 0;
94
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyNodeKey.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AA6HzD,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,gBAAgB,CAsJhC;AAtJD,WAAiB,gBAAgB;IAC/B,8DAA8D;IAC9D,SAAgB,QAAQ,CAAC,GAAqB;QAC5C,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC;IACjC,CAAC;IAFe,yBAAQ,WAEvB,CAAA;IAED,yEAAyE;IACzE,SAAgB,UAAU,CAAC,GAAqB;QAC9C,OAAO,CAAC,CAAE,GAAgC,CAAC,IAAI,CAAC;IAClD,CAAC;IAFe,2BAAU,aAEzB,CAAA;IAED,kEAAkE;IAClE,SAAgB,WAAW,CAAC,GAAqB;QAC/C,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK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C;gBACD,MAAM,yBAAyB,GAAG,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;gBACrF,IAAI,yBAAyB,KAAK,CAAC,EAAE,CAAC;oBACpC,OAAO,yBAAyB,CAAC;gBACnC,CAAC;gBACD,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,EAAE,CAAC;oBACpC,OAAO,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,CAAC;gBACD,OAAO,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAvFe,wBAAO,UAuFtB,CAAA;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAqB,EAAE,GAAqB;QACjE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,uBAAM,SAErB,CAAA;AACH,CAAC,EAtJgB,gBAAgB,KAAhB,gBAAgB,QAsJhC","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\nimport { assert, compareStrings, compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * A key for a node that represents one or more ECInstances.\n * @beta\n */\nexport interface InstancesNodeKey {\n /** Type of the node */\n type: \"instances\";\n\n /**\n * Keys of ECInstances that are represented by the node. Generally, one node represents a single\n * ECInstance, but in some cases (e.g. node merging) there could be more.\n */\n instanceKeys: InstanceKey[];\n}\n\n/**\n * A key for a class-grouping node.\n * @beta\n */\nexport interface ClassGroupingNodeKey {\n /** Type of the node */\n type: \"class-grouping\";\n\n /** Full name of the ECClass that this grouping node is grouping by. */\n className: string;\n}\n\n/**\n * A key for a label-grouping node.\n * @beta\n */\nexport interface LabelGroupingNodeKey {\n /** Type of the node */\n type: \"label-grouping\";\n\n /** Node label that this grouping node is grouping by. */\n label: string;\n\n /**\n * Optional group identifier that is assigned to the node key when multiple nodes\n * with the same label shouldn't be grouped together.\n */\n groupId?: string;\n}\n\n/**\n * A key property grouping node that groups nodes whose values don't fall into any other\n * property group in the hierarchy level.\n * @beta\n */\nexport interface PropertyOtherValuesGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:other\";\n /** Identifiers of properties whose values are grouped under this node. */\n properties: Array<{\n className: string;\n propertyName: string;\n }>;\n}\n\n/**\n * A key for a property grouping node that groups nodes by formatted property value.\n * @beta\n */\nexport interface PropertyValueGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:value\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Formatted property value that this node is grouping by. */\n formattedPropertyValue: string;\n}\n\n/**\n * A key for a property grouping node that groups nodes by a range of property values.\n * @beta\n */\nexport interface PropertyValueRangeGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:range\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Defines the start of the values' range that this node is grouping by. */\n fromValue: number;\n\n /** Defines the end of the values' range that this node is grouping by. */\n toValue: number;\n}\n\n/**\n * A key for a property grouping node.\n * @beta\n */\nexport type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;\n\n/**\n * A key for one of the instance grouping nodes.\n * @beta\n */\nexport type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;\n\n/**\n * A key for either an instance node or one of the instance grouping nodes.\n * @beta\n */\nexport type StandardHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;\n\n/**\n * A key that uniquely identifies a node in a hierarchy level.\n * @beta\n */\nexport type HierarchyNodeKey = StandardHierarchyNodeKey | string;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeKey {\n /** Checks whether the given node key is a custom node key. */\n export function isCustom(key: HierarchyNodeKey): key is string {\n return typeof key === \"string\";\n }\n\n /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */\n export function isStandard(key: HierarchyNodeKey): key is StandardHierarchyNodeKey {\n return !!(key as StandardHierarchyNodeKey).type;\n }\n\n /** Checks whether the given node key is an `InstancesNodeKey`. */\n export function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey {\n return isStandard(key) && key.type === \"instances\";\n }\n\n /** Checks whether the given node key is a `GroupingNodeKey`. */\n export function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey {\n return isStandard(key) && !isInstances(key);\n }\n\n /** Checks whether the given node key is a `ClassGroupingNodeKey`. */\n export function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey {\n return isStandard(key) && key.type === \"class-grouping\";\n }\n\n /** Checks whether the given node key is a `LabelGroupingNodeKey`. */\n export function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey {\n return isStandard(key) && key.type === \"label-grouping\";\n }\n\n /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */\n export function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey {\n return isStandard(key) && key.type === \"property-grouping:other\";\n }\n\n /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */\n export function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey {\n return isStandard(key) && key.type === \"property-grouping:range\";\n }\n\n /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */\n export function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey {\n return isStandard(key) && key.type === \"property-grouping:value\";\n }\n\n /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */\n export function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey {\n return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);\n }\n\n /**\n * Compares two given keys. Returns:\n * - `0` if they are equal,\n * - `negative value` if lhs key is less than rhs key,\n * - `positive value` if lhs key is more than rhs key.\n */\n export function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number {\n if (typeof lhs === \"string\") {\n if (typeof rhs !== \"string\") {\n return 1;\n }\n return compareStrings(lhs, rhs);\n }\n if (typeof rhs === \"string\") {\n return -1;\n }\n\n const typeCompareResult = compareStrings(lhs.type, rhs.type);\n if (typeCompareResult !== 0) {\n return typeCompareResult;\n }\n\n switch (lhs.type) {\n case \"instances\": {\n assert(rhs.type === \"instances\");\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n const instanceKeyCompareResult = InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);\n if (instanceKeyCompareResult !== 0) {\n return instanceKeyCompareResult;\n }\n }\n return 0;\n }\n case \"class-grouping\": {\n assert(rhs.type === \"class-grouping\");\n return compareStrings(lhs.className, rhs.className);\n }\n case \"label-grouping\": {\n assert(rhs.type === \"label-grouping\");\n const labelCompareResult = compareStrings(lhs.label, rhs.label);\n if (labelCompareResult !== 0) {\n return labelCompareResult;\n }\n return compareStringsOrUndefined(lhs.groupId, rhs.groupId);\n }\n case \"property-grouping:other\": {\n assert(rhs.type === \"property-grouping:other\");\n if (lhs.properties.length !== rhs.properties.length) {\n return lhs.properties.length - rhs.properties.length;\n }\n for (let i = 0; i < lhs.properties.length; ++i) {\n const classCompareResult = compareStrings(lhs.properties[i].className, rhs.properties[i].className);\n if (classCompareResult !== 0) {\n return classCompareResult;\n }\n const nameCompareResult = compareStrings(lhs.properties[i].propertyName, rhs.properties[i].propertyName);\n if (nameCompareResult !== 0) {\n return nameCompareResult;\n }\n }\n return 0;\n }\n case \"property-grouping:value\": {\n assert(rhs.type === \"property-grouping:value\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n return compareStrings(lhs.formattedPropertyValue, rhs.formattedPropertyValue);\n }\n case \"property-grouping:range\": {\n assert(rhs.type === \"property-grouping:range\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n if (lhs.fromValue !== rhs.fromValue) {\n return lhs.fromValue > rhs.fromValue ? 1 : -1;\n }\n return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;\n }\n }\n }\n\n /** Checks whether the two given keys are equal. */\n export function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean {\n return compare(lhs, rhs) === 0;\n }\n}\n"]}
1
+ {"version":3,"file":"HierarchyNodeKey.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAA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,UAwFtB,CAAA;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAqB,EAAE,GAAqB;QACjE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,uBAAM,SAErB,CAAA;AACH,CAAC,EAvJgB,gBAAgB,KAAhB,gBAAgB,QAuJhC","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\nimport { assert, compareStrings, compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * An instance key that may be associated with specific iModel.\n * @beta\n */\nexport interface IModelInstanceKey extends InstanceKey {\n imodelKey?: string;\n}\n\n/**\n * A key for a generic node.\n * @beta\n */\nexport interface GenericNodeKey {\n /** Type of the node */\n type: \"generic\";\n\n /**\n * Node key identifier, which uniquely identifies the node within the hierarchy level the node is used.\n * The format of the identifier is not specified and is up to the data source.\n */\n id: string;\n\n /**\n * Optional data source identifier. Useful when a hierarchy is built using multiple hierarchy providers - in that\n * case each provider can assign a unique source identifier to its nodes.\n */\n source?: string;\n}\n\n/**\n * A key for a node that represents one or more ECInstances.\n * @beta\n */\nexport interface InstancesNodeKey {\n /** Type of the node */\n type: \"instances\";\n\n /**\n * Keys of ECInstances that are represented by the node. Generally, one node represents a single\n * ECInstance, but in some cases (e.g. node merging) there could be more.\n */\n instanceKeys: IModelInstanceKey[];\n}\n\n/**\n * A key for a class-grouping node.\n * @beta\n */\nexport interface ClassGroupingNodeKey {\n /** Type of the node */\n type: \"class-grouping\";\n\n /** Full name of the ECClass that this grouping node is grouping by. */\n className: string;\n}\n\n/**\n * A key for a label-grouping node.\n * @beta\n */\nexport interface LabelGroupingNodeKey {\n /** Type of the node */\n type: \"label-grouping\";\n\n /** Node label that this grouping node is grouping by. */\n label: string;\n\n /**\n * Optional group identifier that is assigned to the node key when multiple nodes\n * with the same label shouldn't be grouped together.\n */\n groupId?: string;\n}\n\n/**\n * A key property grouping node that groups nodes whose values don't fall into any other\n * property group in the hierarchy level.\n * @beta\n */\nexport interface PropertyOtherValuesGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:other\";\n /** Identifiers of properties whose values are grouped under this node. */\n properties: Array<{\n className: string;\n propertyName: string;\n }>;\n}\n\n/**\n * A key for a property grouping node that groups nodes by formatted property value.\n * @beta\n */\nexport interface PropertyValueGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:value\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Formatted property value that this node is grouping by. */\n formattedPropertyValue: string;\n}\n\n/**\n * A key for a property grouping node that groups nodes by a range of property values.\n * @beta\n */\nexport interface PropertyValueRangeGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:range\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Defines the start of the values' range that this node is grouping by. */\n fromValue: number;\n\n /** Defines the end of the values' range that this node is grouping by. */\n toValue: number;\n}\n\n/**\n * A key for a property grouping node.\n * @beta\n */\nexport type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;\n\n/**\n * A key for one of the instance grouping nodes.\n * @beta\n */\nexport type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;\n\n/**\n * A key for either an instance node or one of the instance grouping nodes.\n * @beta\n */\nexport type IModelHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;\n\n/**\n * A key that uniquely identifies a node in a hierarchy level.\n * @beta\n */\nexport type HierarchyNodeKey = IModelHierarchyNodeKey | GenericNodeKey;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeKey {\n /** Checks whether the given node key is a generic node key. */\n export function isGeneric(key: HierarchyNodeKey): key is GenericNodeKey {\n return key.type === \"generic\";\n }\n\n /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */\n export function isIModelNodeKey(key: HierarchyNodeKey): key is IModelHierarchyNodeKey {\n return !isGeneric(key);\n }\n\n /** Checks whether the given node key is an `InstancesNodeKey`. */\n export function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey {\n return key.type === \"instances\";\n }\n\n /** Checks whether the given node key is a `GroupingNodeKey`. */\n export function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey {\n return !isGeneric(key) && !isInstances(key);\n }\n\n /** Checks whether the given node key is a `ClassGroupingNodeKey`. */\n export function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey {\n return key.type === \"class-grouping\";\n }\n\n /** Checks whether the given node key is a `LabelGroupingNodeKey`. */\n export function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey {\n return key.type === \"label-grouping\";\n }\n\n /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */\n export function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey {\n return key.type === \"property-grouping:other\";\n }\n\n /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */\n export function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey {\n return key.type === \"property-grouping:range\";\n }\n\n /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */\n export function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey {\n return key.type === \"property-grouping:value\";\n }\n\n /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */\n export function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey {\n return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);\n }\n\n /**\n * Compares two given keys. Returns:\n * - `0` if they are equal,\n * - `negative value` if lhs key is less than rhs key,\n * - `positive value` if lhs key is more than rhs key.\n */\n export function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number {\n const typeCompareResult = compareStrings(lhs.type, rhs.type);\n if (typeCompareResult !== 0) {\n return typeCompareResult;\n }\n switch (lhs.type) {\n case \"generic\": {\n assert(rhs.type === \"generic\");\n const idCompareResult = compareStrings(lhs.id, rhs.id);\n if (idCompareResult !== 0) {\n return idCompareResult;\n }\n return compareStringsOrUndefined(lhs.source, rhs.source);\n }\n case \"instances\": {\n assert(rhs.type === \"instances\");\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n const instanceKeyCompareResult = InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);\n if (instanceKeyCompareResult !== 0) {\n return instanceKeyCompareResult;\n }\n const imodelKeyCompareResult = compareStringsOrUndefined(lhs.instanceKeys[0].imodelKey, rhs.instanceKeys[0].imodelKey);\n if (imodelKeyCompareResult !== 0) {\n return imodelKeyCompareResult;\n }\n }\n return 0;\n }\n case \"class-grouping\": {\n assert(rhs.type === \"class-grouping\");\n return compareStrings(lhs.className, rhs.className);\n }\n case \"label-grouping\": {\n assert(rhs.type === \"label-grouping\");\n const labelCompareResult = compareStrings(lhs.label, rhs.label);\n if (labelCompareResult !== 0) {\n return labelCompareResult;\n }\n return compareStringsOrUndefined(lhs.groupId, rhs.groupId);\n }\n case \"property-grouping:other\": {\n assert(rhs.type === \"property-grouping:other\");\n if (lhs.properties.length !== rhs.properties.length) {\n return lhs.properties.length - rhs.properties.length;\n }\n for (let i = 0; i < lhs.properties.length; ++i) {\n const classCompareResult = compareStrings(lhs.properties[i].className, rhs.properties[i].className);\n if (classCompareResult !== 0) {\n return classCompareResult;\n }\n const nameCompareResult = compareStrings(lhs.properties[i].propertyName, rhs.properties[i].propertyName);\n if (nameCompareResult !== 0) {\n return nameCompareResult;\n }\n }\n return 0;\n }\n case \"property-grouping:value\": {\n assert(rhs.type === \"property-grouping:value\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n return compareStrings(lhs.formattedPropertyValue, rhs.formattedPropertyValue);\n }\n case \"property-grouping:range\": {\n assert(rhs.type === \"property-grouping:range\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n if (lhs.fromValue !== rhs.fromValue) {\n return lhs.fromValue > rhs.fromValue ? 1 : -1;\n }\n return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;\n }\n }\n }\n\n /** Checks whether the two given keys are equal. */\n export function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean {\n return compare(lhs, rhs) === 0;\n }\n}\n"]}
@@ -1,10 +1,7 @@
1
1
  import { GenericInstanceFilter } from "@itwin/core-common";
2
- import { ECClassHierarchyInspector, ECSchemaProvider, InstanceKey, IPrimitiveValueFormatter } from "@itwin/presentation-shared";
3
- import { HierarchyDefinition } from "./HierarchyDefinition";
2
+ import { Event, InstanceKey, IPrimitiveValueFormatter } from "@itwin/presentation-shared";
3
+ import { HierarchyFilteringPath } from "./HierarchyFiltering";
4
4
  import { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode";
5
- import { HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier";
6
- import { GroupingNodeKey } from "./HierarchyNodeKey";
7
- import { LimitingECSqlQueryExecutor } from "./LimitingECSqlQueryExecutor";
8
5
  /**
9
6
  * Props for the `HierarchyProvider.getNodes` call.
10
7
  * @beta
@@ -26,111 +23,49 @@ export interface GetHierarchyNodesProps {
26
23
  ignoreCache?: boolean;
27
24
  }
28
25
  /**
29
- * An interface for a hierarchy provider knows how to create child nodes for a given parent node.
26
+ * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.
30
27
  * @beta
31
28
  */
32
29
  export interface HierarchyProvider {
30
+ /**
31
+ * An event that provider raises when the internal data source changes, resulting in a
32
+ * hierarchy change.
33
+ *
34
+ * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.
35
+ */
36
+ readonly hierarchyChanged: Event<() => void>;
33
37
  /** Gets nodes for the specified parent node. */
34
38
  getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;
35
39
  /** Gets instance keys for the specified parent node. */
36
40
  getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, "ignoreCache">): AsyncIterableIterator<InstanceKey>;
37
- /** Notifies the provider that the underlying data source has changed and caches should be invalidated. */
38
- notifyDataSourceChanged(): void;
39
41
  /**
40
42
  * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`
41
43
  * resets the formatter to the result of `createDefaultValueFormatter` called with default parameters.
42
44
  */
43
45
  setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;
44
- }
45
- /**
46
- * Defines the strings used by hierarchy provider.
47
- * @beta
48
- */
49
- interface HierarchyProviderLocalizedStrings {
50
- /**
51
- * A string for "Unspecified". Used for labels of property grouping nodes
52
- * that group by an empty value.
53
- */
54
- unspecified: string;
55
46
  /**
56
- * A string for "Other". Used for label of a range property grouping node that
57
- * groups values which don't fit into any other range.
47
+ * Sets the hierarchy filter used by this hierarchy provider. Setting to `undefined`
48
+ * removes the filter.
58
49
  */
59
- other: string;
60
- }
61
- /** @beta */
62
- export interface FilterTargetGroupingNodeInfo {
63
- /** Key of the grouping node. */
64
- key: GroupingNodeKey;
65
- /**
66
- * Depth of the grouping node in the hierarchy.
67
- * Generally, it can be retrieved from `parentKeys.length`.
68
- */
69
- depth: number;
70
- }
71
- /** @beta */
72
- export interface HierarchyFilteringPathOptions {
73
- /**
74
- * This option specifies the way `autoExpand` flag should be assigned to nodes in the filtered hierarchy.
75
- * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.
76
- * - If it's `true`, then all nodes up to the filter target will have `autoExpand` flag.
77
- * - If it's an instance of `FilterTargetGroupingNodeInfo`, then all nodes up to the grouping node that matches this property,
78
- * will have `autoExpand` flag.
79
- */
80
- autoExpand?: boolean | FilterTargetGroupingNodeInfo;
50
+ setHierarchyFilter(props: {
51
+ /** A list of node identifiers from root to target node. */
52
+ paths: HierarchyFilteringPath[];
53
+ } | undefined): void;
81
54
  }
82
55
  /**
83
- * A path of hierarchy node identifiers for filtering the hierarchy with additional options.
56
+ * Props for `mergeProviders` function.
84
57
  * @beta
85
58
  */
86
- export type HierarchyFilteringPath = HierarchyNodeIdentifiersPath | {
87
- path: HierarchyNodeIdentifiersPath;
88
- options: HierarchyFilteringPathOptions;
89
- };
90
- /**
91
- * Props for `createHierarchyProvider`.
92
- * @beta
93
- */
94
- interface HierarchyProviderProps {
95
- /**
96
- * An object that provides access to iModel's data and metadata.
97
- *
98
- * @see `ECSchemaProvider`
99
- * @see `LimitingECSqlQueryExecutor`
100
- * @see `ECClassHierarchyInspector`
101
- */
102
- imodelAccess: ECSchemaProvider & LimitingECSqlQueryExecutor & ECClassHierarchyInspector;
103
- /**
104
- * A function that returns a hierarchy definition, describing how the hierarchy that the provider should be create. The
105
- * function is called once during the provider's construction.
106
- */
107
- hierarchyDefinition: HierarchyDefinition;
108
- /** Maximum number of queries that the provider attempts to execute in parallel. Defaults to `10`. */
109
- queryConcurrency?: number;
110
- /**
111
- * The amount of queries whose results are stored in-memory for quick retrieval. Defaults to `1`,
112
- * which means only results of the last run query are cached.
113
- */
114
- queryCacheSize?: number;
115
- /**
116
- * A values formatter for formatting node labels. Defaults to the
117
- * result of `createDefaultValueFormatter` called with default parameters.
118
- */
119
- formatter?: IPrimitiveValueFormatter;
120
- /** A set of localized strings to use. Defaults to English strings. */
121
- localizedStrings?: Partial<HierarchyProviderLocalizedStrings>;
122
- /** Props for filtering the hierarchy. */
123
- filtering?: {
124
- /** A list of node identifiers from root to target node. */
125
- paths: HierarchyFilteringPath[];
126
- };
59
+ interface MergeHierarchyProvidersProps {
60
+ /** List of providers to merge. */
61
+ providers: HierarchyProvider[];
127
62
  }
128
63
  /**
129
- * Creates an instance of `HierarchyProvider` that creates a hierarchy based on given iModel and
130
- * a hierarchy definition, which defines each hierarchy level through ECSQL queries.
131
- *
64
+ * Creates a single, merged, hierarchy provider from multiple given providers.
132
65
  * @beta
133
66
  */
134
- export declare function createHierarchyProvider(props: HierarchyProviderProps): HierarchyProvider;
67
+ export declare function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & {
68
+ dispose: () => void;
69
+ };
135
70
  export {};
136
71
  //# sourceMappingURL=HierarchyProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAGL,yBAAyB,EACzB,gBAAgB,EAIhB,WAAW,EACX,wBAAwB,EAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA6B,mBAAmB,EAA4B,MAAM,uBAAuB,CAAC;AAEjH,OAAO,EACL,aAAa,EAEb,mBAAmB,EAMpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAsBvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAU1E;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E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