@itwin/presentation-hierarchies 0.1.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 (277) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE.md +9 -0
  3. package/README.md +178 -0
  4. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts +228 -0
  5. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts.map +1 -0
  6. package/lib/cjs/hierarchies/HierarchyDefinition.js +94 -0
  7. package/lib/cjs/hierarchies/HierarchyDefinition.js.map +1 -0
  8. package/lib/cjs/hierarchies/HierarchyErrors.d.ts +9 -0
  9. package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +1 -0
  10. package/lib/cjs/hierarchies/HierarchyErrors.js +20 -0
  11. package/lib/cjs/hierarchies/HierarchyErrors.js.map +1 -0
  12. package/lib/cjs/hierarchies/HierarchyNode.d.ts +337 -0
  13. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -0
  14. package/lib/cjs/hierarchies/HierarchyNode.js +64 -0
  15. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -0
  16. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +33 -0
  17. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
  18. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +34 -0
  19. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
  20. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +137 -0
  21. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
  22. package/lib/cjs/hierarchies/HierarchyNodeKey.js +163 -0
  23. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -0
  24. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +104 -0
  25. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -0
  26. package/lib/cjs/hierarchies/HierarchyProvider.js +384 -0
  27. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -0
  28. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts +21 -0
  29. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  30. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js +100 -0
  31. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -0
  32. package/lib/cjs/hierarchies/Logging.d.ts +13 -0
  33. package/lib/cjs/hierarchies/Logging.d.ts.map +1 -0
  34. package/lib/cjs/hierarchies/Logging.js +28 -0
  35. package/lib/cjs/hierarchies/Logging.js.map +1 -0
  36. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts +205 -0
  37. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -0
  38. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js +467 -0
  39. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js.map +1 -0
  40. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts +40 -0
  41. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -0
  42. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js +84 -0
  43. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -0
  44. package/lib/cjs/hierarchies/internal/Common.d.ts +20 -0
  45. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -0
  46. package/lib/cjs/hierarchies/internal/Common.js +106 -0
  47. package/lib/cjs/hierarchies/internal/Common.js.map +1 -0
  48. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +12 -0
  49. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +1 -0
  50. package/lib/cjs/hierarchies/internal/EachValueFrom.js +108 -0
  51. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -0
  52. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts +39 -0
  53. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -0
  54. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js +181 -0
  55. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -0
  56. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +14 -0
  57. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
  58. package/lib/cjs/hierarchies/internal/LoggingUtils.js +56 -0
  59. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +1 -0
  60. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts +17 -0
  61. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
  62. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +57 -0
  63. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
  64. package/lib/cjs/hierarchies/internal/TreeNodesReader.d.ts +37 -0
  65. package/lib/cjs/hierarchies/internal/TreeNodesReader.d.ts.map +1 -0
  66. package/lib/cjs/hierarchies/internal/TreeNodesReader.js +46 -0
  67. package/lib/cjs/hierarchies/internal/TreeNodesReader.js.map +1 -0
  68. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts +11 -0
  69. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -0
  70. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js +34 -0
  71. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js.map +1 -0
  72. package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts +27 -0
  73. package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts.map +1 -0
  74. package/lib/cjs/hierarchies/internal/operators/Grouping.js +161 -0
  75. package/lib/cjs/hierarchies/internal/operators/Grouping.js.map +1 -0
  76. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts +11 -0
  77. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -0
  78. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js +52 -0
  79. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -0
  80. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts +11 -0
  81. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -0
  82. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js +55 -0
  83. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -0
  84. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts +6 -0
  85. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +1 -0
  86. package/lib/cjs/hierarchies/internal/operators/Partition.js +61 -0
  87. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +1 -0
  88. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +22 -0
  89. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
  90. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +51 -0
  91. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
  92. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts +7 -0
  93. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
  94. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +25 -0
  95. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
  96. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +9 -0
  97. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
  98. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +24 -0
  99. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
  100. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts +12 -0
  101. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
  102. package/lib/cjs/hierarchies/internal/operators/Sorting.js +26 -0
  103. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -0
  104. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts +4 -0
  105. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
  106. package/lib/cjs/hierarchies/internal/operators/TapOnce.js +20 -0
  107. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +1 -0
  108. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.d.ts +4 -0
  109. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +1 -0
  110. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js +27 -0
  111. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js.map +1 -0
  112. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts +10 -0
  113. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  114. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js +115 -0
  115. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +1 -0
  116. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.d.ts +6 -0
  117. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +1 -0
  118. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js +56 -0
  119. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js.map +1 -0
  120. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.d.ts +4 -0
  121. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +1 -0
  122. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js +54 -0
  123. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js.map +1 -0
  124. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.d.ts +5 -0
  125. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +1 -0
  126. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js +61 -0
  127. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js.map +1 -0
  128. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts +31 -0
  129. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  130. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js +310 -0
  131. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -0
  132. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.d.ts +5 -0
  133. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.d.ts.map +1 -0
  134. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js +30 -0
  135. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js.map +1 -0
  136. package/lib/cjs/presentation-hierarchies.d.ts +11 -0
  137. package/lib/cjs/presentation-hierarchies.d.ts.map +1 -0
  138. package/lib/cjs/presentation-hierarchies.js +31 -0
  139. package/lib/cjs/presentation-hierarchies.js.map +1 -0
  140. package/lib/esm/hierarchies/HierarchyDefinition.d.ts +228 -0
  141. package/lib/esm/hierarchies/HierarchyDefinition.d.ts.map +1 -0
  142. package/lib/esm/hierarchies/HierarchyDefinition.js +90 -0
  143. package/lib/esm/hierarchies/HierarchyDefinition.js.map +1 -0
  144. package/lib/esm/hierarchies/HierarchyErrors.d.ts +9 -0
  145. package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +1 -0
  146. package/lib/esm/hierarchies/HierarchyErrors.js +16 -0
  147. package/lib/esm/hierarchies/HierarchyErrors.js.map +1 -0
  148. package/lib/esm/hierarchies/HierarchyNode.d.ts +337 -0
  149. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -0
  150. package/lib/esm/hierarchies/HierarchyNode.js +61 -0
  151. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -0
  152. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +33 -0
  153. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
  154. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js +31 -0
  155. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
  156. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +137 -0
  157. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
  158. package/lib/esm/hierarchies/HierarchyNodeKey.js +160 -0
  159. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -0
  160. package/lib/esm/hierarchies/HierarchyProvider.d.ts +104 -0
  161. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -0
  162. package/lib/esm/hierarchies/HierarchyProvider.js +380 -0
  163. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -0
  164. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts +21 -0
  165. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  166. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js +96 -0
  167. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -0
  168. package/lib/esm/hierarchies/Logging.d.ts +13 -0
  169. package/lib/esm/hierarchies/Logging.d.ts.map +1 -0
  170. package/lib/esm/hierarchies/Logging.js +23 -0
  171. package/lib/esm/hierarchies/Logging.js.map +1 -0
  172. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts +205 -0
  173. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -0
  174. package/lib/esm/hierarchies/NodeSelectQueryFactory.js +463 -0
  175. package/lib/esm/hierarchies/NodeSelectQueryFactory.js.map +1 -0
  176. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts +40 -0
  177. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -0
  178. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js +80 -0
  179. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -0
  180. package/lib/esm/hierarchies/internal/Common.d.ts +20 -0
  181. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -0
  182. package/lib/esm/hierarchies/internal/Common.js +95 -0
  183. package/lib/esm/hierarchies/internal/Common.js.map +1 -0
  184. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +12 -0
  185. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +1 -0
  186. package/lib/esm/hierarchies/internal/EachValueFrom.js +104 -0
  187. package/lib/esm/hierarchies/internal/EachValueFrom.js.map +1 -0
  188. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts +39 -0
  189. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -0
  190. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js +176 -0
  191. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -0
  192. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +14 -0
  193. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
  194. package/lib/esm/hierarchies/internal/LoggingUtils.js +50 -0
  195. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +1 -0
  196. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +17 -0
  197. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
  198. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js +53 -0
  199. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
  200. package/lib/esm/hierarchies/internal/TreeNodesReader.d.ts +37 -0
  201. package/lib/esm/hierarchies/internal/TreeNodesReader.d.ts.map +1 -0
  202. package/lib/esm/hierarchies/internal/TreeNodesReader.js +41 -0
  203. package/lib/esm/hierarchies/internal/TreeNodesReader.js.map +1 -0
  204. package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts +11 -0
  205. package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -0
  206. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js +30 -0
  207. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js.map +1 -0
  208. package/lib/esm/hierarchies/internal/operators/Grouping.d.ts +27 -0
  209. package/lib/esm/hierarchies/internal/operators/Grouping.d.ts.map +1 -0
  210. package/lib/esm/hierarchies/internal/operators/Grouping.js +156 -0
  211. package/lib/esm/hierarchies/internal/operators/Grouping.js.map +1 -0
  212. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts +11 -0
  213. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -0
  214. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js +48 -0
  215. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -0
  216. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts +11 -0
  217. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -0
  218. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js +51 -0
  219. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -0
  220. package/lib/esm/hierarchies/internal/operators/Partition.d.ts +6 -0
  221. package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +1 -0
  222. package/lib/esm/hierarchies/internal/operators/Partition.js +57 -0
  223. package/lib/esm/hierarchies/internal/operators/Partition.js.map +1 -0
  224. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +22 -0
  225. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
  226. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js +46 -0
  227. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
  228. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +7 -0
  229. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
  230. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js +21 -0
  231. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
  232. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +9 -0
  233. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
  234. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js +20 -0
  235. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
  236. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +12 -0
  237. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
  238. package/lib/esm/hierarchies/internal/operators/Sorting.js +22 -0
  239. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -0
  240. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +4 -0
  241. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
  242. package/lib/esm/hierarchies/internal/operators/TapOnce.js +16 -0
  243. package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +1 -0
  244. package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.d.ts +4 -0
  245. package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +1 -0
  246. package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.js +23 -0
  247. package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.js.map +1 -0
  248. package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts +10 -0
  249. package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  250. package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.js +109 -0
  251. package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +1 -0
  252. package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.d.ts +6 -0
  253. package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +1 -0
  254. package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.js +52 -0
  255. package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.js.map +1 -0
  256. package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.d.ts +4 -0
  257. package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +1 -0
  258. package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.js +50 -0
  259. package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.js.map +1 -0
  260. package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.d.ts +5 -0
  261. package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +1 -0
  262. package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.js +57 -0
  263. package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.js.map +1 -0
  264. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts +31 -0
  265. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  266. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js +302 -0
  267. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -0
  268. package/lib/esm/hierarchies/internal/operators/grouping/Shared.d.ts +5 -0
  269. package/lib/esm/hierarchies/internal/operators/grouping/Shared.d.ts.map +1 -0
  270. package/lib/esm/hierarchies/internal/operators/grouping/Shared.js +26 -0
  271. package/lib/esm/hierarchies/internal/operators/grouping/Shared.js.map +1 -0
  272. package/lib/esm/presentation-hierarchies.d.ts +11 -0
  273. package/lib/esm/presentation-hierarchies.d.ts.map +1 -0
  274. package/lib/esm/presentation-hierarchies.js +15 -0
  275. package/lib/esm/presentation-hierarchies.js.map +1 -0
  276. package/media/sample-hierarchy.png +0 -0
  277. package/package.json +71 -0
@@ -0,0 +1,337 @@
1
+ import { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from "@itwin/presentation-shared";
2
+ import { ClassGroupingNodeKey, GroupingNodeKey, HierarchyNodeKey, InstancesNodeKey, LabelGroupingNodeKey, PropertyGroupingNodeKey, PropertyOtherValuesGroupingNodeKey, PropertyValueGroupingNodeKey, PropertyValueRangeGroupingNodeKey, StandardHierarchyNodeKey } from "./HierarchyNodeKey";
3
+ /**
4
+ * A data structure that represents a single non-grouping hierarchy node.
5
+ */
6
+ interface BaseHierarchyNode {
7
+ /** Identifiers of all node ancestors. Can be used to identify a node in the hierarchy. */
8
+ parentKeys: HierarchyNodeKey[];
9
+ /** Node's display label. */
10
+ label: string;
11
+ /** A flag indicating whether the node has children or not. */
12
+ children: boolean;
13
+ /** A flag indicating whether this node should be auto-expanded in the UI. */
14
+ autoExpand?: boolean;
15
+ /** Additional data that may be assigned to this node. */
16
+ extendedData?: {
17
+ [key: string]: any;
18
+ };
19
+ }
20
+ /**
21
+ * A data structure that represents a single non-grouping hierarchy node.
22
+ * @beta
23
+ */
24
+ export interface NonGroupingHierarchyNode extends BaseHierarchyNode {
25
+ /** An identifier to identify the node in its hierarchy level. */
26
+ key: string | InstancesNodeKey;
27
+ /**
28
+ * Identifies whether the hierarchy level below this node supports filtering. If not, supplying an instance
29
+ * filter when requesting child hierarchy level will have no effect.
30
+ */
31
+ supportsFiltering?: boolean;
32
+ }
33
+ /**
34
+ * A data structure that represents a grouping node that groups other nodes.
35
+ * @beta
36
+ */
37
+ export interface GroupingHierarchyNode extends BaseHierarchyNode {
38
+ /** An identifier to identify this grouping node in its hierarchy level. */
39
+ key: GroupingNodeKey;
40
+ /**
41
+ * Keys of all instances grouped by this node, including deeply nested under
42
+ * other grouping nodes.
43
+ */
44
+ groupedInstanceKeys: InstanceKey[];
45
+ /** The closest ancestor node that is not a grouping node. May be `undefined` if the grouping node grouped root level nodes. */
46
+ nonGroupingAncestor?: ParentHierarchyNode<NonGroupingHierarchyNode>;
47
+ }
48
+ /**
49
+ * A data structure that represents a single hierarchy node.
50
+ * @beta
51
+ */
52
+ export type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;
53
+ /** @beta */
54
+ export declare namespace HierarchyNode {
55
+ /** Checks whether the given node is a custom node */
56
+ function isCustom<TNode extends {
57
+ key: HierarchyNodeKey;
58
+ }>(node: TNode): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedCustomHierarchyNode : NonGroupingHierarchyNode) & {
59
+ key: string;
60
+ };
61
+ /** Checks whether the given node is a standard (iModel content based) node */
62
+ function isStandard<TNode extends {
63
+ key: HierarchyNodeKey;
64
+ }>(node: TNode): node is TNode & {
65
+ key: StandardHierarchyNodeKey;
66
+ };
67
+ /** Checks whether the given node is an ECInstances-based node */
68
+ function isInstancesNode<TNode extends {
69
+ key: HierarchyNodeKey;
70
+ }>(node: TNode): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedInstanceHierarchyNode : NonGroupingHierarchyNode) & {
71
+ key: InstancesNodeKey;
72
+ };
73
+ /** Checks whether the given node is a grouping node */
74
+ function isGroupingNode<TNode extends {
75
+ key: HierarchyNodeKey;
76
+ }>(node: TNode): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
77
+ /** Checks whether the given node is a class grouping node */
78
+ function isClassGroupingNode<TNode extends {
79
+ key: HierarchyNodeKey;
80
+ }>(node: TNode): node is TNode & {
81
+ key: ClassGroupingNodeKey;
82
+ supportsFiltering?: undefined;
83
+ } & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
84
+ /** Checks whether the given node is a label grouping node */
85
+ function isLabelGroupingNode<TNode extends {
86
+ key: HierarchyNodeKey;
87
+ }>(node: TNode): node is TNode & {
88
+ key: LabelGroupingNodeKey;
89
+ supportsFiltering?: undefined;
90
+ } & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
91
+ /** Checks whether the given node is property grouping node for other values */
92
+ function isPropertyOtherValuesGroupingNode<TNode extends {
93
+ key: HierarchyNodeKey;
94
+ }>(node: TNode): node is TNode & {
95
+ key: PropertyOtherValuesGroupingNodeKey;
96
+ supportsFiltering?: undefined;
97
+ } & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
98
+ /** Checks whether the given node is a property value grouping node */
99
+ function isPropertyValueGroupingNode<TNode extends {
100
+ key: HierarchyNodeKey;
101
+ }>(node: TNode): node is TNode & {
102
+ key: PropertyValueGroupingNodeKey;
103
+ supportsFiltering?: undefined;
104
+ } & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
105
+ /** Checks whether the given node is a property value range grouping node */
106
+ function isPropertyValueRangeGroupingNode<TNode extends {
107
+ key: HierarchyNodeKey;
108
+ }>(node: TNode): node is TNode & {
109
+ key: PropertyValueRangeGroupingNodeKey;
110
+ supportsFiltering?: undefined;
111
+ } & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
112
+ /** Checks whether the given node is a property grouping node */
113
+ function isPropertyGroupingNode<TNode extends {
114
+ key: HierarchyNodeKey;
115
+ }>(node: TNode): node is TNode & {
116
+ key: PropertyGroupingNodeKey;
117
+ supportsFiltering?: undefined;
118
+ } & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode);
119
+ }
120
+ /**
121
+ * A type of `HierarchyNode` that doesn't know about its children and is an input when requesting
122
+ * them using `HierarchyProvider.getNodes`.
123
+ *
124
+ * @internal
125
+ */
126
+ export type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, "children">;
127
+ /**
128
+ * Base processing parameters that apply to every node.
129
+ */
130
+ interface HierarchyNodeProcessingParamsBase {
131
+ /** Indicates if this node should be hidden if it has no child nodes. */
132
+ hideIfNoChildren?: boolean;
133
+ /** Indicates that this node should always be hidden and its children should be loaded in its place. */
134
+ hideInHierarchy?: boolean;
135
+ }
136
+ /**
137
+ * A data structure for defining nodes' grouping requirements.
138
+ */
139
+ interface HierarchyNodeGroupingParams {
140
+ byLabel?: HierarchyNodeLabelGroupingParams;
141
+ byClass?: boolean | HierarchyNodeGroupingParamsBase;
142
+ byBaseClasses?: HierarchyNodeBaseClassGroupingParams;
143
+ byProperties?: HierarchyNodePropertiesGroupingParams;
144
+ }
145
+ /**
146
+ * A data structure for defining params specifically used for label grouping.
147
+ */
148
+ interface HierarchyNodeLabelGroupingBaseParams {
149
+ /** Label grouping option that determines whether to group nodes or to merge them. Defaults to "group".*/
150
+ action?: "group" | "merge";
151
+ /** Value that needs to match in order for nodes to be grouped or merged.*/
152
+ groupId?: string;
153
+ }
154
+ /**
155
+ * A data structure for defining label merging.
156
+ */
157
+ interface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {
158
+ action: "merge";
159
+ }
160
+ /**
161
+ * A data structure for defining label grouping with additional parameters.
162
+ */
163
+ interface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {
164
+ action?: "group";
165
+ }
166
+ /**
167
+ * A data structure for defining possible label grouping types.
168
+ * @internal
169
+ */
170
+ export type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;
171
+ /**
172
+ * Grouping parameters that are shared across all types of groupings.
173
+ * @internal
174
+ */
175
+ export interface HierarchyNodeGroupingParamsBase {
176
+ /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */
177
+ hideIfNoSiblings?: boolean;
178
+ /** Hiding option that determines whether to hide group nodes which have only one node as its children. */
179
+ hideIfOneGroupedNode?: boolean;
180
+ /** Option which auto expands grouping nodes' children when it has single child or always. */
181
+ autoExpand?: HierarchyNodeAutoExpandProp;
182
+ }
183
+ /**
184
+ * Defines possible values for `BaseGroupingParams.autoExpand` attribute:
185
+ * - `single-child` - set the grouping node to auto-expand if it groups a single node.
186
+ * - `always` - always set the grouping node to auto-expand.
187
+ *
188
+ * @internal
189
+ */
190
+ export type HierarchyNodeAutoExpandProp = "single-child" | "always";
191
+ /**
192
+ * A data structure that represents base class grouping.
193
+ */
194
+ interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {
195
+ /**
196
+ * Full names of classes, which should be used to group the node. Only has effect if the node
197
+ * represents an instance of that class.
198
+ *
199
+ * Full class name format: `SchemaName.ClassName`.
200
+ */
201
+ fullClassNames: string[];
202
+ }
203
+ /**
204
+ * A data structure that represents properties grouping.
205
+ * @internal
206
+ */
207
+ export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {
208
+ /**
209
+ * Full name of a class whose properties are used to group the node. Only has effect if the node
210
+ * represents an instance of that class.
211
+ *
212
+ * Full class name format: `SchemaName.ClassName`.
213
+ */
214
+ propertiesClassName: string;
215
+ /**
216
+ * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.
217
+ *
218
+ * Label of the created grouping node will be `Not Specified`.
219
+ */
220
+ createGroupForUnspecifiedValues?: boolean;
221
+ /**
222
+ * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided
223
+ * ranges, or is not a numeric value.
224
+ *
225
+ * Label of the created grouping node will be `Other`.
226
+ */
227
+ createGroupForOutOfRangeValues?: boolean;
228
+ /**
229
+ * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a
230
+ * grouping hierarchy level.
231
+ *
232
+ * Example usage:
233
+ * ```ts
234
+ * propertyGroups: [
235
+ * {
236
+ * propertyName: "type",
237
+ * propertyValue: "Wall"
238
+ * },
239
+ * {
240
+ * propertyName: "length",
241
+ * propertyValue: 15,
242
+ * ranges: [
243
+ * { fromValue: 1, toValue: 10, rangeLabel: "Small" },
244
+ * { fromValue: 11, toValue: 20, rangeLabel: "Medium" }
245
+ * ]
246
+ * },
247
+ * ]
248
+ * ```
249
+ */
250
+ propertyGroups: HierarchyNodePropertyGroup[];
251
+ }
252
+ /**
253
+ * A data structure that represents specific properties' grouping params.
254
+ * @internal
255
+ */
256
+ export interface HierarchyNodePropertyGroup {
257
+ /** A string indicating the name of the property to group by. */
258
+ propertyName: string;
259
+ /** Value of the property, which will be used to group the node. */
260
+ propertyValue?: PrimitiveValue;
261
+ /** Ranges are used to group nodes by numeric properties which are within specified bounds. */
262
+ ranges?: HierarchyNodePropertyValueRange[];
263
+ }
264
+ /**
265
+ * A data structure that represents boundaries for a value.
266
+ * @internal
267
+ */
268
+ export interface HierarchyNodePropertyValueRange {
269
+ /** Defines the lower bound of the range. */
270
+ fromValue: number;
271
+ /** Defines the upper bound of the range. */
272
+ toValue: number;
273
+ /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */
274
+ rangeLabel?: string;
275
+ }
276
+ /**
277
+ * Processing parameters that apply to instance nodes.
278
+ * @internal
279
+ */
280
+ export interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {
281
+ grouping?: HierarchyNodeGroupingParams;
282
+ }
283
+ /**
284
+ * A custom (not based on data in an iModel) node that has processing parameters.
285
+ * @internal
286
+ */
287
+ export type ProcessedCustomHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
288
+ key: string;
289
+ children?: boolean;
290
+ processingParams?: HierarchyNodeProcessingParamsBase;
291
+ };
292
+ /**
293
+ * An instances' (based on data in an iModel) node that has processing parameters.
294
+ * @internal
295
+ */
296
+ export type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
297
+ key: InstancesNodeKey;
298
+ children?: boolean;
299
+ processingParams?: InstanceHierarchyNodeProcessingParams;
300
+ };
301
+ /**
302
+ * A grouping node that groups either instance nodes or other grouping nodes.
303
+ * @internal
304
+ */
305
+ export type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, "children"> & {
306
+ children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;
307
+ };
308
+ /**
309
+ * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,
310
+ * how it should be grouped, sorted, etc.
311
+ *
312
+ * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of
313
+ * `ProcessedHierarchyNode`.
314
+ *
315
+ * @beta
316
+ */
317
+ export type ProcessedHierarchyNode = ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;
318
+ /**
319
+ * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is
320
+ * returned when the node is just parsed from query results.
321
+ * @beta
322
+ */
323
+ export type ParsedHierarchyNode<TBase = ParsedCustomHierarchyNode | ParsedInstanceHierarchyNode> = OmitOverUnion<TBase, "label" | "parentKeys"> & {
324
+ label: string | ConcatenatedValue;
325
+ };
326
+ /**
327
+ * A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors.
328
+ * @internal
329
+ */
330
+ export type ParsedCustomHierarchyNode = ParsedHierarchyNode<ProcessedCustomHierarchyNode>;
331
+ /**
332
+ * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.
333
+ * @internal
334
+ */
335
+ export type ParsedInstanceHierarchyNode = ParsedHierarchyNode<ProcessedInstanceHierarchyNode>;
336
+ export {};
337
+ //# sourceMappingURL=HierarchyNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HierarchyNode.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC3G,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EACjC,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,UAAU,iBAAiB;IACzB,0FAA0F;IAC1F,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,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,MAAM,MAAM,sBAAsB,GAAG,4BAA4B,GAAG,8BAA8B,GAAG,8BAA8B,CAAC;AAEpI;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,KAAK,GAAG,yBAAyB,GAAG,2BAA2B,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAAC,GAAG;IAChJ,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAC;CACnC,CAAC;AACF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;AAC1F;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { HierarchyNodeKey, } from "./HierarchyNodeKey";
6
+ /** @beta */
7
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
8
+ export var HierarchyNode;
9
+ (function (HierarchyNode) {
10
+ /** Checks whether the given node is a custom node */
11
+ function isCustom(node) {
12
+ return HierarchyNodeKey.isCustom(node.key);
13
+ }
14
+ HierarchyNode.isCustom = isCustom;
15
+ /** Checks whether the given node is a standard (iModel content based) node */
16
+ function isStandard(node) {
17
+ return HierarchyNodeKey.isStandard(node.key);
18
+ }
19
+ HierarchyNode.isStandard = isStandard;
20
+ /** Checks whether the given node is an ECInstances-based node */
21
+ function isInstancesNode(node) {
22
+ return HierarchyNodeKey.isInstances(node.key);
23
+ }
24
+ HierarchyNode.isInstancesNode = isInstancesNode;
25
+ /** Checks whether the given node is a grouping node */
26
+ function isGroupingNode(node) {
27
+ return HierarchyNodeKey.isGrouping(node.key);
28
+ }
29
+ HierarchyNode.isGroupingNode = isGroupingNode;
30
+ /** Checks whether the given node is a class grouping node */
31
+ function isClassGroupingNode(node) {
32
+ return HierarchyNodeKey.isClassGrouping(node.key);
33
+ }
34
+ HierarchyNode.isClassGroupingNode = isClassGroupingNode;
35
+ /** Checks whether the given node is a label grouping node */
36
+ function isLabelGroupingNode(node) {
37
+ return HierarchyNodeKey.isLabelGrouping(node.key);
38
+ }
39
+ HierarchyNode.isLabelGroupingNode = isLabelGroupingNode;
40
+ /** Checks whether the given node is property grouping node for other values */
41
+ function isPropertyOtherValuesGroupingNode(node) {
42
+ return HierarchyNodeKey.isPropertyOtherValuesGrouping(node.key);
43
+ }
44
+ HierarchyNode.isPropertyOtherValuesGroupingNode = isPropertyOtherValuesGroupingNode;
45
+ /** Checks whether the given node is a property value grouping node */
46
+ function isPropertyValueGroupingNode(node) {
47
+ return HierarchyNodeKey.isPropertyValueGrouping(node.key);
48
+ }
49
+ HierarchyNode.isPropertyValueGroupingNode = isPropertyValueGroupingNode;
50
+ /** Checks whether the given node is a property value range grouping node */
51
+ function isPropertyValueRangeGroupingNode(node) {
52
+ return HierarchyNodeKey.isPropertyValueRangeGrouping(node.key);
53
+ }
54
+ HierarchyNode.isPropertyValueRangeGroupingNode = isPropertyValueRangeGroupingNode;
55
+ /** Checks whether the given node is a property grouping node */
56
+ function isPropertyGroupingNode(node) {
57
+ return HierarchyNodeKey.isPropertyGrouping(node.key);
58
+ }
59
+ HierarchyNode.isPropertyGroupingNode = isPropertyGroupingNode;
60
+ })(HierarchyNode || (HierarchyNode = {}));
61
+ //# sourceMappingURL=HierarchyNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HierarchyNode.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAGL,gBAAgB,GAQjB,MAAM,oBAAoB,CAAC;AAwD5B,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CAuE7B;AAvED,WAAiB,aAAa;IAC5B,qDAAqD;IACrD,SAAgB,QAAQ,CACtB,IAAW;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B,gCAAgC,CAC9C,IAAW;QAIX,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IANe,8CAAgC,mCAM/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAIX,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IANe,oCAAsB,yBAMrC,CAAA;AACH,CAAC,EAvEgB,aAAa,KAAb,aAAa,QAuE7B","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 { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from \"@itwin/presentation-shared\";\nimport {\n ClassGroupingNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n StandardHierarchyNodeKey,\n} from \"./HierarchyNodeKey\";\n\n/**\n * A data structure that represents a single non-grouping hierarchy node.\n */\ninterface BaseHierarchyNode {\n /** Identifiers of all node ancestors. Can be used to identify a node in the hierarchy. */\n parentKeys: HierarchyNodeKey[];\n /** Node's display label. */\n label: string;\n /** A flag indicating whether the node has children or not. */\n children: boolean;\n /** A flag indicating whether this node should be auto-expanded in the UI. */\n autoExpand?: boolean;\n /** Additional data that may be assigned to this node. */\n extendedData?: { [key: string]: any };\n}\n\n/**\n * A data structure that represents a single non-grouping hierarchy node.\n * @beta\n */\nexport interface NonGroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify the node in its hierarchy level. */\n key: string | InstancesNodeKey;\n /**\n * Identifies whether the hierarchy level below this node supports filtering. If not, supplying an instance\n * filter when requesting child hierarchy level will have no effect.\n */\n supportsFiltering?: boolean;\n}\n\n/**\n * A data structure that represents a grouping node that groups other nodes.\n * @beta\n */\nexport interface GroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify this grouping node in its hierarchy level. */\n key: GroupingNodeKey;\n\n /**\n * Keys of all instances grouped by this node, including deeply nested under\n * other grouping nodes.\n */\n groupedInstanceKeys: InstanceKey[];\n\n /** The closest ancestor node that is not a grouping node. May be `undefined` if the grouping node grouped root level nodes. */\n nonGroupingAncestor?: ParentHierarchyNode<NonGroupingHierarchyNode>;\n}\n\n/**\n * A data structure that represents a single hierarchy node.\n * @beta\n */\nexport type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNode {\n /** Checks whether the given node is a custom node */\n export function isCustom<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedCustomHierarchyNode : NonGroupingHierarchyNode) & { key: string } {\n return HierarchyNodeKey.isCustom(node.key);\n }\n /** Checks whether the given node is a standard (iModel content based) node */\n export function isStandard<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & { key: StandardHierarchyNodeKey } {\n return HierarchyNodeKey.isStandard(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedInstanceHierarchyNode : NonGroupingHierarchyNode) & { key: InstancesNodeKey } {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode) {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n /** Checks whether the given node is a class grouping node */\n export function isClassGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: ClassGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isClassGrouping(node.key);\n }\n /** Checks whether the given node is a label grouping node */\n export function isLabelGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: LabelGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isLabelGrouping(node.key);\n }\n /** Checks whether the given node is property grouping node for other values */\n export function isPropertyOtherValuesGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyOtherValuesGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyOtherValuesGrouping(node.key);\n }\n /** Checks whether the given node is a property value grouping node */\n export function isPropertyValueGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyValueGrouping(node.key);\n }\n /** Checks whether the given node is a property value range grouping node */\n export function isPropertyValueRangeGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueRangeGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyValueRangeGrouping(node.key);\n }\n /** Checks whether the given node is a property grouping node */\n export function isPropertyGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyGrouping(node.key);\n }\n}\n\n/**\n * A type of `HierarchyNode` that doesn't know about its children and is an input when requesting\n * them using `HierarchyProvider.getNodes`.\n *\n * @internal\n */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n\n/**\n * Base processing parameters that apply to every node.\n */\ninterface HierarchyNodeProcessingParamsBase {\n /** Indicates if this node should be hidden if it has no child nodes. */\n hideIfNoChildren?: boolean;\n /** Indicates that this node should always be hidden and its children should be loaded in its place. */\n hideInHierarchy?: boolean;\n}\n\n/**\n * A data structure for defining nodes' grouping requirements.\n */\ninterface HierarchyNodeGroupingParams {\n byLabel?: HierarchyNodeLabelGroupingParams;\n byClass?: boolean | HierarchyNodeGroupingParamsBase;\n byBaseClasses?: HierarchyNodeBaseClassGroupingParams;\n byProperties?: HierarchyNodePropertiesGroupingParams;\n}\n\n/**\n * A data structure for defining params specifically used for label grouping.\n */\ninterface HierarchyNodeLabelGroupingBaseParams {\n /** Label grouping option that determines whether to group nodes or to merge them. Defaults to \"group\".*/\n action?: \"group\" | \"merge\";\n /** Value that needs to match in order for nodes to be grouped or merged.*/\n groupId?: string;\n}\n\n/**\n * A data structure for defining label merging.\n */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/**\n * A data structure for defining possible label grouping types.\n * @internal\n */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/**\n * Grouping parameters that are shared across all types of groupings.\n * @internal\n */\nexport interface HierarchyNodeGroupingParamsBase {\n /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */\n hideIfNoSiblings?: boolean;\n /** Hiding option that determines whether to hide group nodes which have only one node as its children. */\n hideIfOneGroupedNode?: boolean;\n /** Option which auto expands grouping nodes' children when it has single child or always. */\n autoExpand?: HierarchyNodeAutoExpandProp;\n}\n\n/**\n * Defines possible values for `BaseGroupingParams.autoExpand` attribute:\n * - `single-child` - set the grouping node to auto-expand if it groups a single node.\n * - `always` - always set the grouping node to auto-expand.\n *\n * @internal\n */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\n */\ninterface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full names of classes, which should be used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n fullClassNames: string[];\n}\n\n/**\n * A data structure that represents properties grouping.\n * @internal\n */\nexport interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full name of a class whose properties are used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n propertiesClassName: string;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.\n *\n * Label of the created grouping node will be `Not Specified`.\n */\n createGroupForUnspecifiedValues?: boolean;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided\n * ranges, or is not a numeric value.\n *\n * Label of the created grouping node will be `Other`.\n */\n createGroupForOutOfRangeValues?: boolean;\n /**\n * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a\n * grouping hierarchy level.\n *\n * Example usage:\n * ```ts\n * propertyGroups: [\n * {\n * propertyName: \"type\",\n * propertyValue: \"Wall\"\n * },\n * {\n * propertyName: \"length\",\n * propertyValue: 15,\n * ranges: [\n * { fromValue: 1, toValue: 10, rangeLabel: \"Small\" },\n * { fromValue: 11, toValue: 20, rangeLabel: \"Medium\" }\n * ]\n * },\n * ]\n * ```\n */\n propertyGroups: HierarchyNodePropertyGroup[];\n}\n\n/**\n * A data structure that represents specific properties' grouping params.\n * @internal\n */\nexport interface HierarchyNodePropertyGroup {\n /** A string indicating the name of the property to group by. */\n propertyName: string;\n /** Value of the property, which will be used to group the node. */\n propertyValue?: PrimitiveValue;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/**\n * A data structure that represents boundaries for a value.\n * @internal\n */\nexport interface HierarchyNodePropertyValueRange {\n /** Defines the lower bound of the range. */\n fromValue: number;\n /** Defines the upper bound of the range. */\n toValue: number;\n /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */\n rangeLabel?: string;\n}\n\n/**\n * Processing parameters that apply to instance nodes.\n * @internal\n */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/**\n * A custom (not based on data in an iModel) node that has processing parameters.\n * @internal\n */\nexport type ProcessedCustomHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: string;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n/**\n * An instances' (based on data in an iModel) node that has processing parameters.\n * @internal\n */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n/**\n * A grouping node that groups either instance nodes or other grouping nodes.\n * @internal\n */\nexport type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, \"children\"> & {\n children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;\n};\n/**\n * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,\n * how it should be grouped, sorted, etc.\n *\n * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of\n * `ProcessedHierarchyNode`.\n *\n * @beta\n */\nexport type ProcessedHierarchyNode = ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;\n\n/**\n * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is\n * returned when the node is just parsed from query results.\n * @beta\n */\nexport type ParsedHierarchyNode<TBase = ParsedCustomHierarchyNode | ParsedInstanceHierarchyNode> = OmitOverUnion<TBase, \"label\" | \"parentKeys\"> & {\n label: string | ConcatenatedValue;\n};\n/**\n * A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @internal\n */\nexport type ParsedCustomHierarchyNode = ParsedHierarchyNode<ProcessedCustomHierarchyNode>;\n/**\n * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @internal\n */\nexport type ParsedInstanceHierarchyNode = ParsedHierarchyNode<ProcessedInstanceHierarchyNode>;\n"]}
@@ -0,0 +1,33 @@
1
+ import { InstanceKey } from "@itwin/presentation-shared";
2
+ /**
3
+ * An identifier that can be used to identify either an ECInstance or a custom node.
4
+ *
5
+ * This is different from `HierarchyNodeKey` - the key can represent more types of nodes and,
6
+ * in case of `InstancesNodeKey`, contains information about all instances the node represents.
7
+ * `HierarchyNodeIdentifier`, on the other hand, is used for matching a node, so it only needs
8
+ * to contain information about a single instance or custom node key.
9
+ *
10
+ * @beta
11
+ */
12
+ export type HierarchyNodeIdentifier = InstanceKey | {
13
+ key: string;
14
+ };
15
+ /** @beta */
16
+ export declare namespace HierarchyNodeIdentifier {
17
+ /** Checks whether the given identifier is an instance node identifier */
18
+ function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is InstanceKey;
19
+ /** Checks whether the given identifier is a custom node identifier */
20
+ function isCustomNodeIdentifier(id: HierarchyNodeIdentifier): id is {
21
+ key: string;
22
+ };
23
+ /** Checks two identifiers for equality */
24
+ function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier): boolean;
25
+ }
26
+ /**
27
+ * A path of hierarchy node identifiers, typically used to describe a path from root down
28
+ * to specific node deep in the hierarchy.
29
+ *
30
+ * @beta
31
+ */
32
+ export type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];
33
+ //# sourceMappingURL=HierarchyNodeIdentifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HierarchyNodeIdentifier.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,YAAY;AAEZ,yBAAiB,uBAAuB,CAAC;IACvC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,WAAW,CAEvF;IAED,sEAAsE;IACtE,SAAgB,sBAAsB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAEzF;IAED,0CAA0C;IAC1C,SAAgB,KAAK,CAAC,GAAG,EAAE,uBAAuB,EAAE,GAAG,EAAE,uBAAuB,WAQ/E;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @beta */
6
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
7
+ export var HierarchyNodeIdentifier;
8
+ (function (HierarchyNodeIdentifier) {
9
+ /** Checks whether the given identifier is an instance node identifier */
10
+ function isInstanceNodeIdentifier(id) {
11
+ return !!id.id;
12
+ }
13
+ HierarchyNodeIdentifier.isInstanceNodeIdentifier = isInstanceNodeIdentifier;
14
+ /** Checks whether the given identifier is a custom node identifier */
15
+ function isCustomNodeIdentifier(id) {
16
+ return !!id.key;
17
+ }
18
+ HierarchyNodeIdentifier.isCustomNodeIdentifier = isCustomNodeIdentifier;
19
+ /** Checks two identifiers for equality */
20
+ function equal(lhs, rhs) {
21
+ if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {
22
+ return lhs.className === rhs.className && lhs.id === rhs.id;
23
+ }
24
+ if (isCustomNodeIdentifier(lhs) && isCustomNodeIdentifier(rhs)) {
25
+ return lhs.key === rhs.key;
26
+ }
27
+ return false;
28
+ }
29
+ HierarchyNodeIdentifier.equal = equal;
30
+ })(HierarchyNodeIdentifier || (HierarchyNodeIdentifier = {}));
31
+ //# sourceMappingURL=HierarchyNodeIdentifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HierarchyNodeIdentifier.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAgBhG,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,uBAAuB,CAqBvC;AArBD,WAAiB,uBAAuB;IACtC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAA2B;QAClE,OAAO,CAAC,CAAE,EAAkB,CAAC,EAAE,CAAC;IAClC,CAAC;IAFe,gDAAwB,2BAEvC,CAAA;IAED,sEAAsE;IACtE,SAAgB,sBAAsB,CAAC,EAA2B;QAChE,OAAO,CAAC,CAAE,EAAsB,CAAC,GAAG,CAAC;IACvC,CAAC;IAFe,8CAAsB,yBAErC,CAAA;IAED,0CAA0C;IAC1C,SAAgB,KAAK,CAAC,GAA4B,EAAE,GAA4B;QAC9E,IAAI,wBAAwB,CAAC,GAAG,CAAC,IAAI,wBAAwB,CAAC,GAAG,CAAC,EAAE,CAAC;YACnE,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;QAC9D,CAAC;QACD,IAAI,sBAAsB,CAAC,GAAG,CAAC,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/D,OAAO,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC;QAC7B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IARe,6BAAK,QAQpB,CAAA;AACH,CAAC,EArBgB,uBAAuB,KAAvB,uBAAuB,QAqBvC","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 { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * An identifier that can be used to identify either an ECInstance or a custom node.\n *\n * This is different from `HierarchyNodeKey` - the key can represent more types of nodes and,\n * in case of `InstancesNodeKey`, contains information about all instances the node represents.\n * `HierarchyNodeIdentifier`, on the other hand, is used for matching a node, so it only needs\n * to contain information about a single instance or custom node key.\n *\n * @beta\n */\nexport type HierarchyNodeIdentifier = InstanceKey | { key: string };\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeIdentifier {\n /** Checks whether the given identifier is an instance node identifier */\n export function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is InstanceKey {\n return !!(id as InstanceKey).id;\n }\n\n /** Checks whether the given identifier is a custom node identifier */\n export function isCustomNodeIdentifier(id: HierarchyNodeIdentifier): id is { key: string } {\n return !!(id as { key: string }).key;\n }\n\n /** Checks two identifiers for equality */\n export function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier) {\n if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {\n return lhs.className === rhs.className && lhs.id === rhs.id;\n }\n if (isCustomNodeIdentifier(lhs) && isCustomNodeIdentifier(rhs)) {\n return lhs.key === rhs.key;\n }\n return false;\n }\n}\n\n/**\n * A path of hierarchy node identifiers, typically used to describe a path from root down\n * to specific node deep in the hierarchy.\n *\n * @beta\n */\nexport type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];\n"]}