@itwin/presentation-hierarchies 2.0.0-alpha.10 → 2.0.0-alpha.12

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 (259) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/lib/cjs/hierarchies/HierarchyMerge.d.ts +1 -1
  3. package/lib/cjs/hierarchies/HierarchyMerge.d.ts.map +1 -1
  4. package/lib/cjs/hierarchies/HierarchyMerge.js +1 -1
  5. package/lib/cjs/hierarchies/HierarchyMerge.js.map +1 -1
  6. package/lib/cjs/hierarchies/HierarchyNode.d.ts +4 -3
  7. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  8. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +1 -1
  10. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
  11. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
  12. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +51 -8
  13. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  14. package/lib/cjs/hierarchies/HierarchyProvider.js +53 -0
  15. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  16. package/lib/cjs/hierarchies/HierarchySearch.d.ts +5 -3
  17. package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +1 -1
  18. package/lib/cjs/hierarchies/HierarchySearch.js.map +1 -1
  19. package/lib/cjs/hierarchies/Logging.d.ts +1 -1
  20. package/lib/cjs/hierarchies/Logging.d.ts.map +1 -1
  21. package/lib/cjs/hierarchies/Logging.js.map +1 -1
  22. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts +1 -1
  23. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +1 -1
  24. package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +1 -1
  25. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +16 -6
  26. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
  27. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
  28. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +3 -3
  29. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
  30. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
  31. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +4 -4
  32. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  33. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +12 -12
  34. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  35. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +1 -1
  36. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  37. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -1
  38. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +3 -3
  39. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  40. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +3 -3
  41. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  42. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +4 -4
  43. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  44. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  45. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts +4 -4
  46. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -1
  47. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +2 -2
  48. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -1
  49. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +7 -7
  50. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
  51. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +1 -2
  52. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +1 -1
  53. package/lib/cjs/hierarchies/imodel/Utils.d.ts +1 -1
  54. package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +1 -1
  55. package/lib/cjs/hierarchies/imodel/Utils.js.map +1 -1
  56. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts +2 -2
  57. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -1
  58. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +1 -1
  59. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +5 -5
  60. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +1 -1
  61. package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +1 -1
  62. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts +1 -1
  63. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -1
  64. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -1
  65. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
  66. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -1
  67. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -1
  68. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +1 -1
  69. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -1
  70. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -1
  71. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +4 -4
  72. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -1
  73. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
  74. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +4 -4
  75. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
  76. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
  77. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +1 -1
  78. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -1
  79. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -1
  80. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +2 -2
  81. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -1
  82. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -1
  83. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +4 -4
  84. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
  85. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +1 -1
  86. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
  87. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts +2 -2
  88. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -1
  89. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +1 -1
  90. package/lib/cjs/hierarchies/internal/Common.d.ts +3 -3
  91. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
  92. package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
  93. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +1 -1
  94. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +1 -1
  95. package/lib/cjs/hierarchies/internal/EachValueFrom.js +2 -0
  96. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -1
  97. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +1 -1
  98. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +1 -1
  99. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +1 -1
  100. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts +12 -5
  101. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -1
  102. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +2 -2
  103. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -1
  104. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts +1 -1
  105. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -1
  106. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +1 -1
  107. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts +2 -1
  108. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +1 -1
  109. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +1 -1
  110. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +1 -1
  111. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  112. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -1
  113. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts +1 -1
  114. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -1
  115. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -1
  116. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +1 -1
  117. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -1
  118. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -1
  119. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts +1 -1
  120. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
  121. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
  122. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts +1 -1
  123. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +1 -1
  124. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +1 -1
  125. package/lib/cjs/presentation-hierarchies.d.ts +20 -10
  126. package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
  127. package/lib/cjs/presentation-hierarchies.js +3 -1
  128. package/lib/cjs/presentation-hierarchies.js.map +1 -1
  129. package/lib/esm/hierarchies/HierarchyMerge.d.ts +1 -1
  130. package/lib/esm/hierarchies/HierarchyMerge.d.ts.map +1 -1
  131. package/lib/esm/hierarchies/HierarchyMerge.js +1 -1
  132. package/lib/esm/hierarchies/HierarchyMerge.js.map +1 -1
  133. package/lib/esm/hierarchies/HierarchyNode.d.ts +4 -3
  134. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  135. package/lib/esm/hierarchies/HierarchyNode.js +1 -1
  136. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  137. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +1 -1
  138. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
  139. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
  140. package/lib/esm/hierarchies/HierarchyProvider.d.ts +51 -8
  141. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  142. package/lib/esm/hierarchies/HierarchyProvider.js +52 -1
  143. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  144. package/lib/esm/hierarchies/HierarchySearch.d.ts +5 -3
  145. package/lib/esm/hierarchies/HierarchySearch.d.ts.map +1 -1
  146. package/lib/esm/hierarchies/HierarchySearch.js.map +1 -1
  147. package/lib/esm/hierarchies/Logging.d.ts +1 -1
  148. package/lib/esm/hierarchies/Logging.d.ts.map +1 -1
  149. package/lib/esm/hierarchies/Logging.js.map +1 -1
  150. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +1 -1
  151. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +1 -1
  152. package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +1 -1
  153. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts +16 -6
  154. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
  155. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
  156. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +3 -3
  157. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
  158. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
  159. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +4 -4
  160. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  161. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +14 -14
  162. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  163. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +1 -1
  164. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  165. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js +1 -1
  166. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -1
  167. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts +3 -3
  168. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  169. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js +5 -5
  170. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  171. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +4 -4
  172. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  173. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  174. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts +4 -4
  175. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -1
  176. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js +3 -3
  177. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -1
  178. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts +7 -7
  179. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
  180. package/lib/esm/hierarchies/imodel/TreeNodesReader.js +1 -2
  181. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +1 -1
  182. package/lib/esm/hierarchies/imodel/Utils.d.ts +1 -1
  183. package/lib/esm/hierarchies/imodel/Utils.d.ts.map +1 -1
  184. package/lib/esm/hierarchies/imodel/Utils.js.map +1 -1
  185. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +2 -2
  186. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -1
  187. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +1 -1
  188. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts +5 -5
  189. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +1 -1
  190. package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +1 -1
  191. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +1 -1
  192. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -1
  193. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -1
  194. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
  195. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -1
  196. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -1
  197. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +1 -1
  198. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -1
  199. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -1
  200. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +4 -4
  201. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -1
  202. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +1 -1
  203. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
  204. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +4 -4
  205. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
  206. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
  207. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +1 -1
  208. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -1
  209. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -1
  210. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +2 -2
  211. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -1
  212. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -1
  213. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +4 -4
  214. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
  215. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +1 -1
  216. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
  217. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts +2 -2
  218. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -1
  219. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +1 -1
  220. package/lib/esm/hierarchies/internal/Common.d.ts +3 -3
  221. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
  222. package/lib/esm/hierarchies/internal/Common.js.map +1 -1
  223. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +1 -1
  224. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +1 -1
  225. package/lib/esm/hierarchies/internal/EachValueFrom.js +2 -0
  226. package/lib/esm/hierarchies/internal/EachValueFrom.js.map +1 -1
  227. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +1 -1
  228. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +1 -1
  229. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +1 -1
  230. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts +12 -5
  231. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -1
  232. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js +2 -2
  233. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -1
  234. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +1 -1
  235. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -1
  236. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +1 -1
  237. package/lib/esm/hierarchies/internal/operators/Partition.d.ts +2 -1
  238. package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +1 -1
  239. package/lib/esm/hierarchies/internal/operators/Partition.js.map +1 -1
  240. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +1 -1
  241. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  242. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -1
  243. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +1 -1
  244. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -1
  245. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -1
  246. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +1 -1
  247. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -1
  248. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -1
  249. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +1 -1
  250. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
  251. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -1
  252. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +1 -1
  253. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +1 -1
  254. package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +1 -1
  255. package/lib/esm/presentation-hierarchies.d.ts +20 -10
  256. package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
  257. package/lib/esm/presentation-hierarchies.js +4 -3
  258. package/lib/esm/presentation-hierarchies.js.map +1 -1
  259. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,113 @@
1
1
  # @itwin/presentation-hierarchies
2
2
 
3
+ ## 2.0.0-alpha.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1229](https://github.com/iTwin/presentation/pull/1229): Version bump
8
+ - Updated dependencies:
9
+ - @itwin/presentation-shared@2.0.0-alpha.8
10
+
11
+ ## 2.0.0-alpha.11
12
+
13
+ ### Major Changes
14
+
15
+ - [#1198](https://github.com/iTwin/presentation/pull/1198): Change `HierarchyProvider.hierarchyChanged` argument to be required.
16
+
17
+ This simplifies the API for users of `HierarchyProvider`, as they no longer need to check for `undefined` when handling hierarchy changes.
18
+
19
+ For implementors of custom `HierarchyProvider`, this change means that they must always provide an even argument when raising the `hierarchyChanged` event. Since all members of the argument type are optional, it's okay to raise the even with an empty object, e.g.: `this.hierarchyChanged.raiseEvent({})`.
20
+
21
+ - [#1202](https://github.com/iTwin/presentation/pull/1202): Change `NodePreProcessor` and `NodePostProcessor` function types to take a props object instead of a node.
22
+
23
+ In addition, the props object now contains the `parentNode` property, which provides access to the parent node of the current node being processed. This allows for more context-aware processing of nodes within the hierarchy.
24
+
25
+ The change breaks consumers that have `HierarchyDefinition` implementations with `preProcessNode` or `postProcessNode` functions defined. Reacting to the change is straightforward:
26
+
27
+ ```ts
28
+ const myHierarchyDefinition: HierarchyDefinition = {
29
+ // Before:
30
+ preProcessNode: async (node) => {
31
+ // process node
32
+ },
33
+ postProcessNode: async (node) => {
34
+ // process node
35
+ },
36
+
37
+ // After:
38
+ preProcessNode: async ({ node, parentNode }) => {
39
+ // process node with access to parentNode
40
+ },
41
+ postProcessNode: async ({ node, parentNode }) => {
42
+ // process node with access to parentNode
43
+ },
44
+
45
+ // ... the rest of implementation
46
+ };
47
+ ```
48
+
49
+ ### Minor Changes
50
+
51
+ - [#1204](https://github.com/iTwin/presentation/pull/1204): Add `createHierarchyProvider` utility function.
52
+
53
+ This function simplifies the creation of custom hierarchy providers by allowing developers to define only the necessary methods, while providing default implementations for the rest. This enhancement improves developer experience and reduces boilerplate code when working with custom hierarchy providers in the `@itwin/presentation-hierarchies` package.
54
+
55
+ **Before:**
56
+
57
+ ```ts
58
+ const beforeAsPlainObject: HierarchyProvider = {
59
+ hierarchyChanged: new BeEvent(),
60
+ async *getNodes({ parentNode }) {
61
+ // yield nodes...
62
+ },
63
+ async *getNodeInstanceKeys() {},
64
+ setFormatter() {},
65
+ setHierarchySearch() {},
66
+ };
67
+
68
+ const beforeAsClassObject = new (class implements HierarchyProvider {
69
+ public hierarchyChanged: new BeEvent(),
70
+ public async *getNodes({ parentNode }) {
71
+ // yield nodes...
72
+ },
73
+ public async *getNodeInstanceKeys() {},
74
+ public setFormatter(formatter: IPrimitiveValueFormatter | undefined) {
75
+ // set formatter...
76
+ hierarchyChanged.raiseEvent({ formatterChange: { newFormatter: formatter } });
77
+ },
78
+ public setHierarchySearch() {},
79
+ })();
80
+ ```
81
+
82
+ **After:**
83
+
84
+ ```ts
85
+ const afterAsPlainObject = createHierarchyProvider(() => ({
86
+ async *getNodes({ parentNode }) {
87
+ // yield nodes...
88
+ },
89
+ }));
90
+
91
+ // or, provide implementation as a class instance:
92
+ const afterAsClassObject = createHierarchyProvider(
93
+ ({ hierarchyChanged }) =>
94
+ new (class implements Pick<HierarchyProvider, "getNodes" | "setFormatter"> {
95
+ public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
96
+ // yield nodes...
97
+ }
98
+ public setFormatter(formatter: IPrimitiveValueFormatter | undefined) {
99
+ // set formatter...
100
+ hierarchyChanged.raiseEvent({ formatterChange: { newFormatter: formatter } });
101
+ }
102
+ })(),
103
+ );
104
+ ```
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies:
109
+ - @itwin/presentation-shared@2.0.0-alpha.7
110
+
3
111
  ## 2.0.0-alpha.10
4
112
 
5
113
  ### Patch Changes
@@ -168,6 +276,22 @@
168
276
  - Updated dependencies:
169
277
  - @itwin/presentation-shared@2.0.0-alpha.0
170
278
 
279
+ ## 1.7.10
280
+
281
+ ### Patch Changes
282
+
283
+ - [#1215](https://github.com/iTwin/presentation/pull/1215): Update dependencies.
284
+ - Updated dependencies:
285
+ - @itwin/presentation-shared@1.2.9
286
+
287
+ ## 1.7.9
288
+
289
+ ### Patch Changes
290
+
291
+ - [#1208](https://github.com/iTwin/presentation/pull/1208): Bump dependencies.
292
+ - Updated dependencies:
293
+ - @itwin/presentation-shared@1.2.8
294
+
171
295
  ## 1.7.8
172
296
 
173
297
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import "./internal/DisposePolyfill.js";
2
- import { HierarchyProvider } from "./HierarchyProvider.js";
2
+ import type { HierarchyProvider } from "./HierarchyProvider.js";
3
3
  /**
4
4
  * Props for `mergeProviders` function.
5
5
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyMerge.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyMerge.ts"],"names":[],"mappings":"AAKA,OAAO,+BAA+B,CAAC;AAIvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAK3D;;;GAGG;AACH,UAAU,4BAA4B;IACpC,kCAAkC;IAClC,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,EAAE,4BAA4B,GAAG,iBAAiB,GAAG;IAC/F,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B,CAyCA"}
1
+ {"version":3,"file":"HierarchyMerge.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyMerge.ts"],"names":[],"mappings":"AAKA,OAAO,+BAA+B,CAAC;AASvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;GAGG;AACH,UAAU,4BAA4B;IACpC,kCAAkC;IAClC,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,EAAE,4BAA4B,GAAG,iBAAiB,GAAG;IAC/F,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B,CAyCA"}
@@ -18,7 +18,7 @@ const Sorting_js_1 = require("./internal/operators/Sorting.js");
18
18
  function mergeProviders({ providers }) {
19
19
  const hierarchyChanged = new core_bentley_1.BeEvent();
20
20
  providers.forEach((p) => {
21
- p.hierarchyChanged.addListener(() => hierarchyChanged.raiseEvent());
21
+ p.hierarchyChanged.addListener((args) => hierarchyChanged.raiseEvent(args));
22
22
  });
23
23
  const dispose = () => {
24
24
  hierarchyChanged.clear();
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyMerge.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyMerge.ts"],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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,EACjD,IAAA,UAAG,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EACf,IAAA,YAAK,EAAC,SAAS,EAAE,KAAK,CAAC,EACvB,IAAA,UAAG,EAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,CAC3D,CAAC;QACJ,CAAC,CAAC,CACH,CACF,EACD,qCAAwB,CACzB,CACF;QACH,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,gCAAa,EAAC,IAAA,WAAI,EAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAA,eAAQ,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClH,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChF,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpF,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./internal/DisposePolyfill.js\";\n\nimport { filter, first, from, map, mergeMap, of } from \"rxjs\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { HierarchyProvider } from \"./HierarchyProvider.js\";\nimport { safeDispose } from \"./internal/Common.js\";\nimport { eachValueFrom } from \"./internal/EachValueFrom.js\";\nimport { sortNodesByLabelOperator } from \"./internal/operators/Sorting.js\";\n\n/**\n * Props for `mergeProviders` function.\n * @public\n */\ninterface MergeHierarchyProvidersProps {\n /** List of providers to merge. */\n providers: HierarchyProvider[];\n}\n\n/**\n * Creates a single, merged, hierarchy provider from multiple given providers.\n * @public\n */\nexport function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & {\n [Symbol.dispose]: () => void;\n} {\n const hierarchyChanged = new BeEvent<() => void>();\n providers.forEach((p) => {\n p.hierarchyChanged.addListener(() => hierarchyChanged.raiseEvent());\n });\n const dispose = () => {\n hierarchyChanged.clear();\n providers.forEach((p) => safeDispose(p));\n };\n\n return {\n hierarchyChanged,\n getNodes: (props) =>\n eachValueFrom(\n from(providers).pipe(\n mergeMap((provider) =>\n from(provider.getNodes(props)).pipe(\n mergeMap((node) => {\n if (node.children) {\n return of(node);\n }\n // each provider only considers its own data when determining node's children - in case it says\n // the node has no children, we have to check against the other providers too\n return from(providers).pipe(\n filter((p) => p !== provider),\n mergeMap((p) => p.getNodes({ parentNode: node })),\n map(() => true),\n first(undefined, false),\n map((hasChildren) => ({ ...node, children: hasChildren })),\n );\n }),\n ),\n ),\n sortNodesByLabelOperator,\n ),\n ),\n getNodeInstanceKeys: (props) => eachValueFrom(from(providers).pipe(mergeMap((p) => p.getNodeInstanceKeys(props)))),\n setFormatter: (formatter) => providers.forEach((p) => p.setFormatter(formatter)),\n setHierarchySearch: (props) => providers.forEach((p) => p.setHierarchySearch(props)),\n [Symbol.dispose]: dispose,\n };\n}\n"]}
1
+ {"version":3,"file":"HierarchyMerge.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyMerge.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AA0BhG,wCA2CC;AAnED,yCAAuC;AAEvC,+BAA8D;AAC9D,sDAA8C;AAC9C,oDAAmD;AACnD,kE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AAC,CAAC,EACjD,IAAA,UAAG,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EACf,IAAA,YAAK,EAAC,SAAS,EAAE,KAAK,CAAC,EACvB,IAAA,UAAG,EAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,CAC3D,CAAC;QACJ,CAAC,CAAC,CACH,CACF,EACD,qCAAwB,CACzB,CACF;QACH,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,gCAAa,EAAC,IAAA,WAAI,EAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAA,eAAQ,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClH,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChF,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpF,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./internal/DisposePolyfill.js\";\n\nimport { filter, first, from, map, mergeMap, of } from \"rxjs\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { safeDispose } from \"./internal/Common.js\";\nimport { eachValueFrom } from \"./internal/EachValueFrom.js\";\nimport { sortNodesByLabelOperator } from \"./internal/operators/Sorting.js\";\n\nimport type { EventArgs } from \"@itwin/presentation-shared\";\nimport type { HierarchyProvider } from \"./HierarchyProvider.js\";\n\n/**\n * Props for `mergeProviders` function.\n * @public\n */\ninterface MergeHierarchyProvidersProps {\n /** List of providers to merge. */\n providers: HierarchyProvider[];\n}\n\n/**\n * Creates a single, merged, hierarchy provider from multiple given providers.\n * @public\n */\nexport function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & {\n [Symbol.dispose]: () => void;\n} {\n const hierarchyChanged = new BeEvent<(args: EventArgs<HierarchyProvider[\"hierarchyChanged\"]>) => void>();\n providers.forEach((p) => {\n p.hierarchyChanged.addListener((args) => hierarchyChanged.raiseEvent(args));\n });\n const dispose = () => {\n hierarchyChanged.clear();\n providers.forEach((p) => safeDispose(p));\n };\n\n return {\n hierarchyChanged,\n getNodes: (props) =>\n eachValueFrom(\n from(providers).pipe(\n mergeMap((provider) =>\n from(provider.getNodes(props)).pipe(\n mergeMap((node) => {\n if (node.children) {\n return of(node);\n }\n // each provider only considers its own data when determining node's children - in case it says\n // the node has no children, we have to check against the other providers too\n return from(providers).pipe(\n filter((p) => p !== provider),\n mergeMap((p) => p.getNodes({ parentNode: node })),\n map(() => true),\n first(undefined, false),\n map((hasChildren) => ({ ...node, children: hasChildren })),\n );\n }),\n ),\n ),\n sortNodesByLabelOperator,\n ),\n ),\n getNodeInstanceKeys: (props) => eachValueFrom(from(providers).pipe(mergeMap((p) => p.getNodeInstanceKeys(props)))),\n setFormatter: (formatter) => providers.forEach((p) => p.setFormatter(formatter)),\n setHierarchySearch: (props) => providers.forEach((p) => p.setHierarchySearch(props)),\n [Symbol.dispose]: dispose,\n };\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { OmitOverUnion } from "@itwin/presentation-shared";
2
- import { ClassGroupingNodeKey, GenericNodeKey, GroupingNodeKey, HierarchyNodeKey, IModelHierarchyNodeKey, IModelInstanceKey, InstancesNodeKey, LabelGroupingNodeKey, PropertyGroupingNodeKey, PropertyOtherValuesGroupingNodeKey, PropertyValueGroupingNodeKey, PropertyValueRangeGroupingNodeKey } from "./HierarchyNodeKey.js";
3
- import { HierarchySearchPath, HierarchySearchPathOptions } from "./HierarchySearch.js";
1
+ import { HierarchyNodeKey } from "./HierarchyNodeKey.js";
2
+ import type { OmitOverUnion } from "@itwin/presentation-shared";
3
+ import type { ClassGroupingNodeKey, GenericNodeKey, GroupingNodeKey, IModelHierarchyNodeKey, IModelInstanceKey, InstancesNodeKey, LabelGroupingNodeKey, PropertyGroupingNodeKey, PropertyOtherValuesGroupingNodeKey, PropertyValueGroupingNodeKey, PropertyValueRangeGroupingNodeKey } from "./HierarchyNodeKey.js";
4
+ import type { HierarchySearchPath, HierarchySearchPathOptions } from "./HierarchySearch.js";
4
5
  /** @public */
5
6
  export type HierarchyNodeSearchProps = {
6
7
  /** If set to true, then one of the ancestor nodes in the hierarchy is the search target. */
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyNode.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAEvF,cAAc;AACd,MAAM,MAAM,wBAAwB,GAAG;IACrC,4FAA4F;IAC5F,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C,GAAG,CACA;IACE,mDAAmD;IACnD,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,GACD;IACE,mDAAmD;IACnD,cAAc,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gB,CAAC,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IAJe,+CAAiC,oCAIhD,CAAA;IACD,sEAAsE;IACtE,SAAgB,2BAA2B,CACzC,IAAW;QAEX,OAAO,sCAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IAJe,yCAA2B,8BAI1C,CAAA;IACD,4EAA4E;IAC5E,SAAgB,gCAAgC,CAC9C,IAAW;QAEX,OAAO,sCAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAJe,8CAAgC,mCAI/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAEX,OAAO,sCAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IAJe,oCAAsB,yBAIrC,CAAA;AACH,CAAC,EArDgB,aAAa,6BAAb,aAAa,QAqD7B","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 { OmitOverUnion } from \"@itwin/presentation-shared\";\nimport {\n ClassGroupingNodeKey,\n GenericNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n IModelHierarchyNodeKey,\n IModelInstanceKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n} from \"./HierarchyNodeKey.js\";\nimport { HierarchySearchPath, HierarchySearchPathOptions } from \"./HierarchySearch.js\";\n\n/** @public */\nexport type HierarchyNodeSearchProps = {\n /** If set to true, then one of the ancestor nodes in the hierarchy is the search target. */\n hasSearchTargetAncestor?: boolean;\n /** Paths to node's children that are search targets. */\n childrenTargetPaths?: HierarchySearchPath[];\n} & (\n | {\n /** Whether or not this node is a search target. */\n isSearchTarget?: false;\n }\n | {\n /** Whether or not this node is a search target. */\n isSearchTarget: true;\n /** Options that were used to search the node. */\n searchTargetOptions?: HierarchySearchPathOptions;\n }\n);\n\n/**\n * A data structure that defines attributes that are common to all types of hierarchy nodes.\n * @public\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 * @public\n */\nexport interface NonGroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify the node in its hierarchy level. */\n key: GenericNodeKey | 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 /** Data that is assigned to the node if hierarchy search is enabled */\n search?: HierarchyNodeSearchProps;\n}\n\n/**\n * A data structure that represents a grouping node that groups other nodes.\n * @public\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: IModelInstanceKey[];\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 * @public\n */\nexport type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & NonGroupingHierarchyNode & { key: GenericNodeKey } {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is a standard (iModel content based) node */\n export function isIModelNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & { key: IModelHierarchyNodeKey } {\n return HierarchyNodeKey.isIModelNodeKey(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & 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 }>(node: TNode): node is TNode & 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 } & 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 } & 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 } & 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 } & 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 } & 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 } & 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 * @public\n */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n"]}
1
+ {"version":3,"file":"HierarchyNode.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+DAAyD;AA8FzD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,aAAa,CAqD7B;AArDD,WAAiB,aAAa;IAC5B,sDAAsD;IACtD,SAAgB,SAAS,CAA0C,IAAW;QAC5E,OAAO,sCAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAFe,uBAAS,YAExB,CAAA;IACD,8EAA8E;IAC9E,SAAgB,YAAY,CAA0C,IAAW;QAC/E,OAAO,sCAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAFe,0BAAY,eAE3B,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAA0C,IAAW;QAClF,OAAO,sCAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAFe,6BAAe,kBAE9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAA0C,IAAW;QACjF,OAAO,sCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,4BAAc,iBAE7B,CAAA;IACD,6DAA6D;IAC7D,SAAgB,mBAAmB,CACjC,IAAW;QAEX,OAAO,sCAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAJe,iCAAmB,sBAIlC,CAAA;IACD,6DAA6D;IAC7D,SAAgB,mBAAmB,CACjC,IAAW;QAEX,OAAO,sCAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAJe,iCAAmB,sBAIlC,CAAA;IACD,gFAAgF;IAChF,SAAgB,iCAAiC,CAC/C,IAAW;QAEX,OAAO,sCAAgB,CAAC,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IAJe,+CAAiC,oCAIhD,CAAA;IACD,sEAAsE;IACtE,SAAgB,2BAA2B,CACzC,IAAW;QAEX,OAAO,sCAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IAJe,yCAA2B,8BAI1C,CAAA;IACD,4EAA4E;IAC5E,SAAgB,gCAAgC,CAC9C,IAAW;QAEX,OAAO,sCAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAJe,8CAAgC,mCAI/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAEX,OAAO,sCAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IAJe,oCAAsB,yBAIrC,CAAA;AACH,CAAC,EArDgB,aAAa,6BAAb,aAAa,QAqD7B","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 { HierarchyNodeKey } from \"./HierarchyNodeKey.js\";\n\nimport type { OmitOverUnion } from \"@itwin/presentation-shared\";\nimport type {\n ClassGroupingNodeKey,\n GenericNodeKey,\n GroupingNodeKey,\n IModelHierarchyNodeKey,\n IModelInstanceKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n} from \"./HierarchyNodeKey.js\";\nimport type { HierarchySearchPath, HierarchySearchPathOptions } from \"./HierarchySearch.js\";\n\n/** @public */\nexport type HierarchyNodeSearchProps = {\n /** If set to true, then one of the ancestor nodes in the hierarchy is the search target. */\n hasSearchTargetAncestor?: boolean;\n /** Paths to node's children that are search targets. */\n childrenTargetPaths?: HierarchySearchPath[];\n} & (\n | {\n /** Whether or not this node is a search target. */\n isSearchTarget?: false;\n }\n | {\n /** Whether or not this node is a search target. */\n isSearchTarget: true;\n /** Options that were used to search the node. */\n searchTargetOptions?: HierarchySearchPathOptions;\n }\n);\n\n/**\n * A data structure that defines attributes that are common to all types of hierarchy nodes.\n * @public\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 * @public\n */\nexport interface NonGroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify the node in its hierarchy level. */\n key: GenericNodeKey | 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 /** Data that is assigned to the node if hierarchy search is enabled */\n search?: HierarchyNodeSearchProps;\n}\n\n/**\n * A data structure that represents a grouping node that groups other nodes.\n * @public\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: IModelInstanceKey[];\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 * @public\n */\nexport type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & NonGroupingHierarchyNode & { key: GenericNodeKey } {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is a standard (iModel content based) node */\n export function isIModelNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & { key: IModelHierarchyNodeKey } {\n return HierarchyNodeKey.isIModelNodeKey(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & 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 }>(node: TNode): node is TNode & 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 } & 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 } & 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 } & 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 } & 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 } & 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 } & 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 * @public\n */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n"]}
@@ -1,4 +1,4 @@
1
- import { GenericNodeKey, IModelInstanceKey } from "./HierarchyNodeKey.js";
1
+ import type { GenericNodeKey, IModelInstanceKey } from "./HierarchyNodeKey.js";
2
2
  /**
3
3
  * An identifier that can be used to identify either an ECInstance or a generic node.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyNodeIdentifier.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1E;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAEzE,cAAc;AAEd,yBAAiB,uBAAuB,CAAC;IACvC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,iBAAiB,CAE7F;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,cAAc,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"}
1
+ {"version":3,"file":"HierarchyNodeIdentifier.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAEzE,cAAc;AAEd,yBAAiB,uBAAuB,CAAC;IACvC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,iBAAiB,CAE7F;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,cAAc,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyNodeIdentifier.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,oEAAyD;AAezD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,uBAAuB,CAqBvC;AArBD,WAAiB,uBAAuB;IACtC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAA2B;QAClE,OAAO,WAAW,IAAI,EAAE,CAAC;IAC3B,CAAC;IAFe,gDAAwB,2BAEvC,CAAA;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAA2B;QACjE,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAFe,+CAAuB,0BAEtC,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,iCAAW,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC;QACzE,CAAC;QACD,IAAI,uBAAuB,CAAC,GAAG,CAAC,IAAI,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC;YACjE,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IARe,6BAAK,QAQpB,CAAA;AACH,CAAC,EArBgB,uBAAuB,uCAAvB,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\";\nimport { GenericNodeKey, IModelInstanceKey } from \"./HierarchyNodeKey.js\";\n\n/**\n * An identifier that can be used to identify either an ECInstance or a generic 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.\n *\n * @public\n */\nexport type HierarchyNodeIdentifier = IModelInstanceKey | GenericNodeKey;\n\n/** @public */\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 IModelInstanceKey {\n return \"className\" in id;\n }\n\n /** Checks whether the given identifier is a generic node identifier */\n export function isGenericNodeIdentifier(id: HierarchyNodeIdentifier): id is GenericNodeKey {\n return !isInstanceNodeIdentifier(id);\n }\n\n /** Checks two identifiers for equality */\n export function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier) {\n if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {\n return InstanceKey.equals(lhs, rhs) && lhs.imodelKey === rhs.imodelKey;\n }\n if (isGenericNodeIdentifier(lhs) && isGenericNodeIdentifier(rhs)) {\n return lhs.source === rhs.source && lhs.id === rhs.id;\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 * @public\n */\nexport type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];\n"]}
1
+ {"version":3,"file":"HierarchyNodeIdentifier.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,oEAAyD;AAgBzD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,uBAAuB,CAqBvC;AArBD,WAAiB,uBAAuB;IACtC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAA2B;QAClE,OAAO,WAAW,IAAI,EAAE,CAAC;IAC3B,CAAC;IAFe,gDAAwB,2BAEvC,CAAA;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAA2B;QACjE,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAFe,+CAAuB,0BAEtC,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,iCAAW,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC;QACzE,CAAC;QACD,IAAI,uBAAuB,CAAC,GAAG,CAAC,IAAI,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC;YACjE,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IARe,6BAAK,QAQpB,CAAA;AACH,CAAC,EArBgB,uBAAuB,uCAAvB,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\nimport type { GenericNodeKey, IModelInstanceKey } from \"./HierarchyNodeKey.js\";\n\n/**\n * An identifier that can be used to identify either an ECInstance or a generic 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.\n *\n * @public\n */\nexport type HierarchyNodeIdentifier = IModelInstanceKey | GenericNodeKey;\n\n/** @public */\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 IModelInstanceKey {\n return \"className\" in id;\n }\n\n /** Checks whether the given identifier is a generic node identifier */\n export function isGenericNodeIdentifier(id: HierarchyNodeIdentifier): id is GenericNodeKey {\n return !isInstanceNodeIdentifier(id);\n }\n\n /** Checks two identifiers for equality */\n export function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier) {\n if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {\n return InstanceKey.equals(lhs, rhs) && lhs.imodelKey === rhs.imodelKey;\n }\n if (isGenericNodeIdentifier(lhs) && isGenericNodeIdentifier(rhs)) {\n return lhs.source === rhs.source && lhs.id === rhs.id;\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 * @public\n */\nexport type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];\n"]}
@@ -1,7 +1,7 @@
1
- import { GenericInstanceFilter } from "@itwin/core-common";
2
- import { Event, InstanceKey, IPrimitiveValueFormatter, Props } from "@itwin/presentation-shared";
3
- import { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode.js";
4
- import { HierarchySearchPath } from "./HierarchySearch.js";
1
+ import type { GenericInstanceFilter } from "@itwin/core-common";
2
+ import type { Event, EventListener, InstanceKey, IPrimitiveValueFormatter, Props, RaisableEvent } from "@itwin/presentation-shared";
3
+ import type { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode.js";
4
+ import type { HierarchySearchPath } from "./HierarchySearch.js";
5
5
  /**
6
6
  * Props for the `HierarchyProvider.getNodes` call.
7
7
  * @public
@@ -42,14 +42,13 @@ interface HierarchyChangedEventArgs {
42
42
  */
43
43
  export interface HierarchyProvider {
44
44
  /**
45
- * An event that provider raises due to a hierarchy change, that requires a reload. Provider may
46
- * set additional event arguments to provide extra information about what caused the change.
45
+ * An event that provider raises due to a hierarchy change that requires a reload.
47
46
  *
48
47
  * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.
49
- * Implementations may provide additional details on what caused the change through the optional
48
+ * Implementations may provide additional details on what caused the change through the
50
49
  * event arguments.
51
50
  */
52
- readonly hierarchyChanged: Event<(args?: HierarchyChangedEventArgs) => void>;
51
+ readonly hierarchyChanged: Event<(args: HierarchyChangedEventArgs) => void>;
53
52
  /**
54
53
  * Gets nodes for the specified parent node. This is **the method to implement**, otherwise
55
54
  * the provider doesn't return any nodes.
@@ -87,5 +86,49 @@ export interface HierarchyProvider {
87
86
  paths: HierarchySearchPath[];
88
87
  } | undefined): void;
89
88
  }
89
+ /**
90
+ * An utility to create a `HierarchyProvider` from a partial implementation.
91
+ *
92
+ * Creating a `HierarchyProvider` directly requires implementing all its methods:
93
+ * ```ts
94
+ * {
95
+ * hierarchyChanged: new BeEvent(),
96
+ * async *getNodes({ parentNode }) {
97
+ * // yield nodes...
98
+ * },
99
+ * async *getNodeInstanceKeys() {},
100
+ * setFormatter() {},
101
+ * setHierarchySearch() {},
102
+ * }
103
+ * ```
104
+ *
105
+ * However, in many cases you may only need to implement the `getNodes` method and
106
+ * can rely on default implementations for other methods.
107
+ *
108
+ * With this utility you can implement only part of it, e.g. just the `getNodes` method:
109
+ * ```ts
110
+ * // provide implementation as a javascript object
111
+ * createHierarchyProvider(({ hierarchyChanged }) => ({
112
+ * async *getNodes({ parentNode }) {
113
+ * // yield nodes...
114
+ * },
115
+ * }));
116
+ *
117
+ * // or, provide implementation as a class instance:
118
+ * createHierarchyProvider(
119
+ * ({ hierarchyChanged }) =>
120
+ * new (class implements Pick<HierarchyProvider, "getNodes"> {
121
+ * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
122
+ * // yield nodes...
123
+ * }
124
+ * })(),
125
+ * );
126
+ * ```
127
+ *
128
+ * @public
129
+ */
130
+ export declare function createHierarchyProvider<TPartialProvider extends Partial<Omit<HierarchyProvider, "hierarchyChanged">> & Pick<HierarchyProvider, "getNodes">>(partialFactory: (props: {
131
+ hierarchyChanged: RaisableEvent<EventListener<HierarchyProvider["hierarchyChanged"]>>;
132
+ }) => TPartialProvider): TPartialProvider & HierarchyProvider;
90
133
  export {};
91
134
  //# sourceMappingURL=HierarchyProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAE5C,0FAA0F;IAC1F,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAE/C,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,UAAU,yBAAyB;IACjC,sEAAsE;IACtE,eAAe,CAAC,EAAE;QAChB,YAAY,EAAE,wBAAwB,GAAG,SAAS,CAAC;KACpD,CAAC;IAEF,6EAA6E;IAC7E,YAAY,CAAC,EA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Ac,EAAE,CAAC,KAAK,EAAE;IAAE,gBAAgB,EAAE,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAA;CAAE,KAAK,gBAAgB,GACrI,gBAAgB,GAAG,iBAAiB,CAStC"}
@@ -4,4 +4,57 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createHierarchyProvider = createHierarchyProvider;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ /**
10
+ * An utility to create a `HierarchyProvider` from a partial implementation.
11
+ *
12
+ * Creating a `HierarchyProvider` directly requires implementing all its methods:
13
+ * ```ts
14
+ * {
15
+ * hierarchyChanged: new BeEvent(),
16
+ * async *getNodes({ parentNode }) {
17
+ * // yield nodes...
18
+ * },
19
+ * async *getNodeInstanceKeys() {},
20
+ * setFormatter() {},
21
+ * setHierarchySearch() {},
22
+ * }
23
+ * ```
24
+ *
25
+ * However, in many cases you may only need to implement the `getNodes` method and
26
+ * can rely on default implementations for other methods.
27
+ *
28
+ * With this utility you can implement only part of it, e.g. just the `getNodes` method:
29
+ * ```ts
30
+ * // provide implementation as a javascript object
31
+ * createHierarchyProvider(({ hierarchyChanged }) => ({
32
+ * async *getNodes({ parentNode }) {
33
+ * // yield nodes...
34
+ * },
35
+ * }));
36
+ *
37
+ * // or, provide implementation as a class instance:
38
+ * createHierarchyProvider(
39
+ * ({ hierarchyChanged }) =>
40
+ * new (class implements Pick<HierarchyProvider, "getNodes"> {
41
+ * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
42
+ * // yield nodes...
43
+ * }
44
+ * })(),
45
+ * );
46
+ * ```
47
+ *
48
+ * @public
49
+ */
50
+ function createHierarchyProvider(partialFactory) {
51
+ const hierarchyChanged = new core_bentley_1.BeEvent();
52
+ const impl = partialFactory({ hierarchyChanged });
53
+ return Object.assign(impl, {
54
+ hierarchyChanged,
55
+ ...(impl.getNodeInstanceKeys ? { getNodeInstanceKeys: impl.getNodeInstanceKeys } : { /* c8 ignore next */ async *getNodeInstanceKeys() { } }),
56
+ ...(impl.setFormatter ? { setFormatter: impl.setFormatter } : { /* c8 ignore next */ setFormatter() { } }),
57
+ ...(impl.setHierarchySearch ? { setHierarchySearch: impl.setHierarchySearch } : { /* c8 ignore next */ setHierarchySearch() { } }),
58
+ });
59
+ }
7
60
  //# sourceMappingURL=HierarchyProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyProvider.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","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 { GenericInstanceFilter } from \"@itwin/core-common\";\nimport { Event, InstanceKey, IPrimitiveValueFormatter, Props } from \"@itwin/presentation-shared\";\nimport { HierarchyNode, ParentHierarchyNode } from \"./HierarchyNode.js\";\nimport { HierarchySearchPath } from \"./HierarchySearch.js\";\n\n/**\n * Props for the `HierarchyProvider.getNodes` call.\n * @public\n */\nexport interface GetHierarchyNodesProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: ParentHierarchyNode | undefined;\n\n /** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */\n instanceFilter?: GenericInstanceFilter;\n\n /**\n * Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used\n * by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever\n * is used by the limiting query executor.\n *\n * Has no effect if `parentNode` is a `GroupingNode`.\n */\n hierarchyLevelSizeLimit?: number | \"unbounded\";\n\n /** When set to `true` ignores the cache and fetches the nodes again. */\n ignoreCache?: boolean;\n}\n\n/**\n * Event arguments for `HierarchyProvider.hierarchyChanged` event.\n * @public\n */\ninterface HierarchyChangedEventArgs {\n /** Set when the hierarchy change was caused by a formatter change. */\n formatterChange?: {\n newFormatter: IPrimitiveValueFormatter | undefined;\n };\n\n /** Set when the hierarchy change was caused by a hierarchy search change. */\n searchChange?: {\n newSearch: Props<HierarchyProvider[\"setHierarchySearch\"]>;\n };\n}\n\n/**\n * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.\n * @public\n */\nexport interface HierarchyProvider {\n /**\n * An event that provider raises due to a hierarchy change, that requires a reload. Provider may\n * set additional event arguments to provide extra information about what caused the change.\n *\n * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.\n * Implementations may provide additional details on what caused the change through the optional\n * event arguments.\n */\n readonly hierarchyChanged: Event<(args?: HierarchyChangedEventArgs) => void>;\n\n /**\n * Gets nodes for the specified parent node. This is **the method to implement**, otherwise\n * the provider doesn't return any nodes.\n */\n getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;\n\n /**\n * Gets instance keys for the specified parent node.\n *\n * The result of this method may be used to determine instances whose nodes would be displayed as children\n * of the specified parent node. For such use cases calling this method should be more efficient compared\n * to calling `getNodes`.\n */\n getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, \"ignoreCache\">): AsyncIterableIterator<InstanceKey>;\n\n /**\n * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`\n * resets the formatter, but what that means depends on the provider implementation - it could just\n * use unformatted values, or use some default formatter, e.g. the on created by `createDefaultValueFormatter`\n * from `@itwin/presentation-shared` package.\n *\n * @note Changing formatter is expected to trigger the `hierarchyChanged` event with `formatterChange` arg.\n */\n setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;\n\n /**\n * Sets the hierarchy search used by this hierarchy provider. Setting to `undefined`\n * removes the search.\n *\n * @note There's a difference between `undefined` search and search with empty paths list. The\n * former means no search is applied, while the latter means the search is applied and it filters-out\n * all hierarchy.\n *\n * @note Changing search is expected to trigger the `hierarchyChanged` event with `searchChange` arg.\n */\n setHierarchySearch(\n props:\n | {\n /** A list of node identifiers from root to target node. */\n paths: HierarchySearchPath[];\n }\n | undefined,\n ): void;\n}\n"]}
1
+ {"version":3,"file":"HierarchyProvider.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAqJhG,0DAWC;AA9JD,sDAA8C;AA0G9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,SAAgB,uBAAuB,CACrC,cAAsI;IAEtI,MAAM,gBAAgB,GAAqD,IAAI,sBAAO,EAAE,CAAC;IACzF,MAAM,IAAI,GAAG,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,gBAAgB;QAChB,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,mBAAmB,KAAI,CAAC,EAAE,CAAC;QAC5I,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,YAAY,KAAI,CAAC,EAAE,CAAC;QACzG,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,kBAAkB,KAAI,CAAC,EAAE,CAAC;KAClI,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BeEvent } from \"@itwin/core-bentley\";\n\nimport type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type { Event, EventListener, InstanceKey, IPrimitiveValueFormatter, Props, RaisableEvent } from \"@itwin/presentation-shared\";\nimport type { HierarchyNode, ParentHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchySearchPath } from \"./HierarchySearch.js\";\n\n/**\n * Props for the `HierarchyProvider.getNodes` call.\n * @public\n */\nexport interface GetHierarchyNodesProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: ParentHierarchyNode | undefined;\n\n /** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */\n instanceFilter?: GenericInstanceFilter;\n\n /**\n * Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used\n * by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever\n * is used by the limiting query executor.\n *\n * Has no effect if `parentNode` is a `GroupingNode`.\n */\n hierarchyLevelSizeLimit?: number | \"unbounded\";\n\n /** When set to `true` ignores the cache and fetches the nodes again. */\n ignoreCache?: boolean;\n}\n\n/**\n * Event arguments for `HierarchyProvider.hierarchyChanged` event.\n * @public\n */\ninterface HierarchyChangedEventArgs {\n /** Set when the hierarchy change was caused by a formatter change. */\n formatterChange?: {\n newFormatter: IPrimitiveValueFormatter | undefined;\n };\n\n /** Set when the hierarchy change was caused by a hierarchy search change. */\n searchChange?: {\n newSearch: Props<HierarchyProvider[\"setHierarchySearch\"]>;\n };\n}\n\n/**\n * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.\n * @public\n */\nexport interface HierarchyProvider {\n /**\n * An event that provider raises due to a hierarchy change that requires a reload.\n *\n * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.\n * Implementations may provide additional details on what caused the change through the\n * event arguments.\n */\n readonly hierarchyChanged: Event<(args: HierarchyChangedEventArgs) => void>;\n\n /**\n * Gets nodes for the specified parent node. This is **the method to implement**, otherwise\n * the provider doesn't return any nodes.\n */\n getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;\n\n /**\n * Gets instance keys for the specified parent node.\n *\n * The result of this method may be used to determine instances whose nodes would be displayed as children\n * of the specified parent node. For such use cases calling this method should be more efficient compared\n * to calling `getNodes`.\n */\n getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, \"ignoreCache\">): AsyncIterableIterator<InstanceKey>;\n\n /**\n * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`\n * resets the formatter, but what that means depends on the provider implementation - it could just\n * use unformatted values, or use some default formatter, e.g. the on created by `createDefaultValueFormatter`\n * from `@itwin/presentation-shared` package.\n *\n * @note Changing formatter is expected to trigger the `hierarchyChanged` event with `formatterChange` arg.\n */\n setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;\n\n /**\n * Sets the hierarchy search used by this hierarchy provider. Setting to `undefined`\n * removes the search.\n *\n * @note There's a difference between `undefined` search and search with empty paths list. The\n * former means no search is applied, while the latter means the search is applied and it filters-out\n * all hierarchy.\n *\n * @note Changing search is expected to trigger the `hierarchyChanged` event with `searchChange` arg.\n */\n setHierarchySearch(\n props:\n | {\n /** A list of node identifiers from root to target node. */\n paths: HierarchySearchPath[];\n }\n | undefined,\n ): void;\n}\n\n/**\n * An utility to create a `HierarchyProvider` from a partial implementation.\n *\n * Creating a `HierarchyProvider` directly requires implementing all its methods:\n * ```ts\n * {\n * hierarchyChanged: new BeEvent(),\n * async *getNodes({ parentNode }) {\n * // yield nodes...\n * },\n * async *getNodeInstanceKeys() {},\n * setFormatter() {},\n * setHierarchySearch() {},\n * }\n * ```\n *\n * However, in many cases you may only need to implement the `getNodes` method and\n * can rely on default implementations for other methods.\n *\n * With this utility you can implement only part of it, e.g. just the `getNodes` method:\n * ```ts\n * // provide implementation as a javascript object\n * createHierarchyProvider(({ hierarchyChanged }) => ({\n * async *getNodes({ parentNode }) {\n * // yield nodes...\n * },\n * }));\n *\n * // or, provide implementation as a class instance:\n * createHierarchyProvider(\n * ({ hierarchyChanged }) =>\n * new (class implements Pick<HierarchyProvider, \"getNodes\"> {\n * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider[\"getNodes\"]> {\n * // yield nodes...\n * }\n * })(),\n * );\n * ```\n *\n * @public\n */\nexport function createHierarchyProvider<TPartialProvider extends Partial<Omit<HierarchyProvider, \"hierarchyChanged\">> & Pick<HierarchyProvider, \"getNodes\">>(\n partialFactory: (props: { hierarchyChanged: RaisableEvent<EventListener<HierarchyProvider[\"hierarchyChanged\"]>> }) => TPartialProvider,\n): TPartialProvider & HierarchyProvider {\n const hierarchyChanged: Props<typeof partialFactory>[\"hierarchyChanged\"] = new BeEvent();\n const impl = partialFactory({ hierarchyChanged });\n return Object.assign(impl, {\n hierarchyChanged,\n ...(impl.getNodeInstanceKeys ? { getNodeInstanceKeys: impl.getNodeInstanceKeys } : { /* c8 ignore next */ async *getNodeInstanceKeys() {} }),\n ...(impl.setFormatter ? { setFormatter: impl.setFormatter } : { /* c8 ignore next */ setFormatter() {} }),\n ...(impl.setHierarchySearch ? { setHierarchySearch: impl.setHierarchySearch } : { /* c8 ignore next */ setHierarchySearch() {} }),\n });\n}\n"]}
@@ -1,6 +1,8 @@
1
- import { NonGroupingHierarchyNode } from "./HierarchyNode.js";
2
- import { HierarchyNodeIdentifier, HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier.js";
3
- import { GenericNodeKey, HierarchyNodeKey, InstancesNodeKey } from "./HierarchyNodeKey.js";
1
+ import { HierarchyNodeIdentifier } from "./HierarchyNodeIdentifier.js";
2
+ import { HierarchyNodeKey } from "./HierarchyNodeKey.js";
3
+ import type { NonGroupingHierarchyNode } from "./HierarchyNode.js";
4
+ import type { HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier.js";
5
+ import type { GenericNodeKey, InstancesNodeKey } from "./HierarchyNodeKey.js";
4
6
  /** @public */
5
7
  export interface SearchPathRevealDepthInPath {
6
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchySearch.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/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