@itwin/presentation-frontend 3.7.0-dev.2 → 3.7.0-dev.5

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 (126) hide show
  1. package/CHANGELOG.md +13 -3
  2. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  3. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +47 -47
  4. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  5. package/lib/cjs/presentation-frontend/Diagnostics.d.ts +14 -14
  6. package/lib/cjs/presentation-frontend/Diagnostics.js +61 -61
  7. package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
  8. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  9. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +20 -20
  10. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
  11. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  12. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +41 -41
  13. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  14. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +10 -10
  15. package/lib/cjs/presentation-frontend/LocalizationHelper.js +31 -31
  16. package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
  17. package/lib/cjs/presentation-frontend/Presentation.d.ts +75 -75
  18. package/lib/cjs/presentation-frontend/Presentation.js +162 -162
  19. package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
  20. package/lib/cjs/presentation-frontend/PresentationManager.d.ts +186 -186
  21. package/lib/cjs/presentation-frontend/PresentationManager.js +436 -436
  22. package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
  23. package/lib/cjs/presentation-frontend/RulesetManager.d.ts +63 -63
  24. package/lib/cjs/presentation-frontend/RulesetManager.js +85 -85
  25. package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
  26. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  27. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +195 -195
  28. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  29. package/lib/cjs/presentation-frontend/StateTracker.d.ts +38 -38
  30. package/lib/cjs/presentation-frontend/StateTracker.js +129 -129
  31. package/lib/cjs/presentation-frontend/StateTracker.js.map +1 -1
  32. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  33. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  34. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +526 -525
  35. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  36. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  37. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +293 -293
  38. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  39. package/lib/cjs/presentation-frontend/selection/HiliteRules.json +172 -172
  40. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  41. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +97 -97
  42. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  43. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  44. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +9 -9
  45. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  46. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  47. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +33 -33
  48. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  49. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  50. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +108 -108
  51. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  52. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +14 -14
  53. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +37 -37
  54. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  55. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  56. package/lib/cjs/presentation-frontend/selection/SelectionManager.js +414 -414
  57. package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
  58. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  59. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +91 -91
  60. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  61. package/lib/cjs/presentation-frontend.d.ts +34 -34
  62. package/lib/cjs/presentation-frontend.js +50 -50
  63. package/lib/cjs/presentation-frontend.js.map +1 -1
  64. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  65. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +43 -43
  66. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  67. package/lib/esm/presentation-frontend/Diagnostics.d.ts +14 -14
  68. package/lib/esm/presentation-frontend/Diagnostics.js +56 -56
  69. package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
  70. package/lib/esm/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  71. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +17 -17
  72. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
  73. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  74. package/lib/esm/presentation-frontend/IpcRequestsHandler.js +37 -37
  75. package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  76. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +10 -10
  77. package/lib/esm/presentation-frontend/LocalizationHelper.js +27 -27
  78. package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
  79. package/lib/esm/presentation-frontend/Presentation.d.ts +75 -75
  80. package/lib/esm/presentation-frontend/Presentation.js +158 -158
  81. package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
  82. package/lib/esm/presentation-frontend/PresentationManager.d.ts +186 -186
  83. package/lib/esm/presentation-frontend/PresentationManager.js +431 -431
  84. package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
  85. package/lib/esm/presentation-frontend/RulesetManager.d.ts +63 -63
  86. package/lib/esm/presentation-frontend/RulesetManager.js +81 -81
  87. package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
  88. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  89. package/lib/esm/presentation-frontend/RulesetVariablesManager.js +191 -191
  90. package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  91. package/lib/esm/presentation-frontend/StateTracker.d.ts +38 -38
  92. package/lib/esm/presentation-frontend/StateTracker.js +125 -125
  93. package/lib/esm/presentation-frontend/StateTracker.js.map +1 -1
  94. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  95. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  96. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +520 -519
  97. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  98. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  99. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +285 -285
  100. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  101. package/lib/esm/presentation-frontend/selection/HiliteRules.json +172 -172
  102. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  103. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +93 -93
  104. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  105. package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  106. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +8 -8
  107. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  108. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  109. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +29 -29
  110. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  111. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  112. package/lib/esm/presentation-frontend/selection/SelectionHandler.js +104 -104
  113. package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  114. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +14 -14
  115. package/lib/esm/presentation-frontend/selection/SelectionHelper.js +33 -33
  116. package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  117. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  118. package/lib/esm/presentation-frontend/selection/SelectionManager.js +409 -409
  119. package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
  120. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  121. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +85 -85
  122. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  123. package/lib/esm/presentation-frontend.d.ts +34 -34
  124. package/lib/esm/presentation-frontend.js +38 -38
  125. package/lib/esm/presentation-frontend.js.map +1 -1
  126. package/package.json +14 -14
@@ -1,94 +1,94 @@
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
- /** @packageDocumentation
6
- * @module UnifiedSelection
7
- */
8
- import { ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, Key, KeySet, } from "@itwin/presentation-common";
9
- import { Presentation } from "../Presentation";
10
- import { TRANSIENT_ELEMENT_CLASSNAME } from "./SelectionManager";
11
- /** @internal */
12
- // eslint-disable-next-line @typescript-eslint/no-var-requires
13
- export const HILITE_RULESET = require("./HiliteRules.json");
14
- /**
15
- * Presentation-based provider which uses presentation ruleset to determine
16
- * what `HiliteSet` should be hilited in the graphics viewport based on the
17
- * supplied `KeySet`.
18
- *
19
- * @public
20
- */
21
- export class HiliteSetProvider {
22
- constructor(props) {
23
- this._imodel = props.imodel;
24
- }
25
- /**
26
- * Create a hilite set provider for the specified iModel.
27
- */
28
- static create(props) { return new HiliteSetProvider(props); }
29
- async getRecords(keys) {
30
- const descriptor = {
31
- displayType: DefaultContentDisplayTypes.Viewport,
32
- contentFlags: ContentFlags.KeysOnly,
33
- };
34
- const options = {
35
- imodel: this._imodel,
36
- rulesetOrId: HILITE_RULESET,
37
- descriptor,
38
- };
39
- const contentPromises = new Array();
40
- keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch) => {
41
- contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));
42
- });
43
- return (await Promise.all(contentPromises)).reduce((items, content) => {
44
- if (content)
45
- items.push(...content.contentSet);
46
- return items;
47
- }, new Array());
48
- }
49
- createHiliteSet(records, transientIds) {
50
- if (!records.length)
51
- return { elements: transientIds };
52
- const modelIds = new Array();
53
- const subCategoryIds = new Array();
54
- const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
55
- records.forEach((rec) => {
56
- const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
57
- rec.primaryKeys.forEach((pk) => ids.push(pk.id));
58
- });
59
- return {
60
- models: modelIds.length ? modelIds : undefined,
61
- subCategories: subCategoryIds.length ? subCategoryIds : undefined,
62
- elements: elementIds.length ? elementIds : undefined,
63
- };
64
- }
65
- /**
66
- * Get hilite set for instances and/or nodes whose keys are specified in the
67
- * given KeySet.
68
- *
69
- * Note: The provider caches result of the last request, so subsequent requests
70
- * for the same input doesn't cost.
71
- */
72
- async getHiliteSet(selection) {
73
- const selectionGuid = selection.guid;
74
- if (!this._cached || this._cached.keysGuid !== selectionGuid) {
75
- // need to create a new set without transients
76
- const transientIds = new Array();
77
- const keys = new KeySet();
78
- keys.add(selection, (key) => {
79
- if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {
80
- transientIds.push(key.id);
81
- return false;
82
- }
83
- return true;
84
- });
85
- const records = await this.getRecords(keys);
86
- const result = this.createHiliteSet(records, transientIds);
87
- this._cached = { keysGuid: selectionGuid, result };
88
- }
89
- return this._cached.result;
90
- }
91
- }
92
- const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
93
- const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
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
+ /** @packageDocumentation
6
+ * @module UnifiedSelection
7
+ */
8
+ import { ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, Key, KeySet, } from "@itwin/presentation-common";
9
+ import { Presentation } from "../Presentation";
10
+ import { TRANSIENT_ELEMENT_CLASSNAME } from "./SelectionManager";
11
+ /** @internal */
12
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
13
+ export const HILITE_RULESET = require("./HiliteRules.json");
14
+ /**
15
+ * Presentation-based provider which uses presentation ruleset to determine
16
+ * what `HiliteSet` should be hilited in the graphics viewport based on the
17
+ * supplied `KeySet`.
18
+ *
19
+ * @public
20
+ */
21
+ export class HiliteSetProvider {
22
+ constructor(props) {
23
+ this._imodel = props.imodel;
24
+ }
25
+ /**
26
+ * Create a hilite set provider for the specified iModel.
27
+ */
28
+ static create(props) { return new HiliteSetProvider(props); }
29
+ async getRecords(keys) {
30
+ const descriptor = {
31
+ displayType: DefaultContentDisplayTypes.Viewport,
32
+ contentFlags: ContentFlags.KeysOnly,
33
+ };
34
+ const options = {
35
+ imodel: this._imodel,
36
+ rulesetOrId: HILITE_RULESET,
37
+ descriptor,
38
+ };
39
+ const contentPromises = new Array();
40
+ keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch) => {
41
+ contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));
42
+ });
43
+ return (await Promise.all(contentPromises)).reduce((items, content) => {
44
+ if (content)
45
+ items.push(...content.contentSet);
46
+ return items;
47
+ }, new Array());
48
+ }
49
+ createHiliteSet(records, transientIds) {
50
+ if (!records.length)
51
+ return { elements: transientIds };
52
+ const modelIds = new Array();
53
+ const subCategoryIds = new Array();
54
+ const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
55
+ records.forEach((rec) => {
56
+ const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
57
+ rec.primaryKeys.forEach((pk) => ids.push(pk.id));
58
+ });
59
+ return {
60
+ models: modelIds.length ? modelIds : undefined,
61
+ subCategories: subCategoryIds.length ? subCategoryIds : undefined,
62
+ elements: elementIds.length ? elementIds : undefined,
63
+ };
64
+ }
65
+ /**
66
+ * Get hilite set for instances and/or nodes whose keys are specified in the
67
+ * given KeySet.
68
+ *
69
+ * Note: The provider caches result of the last request, so subsequent requests
70
+ * for the same input doesn't cost.
71
+ */
72
+ async getHiliteSet(selection) {
73
+ const selectionGuid = selection.guid;
74
+ if (!this._cached || this._cached.keysGuid !== selectionGuid) {
75
+ // need to create a new set without transients
76
+ const transientIds = new Array();
77
+ const keys = new KeySet();
78
+ keys.add(selection, (key) => {
79
+ if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {
80
+ transientIds.push(key.id);
81
+ return false;
82
+ }
83
+ return true;
84
+ });
85
+ const records = await this.getRecords(keys);
86
+ const result = this.createHiliteSet(records, transientIds);
87
+ this._cached = { keysGuid: selectionGuid, result };
88
+ }
89
+ return this._cached.result;
90
+ }
91
+ }
92
+ const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
93
+ const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
94
94
  //# sourceMappingURL=HiliteSetProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EACI,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAA6B,GAAG,EAAE,MAAM,GACnH,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,gBAAgB;AAChB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAsBrE;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IAI5B,YAAoB,KAA6B;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,KAA6B,IAAI,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpF,KAAK,CAAC,UAAU,CAAC,IAAY;QACnC,MAAM,UAAU,GAAwB;YACtC,WAAW,EAAE,0BAA0B,CAAC,QAAQ;YAChD,YAAY,EAAE,YAAY,CAAC,QAAQ;SACpC,CAAC;QACF,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,WAAW,EAAE,cAAc;YAC3B,UAAU;SACX,CAAC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E,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAEpF,MAAM,mBAAmB,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport {\n Content, ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"../Presentation\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\n\n/**\n * A set of model, subcategory and element ids that can be used for specifying\n * viewport hilite.\n *\n * @public\n */\nexport interface HiliteSet {\n models?: Id64String[];\n subCategories?: Id64String[];\n elements?: Id64String[];\n}\n\n/**\n * Properties for creating a `HiliteSetProvider` instance.\n * @public\n */\nexport interface HiliteSetProviderProps {\n imodel: IModelConnection;\n}\n\n/**\n * Presentation-based provider which uses presentation ruleset to determine\n * what `HiliteSet` should be hilited in the graphics viewport based on the\n * supplied `KeySet`.\n *\n * @public\n */\nexport class HiliteSetProvider {\n private _imodel: IModelConnection;\n private _cached: undefined | { keysGuid: string, result: HiliteSet };\n\n private constructor(props: HiliteSetProviderProps) {\n this._imodel = props.imodel;\n }\n\n /**\n * Create a hilite set provider for the specified iModel.\n */\n public static create(props: HiliteSetProviderProps) { return new HiliteSetProvider(props); }\n\n private async getRecords(keys: KeySet): Promise<Item[]> {\n const descriptor: DescriptorOverrides = {\n displayType: DefaultContentDisplayTypes.Viewport,\n contentFlags: ContentFlags.KeysOnly,\n };\n const options = {\n imodel: this._imodel,\n rulesetOrId: HILITE_RULESET,\n descriptor,\n };\n const contentPromises = new Array<Promise<Content | undefined>>();\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\n contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));\n });\n return (await Promise.all(contentPromises)).reduce((items, content) => {\n if (content)\n items.push(...content.contentSet);\n return items;\n }, new Array<Item>());\n }\n\n private createHiliteSet(records: Item[], transientIds: Id64String[]) {\n if (!records.length)\n return { elements: transientIds };\n\n const modelIds = new Array<Id64String>();\n const subCategoryIds = new Array<Id64String>();\n const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway\n records.forEach((rec) => {\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\n });\n return {\n models: modelIds.length ? modelIds : undefined,\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\n elements: elementIds.length ? elementIds : undefined,\n };\n }\n\n /**\n * Get hilite set for instances and/or nodes whose keys are specified in the\n * given KeySet.\n *\n * Note: The provider caches result of the last request, so subsequent requests\n * for the same input doesn't cost.\n */\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\n const selectionGuid = selection.guid;\n if (!this._cached || this._cached.keysGuid !== selectionGuid) {\n // need to create a new set without transients\n const transientIds = new Array<Id64String>();\n const keys = new KeySet();\n keys.add(selection, (key: Key) => {\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\n transientIds.push(key.id);\n return false;\n }\n return true;\n });\n const records = await this.getRecords(keys);\n const result = this.createHiliteSet(records, transientIds);\n this._cached = { keysGuid: selectionGuid, result };\n }\n return this._cached.result;\n }\n}\n\nconst isModelRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isModel);\n\nconst isSubCategoryRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isSubCategory);\n"]}
1
+ {"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EACI,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAA6B,GAAG,EAAE,MAAM,GACnH,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,gBAAgB;AAChB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAsBrE;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IAI5B,YAAoB,KAA6B;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,KAA6B,IAAI,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpF,KAAK,CAAC,UAAU,CAAC,IAAY;QACnC,MAAM,UAAU,GAAwB;YACtC,WAAW,EAAE,0BAA0B,CAAC,QAAQ;YAChD,YAAY,EAAE,YAAY,CAAC,QAAQ;SACpC,CAAC;QACF,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,WAAW,EAAE,cAAc;YAC3B,UAAU;SACX,CAAC;QACF,MAAM,eAAe,GAAG,IAAI,KAAK,EAAgC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,uBAAuB,EAAE,CAAC,KAAa,EAAE,EAAE;YAC3D,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CA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AAC,YAAY,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport {\r\n Content, ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset,\r\n} from \"@itwin/presentation-common\";\r\nimport { Presentation } from \"../Presentation\";\r\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\r\n\r\n/**\r\n * A set of model, subcategory and element ids that can be used for specifying\r\n * viewport hilite.\r\n *\r\n * @public\r\n */\r\nexport interface HiliteSet {\r\n models?: Id64String[];\r\n subCategories?: Id64String[];\r\n elements?: Id64String[];\r\n}\r\n\r\n/**\r\n * Properties for creating a `HiliteSetProvider` instance.\r\n * @public\r\n */\r\nexport interface HiliteSetProviderProps {\r\n imodel: IModelConnection;\r\n}\r\n\r\n/**\r\n * Presentation-based provider which uses presentation ruleset to determine\r\n * what `HiliteSet` should be hilited in the graphics viewport based on the\r\n * supplied `KeySet`.\r\n *\r\n * @public\r\n */\r\nexport class HiliteSetProvider {\r\n private _imodel: IModelConnection;\r\n private _cached: undefined | { keysGuid: string, result: HiliteSet };\r\n\r\n private constructor(props: HiliteSetProviderProps) {\r\n this._imodel = props.imodel;\r\n }\r\n\r\n /**\r\n * Create a hilite set provider for the specified iModel.\r\n */\r\n public static create(props: HiliteSetProviderProps) { return new HiliteSetProvider(props); }\r\n\r\n private async getRecords(keys: KeySet): Promise<Item[]> {\r\n const descriptor: DescriptorOverrides = {\r\n displayType: DefaultContentDisplayTypes.Viewport,\r\n contentFlags: ContentFlags.KeysOnly,\r\n };\r\n const options = {\r\n imodel: this._imodel,\r\n rulesetOrId: HILITE_RULESET,\r\n descriptor,\r\n };\r\n const contentPromises = new Array<Promise<Content | undefined>>();\r\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\r\n contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));\r\n });\r\n return (await Promise.all(contentPromises)).reduce((items, content) => {\r\n if (content)\r\n items.push(...content.contentSet);\r\n return items;\r\n }, new Array<Item>());\r\n }\r\n\r\n private createHiliteSet(records: Item[], transientIds: Id64String[]) {\r\n if (!records.length)\r\n return { elements: transientIds };\r\n\r\n const modelIds = new Array<Id64String>();\r\n const subCategoryIds = new Array<Id64String>();\r\n const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway\r\n records.forEach((rec) => {\r\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\r\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\r\n });\r\n return {\r\n models: modelIds.length ? modelIds : undefined,\r\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\r\n elements: elementIds.length ? elementIds : undefined,\r\n };\r\n }\r\n\r\n /**\r\n * Get hilite set for instances and/or nodes whose keys are specified in the\r\n * given KeySet.\r\n *\r\n * Note: The provider caches result of the last request, so subsequent requests\r\n * for the same input doesn't cost.\r\n */\r\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\r\n const selectionGuid = selection.guid;\r\n if (!this._cached || this._cached.keysGuid !== selectionGuid) {\r\n // need to create a new set without transients\r\n const transientIds = new Array<Id64String>();\r\n const keys = new KeySet();\r\n keys.add(selection, (key: Key) => {\r\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\r\n transientIds.push(key.id);\r\n return false;\r\n }\r\n return true;\r\n });\r\n const records = await this.getRecords(keys);\r\n const result = this.createHiliteSet(records, transientIds);\r\n this._cached = { keysGuid: selectionGuid, result };\r\n }\r\n return this._cached.result;\r\n }\r\n}\r\n\r\nconst isModelRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isModel);\r\n\r\nconst isSubCategoryRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isSubCategory);\r\n"]}
@@ -1,20 +1,20 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { IModelConnection } from "@itwin/core-frontend";
5
- import { KeySet } from "@itwin/presentation-common";
6
- import { SelectionChangeEvent } from "./SelectionChangeEvent";
7
- /**
8
- * Selection provider interface which provides main selection and sub-selection.
9
- * @public
10
- */
11
- export interface ISelectionProvider {
12
- /** An event that's fired when selection changes */
13
- selectionChange: SelectionChangeEvent;
14
- /** Get the selection stored in the provider.
15
- * @param imodel iModel connection which the selection is associated with.
16
- * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))
17
- */
18
- getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;
19
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { IModelConnection } from "@itwin/core-frontend";
5
+ import { KeySet } from "@itwin/presentation-common";
6
+ import { SelectionChangeEvent } from "./SelectionChangeEvent";
7
+ /**
8
+ * Selection provider interface which provides main selection and sub-selection.
9
+ * @public
10
+ */
11
+ export interface ISelectionProvider {
12
+ /** An event that's fired when selection changes */
13
+ selectionChange: SelectionChangeEvent;
14
+ /** Get the selection stored in the provider.
15
+ * @param imodel iModel connection which the selection is associated with.
16
+ * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))
17
+ */
18
+ getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;
19
+ }
20
20
  //# sourceMappingURL=ISelectionProvider.d.ts.map
@@ -1,9 +1,9 @@
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
- /** @packageDocumentation
6
- * @module UnifiedSelection
7
- */
8
- export {};
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
+ /** @packageDocumentation
6
+ * @module UnifiedSelection
7
+ */
8
+ export {};
9
9
  //# sourceMappingURL=ISelectionProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { SelectionChangeEvent } from \"./SelectionChangeEvent\";\n\n/**\n * Selection provider interface which provides main selection and sub-selection.\n * @public\n */\nexport interface ISelectionProvider {\n /** An event that's fired when selection changes */\n selectionChange: SelectionChangeEvent;\n\n /** Get the selection stored in the provider.\n * @param imodel iModel connection which the selection is associated with.\n * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))\n */\n getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;\n}\n"]}
1
+ {"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { KeySet } from \"@itwin/presentation-common\";\r\nimport { SelectionChangeEvent } from \"./SelectionChangeEvent\";\r\n\r\n/**\r\n * Selection provider interface which provides main selection and sub-selection.\r\n * @public\r\n */\r\nexport interface ISelectionProvider {\r\n /** An event that's fired when selection changes */\r\n selectionChange: SelectionChangeEvent;\r\n\r\n /** Get the selection stored in the provider.\r\n * @param imodel iModel connection which the selection is associated with.\r\n * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))\r\n */\r\n getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;\r\n}\r\n"]}
@@ -1,53 +1,53 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { BeEvent } from "@itwin/core-bentley";
5
- import { IModelConnection } from "@itwin/core-frontend";
6
- import { KeySet } from "@itwin/presentation-common";
7
- import { ISelectionProvider } from "./ISelectionProvider";
8
- /**
9
- * An interface for selection change listeners.
10
- * @public
11
- */
12
- export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
13
- /**
14
- * An event broadcasted on selection changes
15
- * @public
16
- */
17
- export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
18
- }
19
- /**
20
- * The type of selection change
21
- * @public
22
- */
23
- export declare enum SelectionChangeType {
24
- /** Added to selection. */
25
- Add = 0,
26
- /** Removed from selection. */
27
- Remove = 1,
28
- /** Selection was replaced. */
29
- Replace = 2,
30
- /** Selection was cleared. */
31
- Clear = 3
32
- }
33
- /**
34
- * The event object that's sent when the selection changes.
35
- * @public
36
- */
37
- export interface SelectionChangeEventArgs {
38
- /** The name of the selection source which caused the selection change. */
39
- source: string;
40
- /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
41
- level: number;
42
- /** The selection change type. */
43
- changeType: SelectionChangeType;
44
- /** Set of keys affected by this selection change event. */
45
- keys: Readonly<KeySet>;
46
- /** iModel connection with which the selection is associated with. */
47
- imodel: IModelConnection;
48
- /** The timestamp of when the selection change happened */
49
- timestamp: Date;
50
- /** Id of the ruleset associated with the selection change. */
51
- rulesetId?: string;
52
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { BeEvent } from "@itwin/core-bentley";
5
+ import { IModelConnection } from "@itwin/core-frontend";
6
+ import { KeySet } from "@itwin/presentation-common";
7
+ import { ISelectionProvider } from "./ISelectionProvider";
8
+ /**
9
+ * An interface for selection change listeners.
10
+ * @public
11
+ */
12
+ export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
13
+ /**
14
+ * An event broadcasted on selection changes
15
+ * @public
16
+ */
17
+ export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
18
+ }
19
+ /**
20
+ * The type of selection change
21
+ * @public
22
+ */
23
+ export declare enum SelectionChangeType {
24
+ /** Added to selection. */
25
+ Add = 0,
26
+ /** Removed from selection. */
27
+ Remove = 1,
28
+ /** Selection was replaced. */
29
+ Replace = 2,
30
+ /** Selection was cleared. */
31
+ Clear = 3
32
+ }
33
+ /**
34
+ * The event object that's sent when the selection changes.
35
+ * @public
36
+ */
37
+ export interface SelectionChangeEventArgs {
38
+ /** The name of the selection source which caused the selection change. */
39
+ source: string;
40
+ /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
41
+ level: number;
42
+ /** The selection change type. */
43
+ changeType: SelectionChangeType;
44
+ /** Set of keys affected by this selection change event. */
45
+ keys: Readonly<KeySet>;
46
+ /** iModel connection with which the selection is associated with. */
47
+ imodel: IModelConnection;
48
+ /** The timestamp of when the selection change happened */
49
+ timestamp: Date;
50
+ /** Id of the ruleset associated with the selection change. */
51
+ rulesetId?: string;
52
+ }
53
53
  //# sourceMappingURL=SelectionChangeEvent.d.ts.map
@@ -1,30 +1,30 @@
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
- /** @packageDocumentation
6
- * @module UnifiedSelection
7
- */
8
- import { BeEvent } from "@itwin/core-bentley";
9
- /**
10
- * An event broadcasted on selection changes
11
- * @public
12
- */
13
- export class SelectionChangeEvent extends BeEvent {
14
- }
15
- /**
16
- * The type of selection change
17
- * @public
18
- */
19
- export var SelectionChangeType;
20
- (function (SelectionChangeType) {
21
- /** Added to selection. */
22
- SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
23
- /** Removed from selection. */
24
- SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
25
- /** Selection was replaced. */
26
- SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
27
- /** Selection was cleared. */
28
- SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
29
- })(SelectionChangeType || (SelectionChangeType = {}));
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
+ /** @packageDocumentation
6
+ * @module UnifiedSelection
7
+ */
8
+ import { BeEvent } from "@itwin/core-bentley";
9
+ /**
10
+ * An event broadcasted on selection changes
11
+ * @public
12
+ */
13
+ export class SelectionChangeEvent extends BeEvent {
14
+ }
15
+ /**
16
+ * The type of selection change
17
+ * @public
18
+ */
19
+ export var SelectionChangeType;
20
+ (function (SelectionChangeType) {
21
+ /** Added to selection. */
22
+ SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
23
+ /** Removed from selection. */
24
+ SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
25
+ /** Selection was replaced. */
26
+ SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
27
+ /** Selection was cleared. */
28
+ SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
29
+ })(SelectionChangeType || (SelectionChangeType = {}));
30
30
  //# sourceMappingURL=SelectionChangeEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAW9C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAiC;CAAI;AAE/E;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,KAAnB,mBAAmB,QAY9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { ISelectionProvider } from \"./ISelectionProvider\";\n\n/**\n * An interface for selection change listeners.\n * @public\n */\nexport declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;\n\n/**\n * An event broadcasted on selection changes\n * @public\n */\nexport class SelectionChangeEvent extends BeEvent<SelectionChangesListener> { }\n\n/**\n * The type of selection change\n * @public\n */\nexport enum SelectionChangeType {\n /** Added to selection. */\n Add,\n\n /** Removed from selection. */\n Remove,\n\n /** Selection was replaced. */\n Replace,\n\n /** Selection was cleared. */\n Clear,\n}\n\n/**\n * The event object that's sent when the selection changes.\n * @public\n */\nexport interface SelectionChangeEventArgs {\n /** The name of the selection source which caused the selection change. */\n source: string;\n\n /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */\n level: number;\n\n /** The selection change type. */\n changeType: SelectionChangeType;\n\n /** Set of keys affected by this selection change event. */\n keys: Readonly<KeySet>;\n\n /** iModel connection with which the selection is associated with. */\n imodel: IModelConnection;\n\n /** The timestamp of when the selection change happened */\n timestamp: Date;\n\n /** Id of the ruleset associated with the selection change. */\n rulesetId?: string;\n}\n"]}
1
+ {"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAW9C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAiC;CAAI;AAE/E;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,KAAnB,mBAAmB,QAY9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { KeySet } from \"@itwin/presentation-common\";\r\nimport { ISelectionProvider } from \"./ISelectionProvider\";\r\n\r\n/**\r\n * An interface for selection change listeners.\r\n * @public\r\n */\r\nexport declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;\r\n\r\n/**\r\n * An event broadcasted on selection changes\r\n * @public\r\n */\r\nexport class SelectionChangeEvent extends BeEvent<SelectionChangesListener> { }\r\n\r\n/**\r\n * The type of selection change\r\n * @public\r\n */\r\nexport enum SelectionChangeType {\r\n /** Added to selection. */\r\n Add,\r\n\r\n /** Removed from selection. */\r\n Remove,\r\n\r\n /** Selection was replaced. */\r\n Replace,\r\n\r\n /** Selection was cleared. */\r\n Clear,\r\n}\r\n\r\n/**\r\n * The event object that's sent when the selection changes.\r\n * @public\r\n */\r\nexport interface SelectionChangeEventArgs {\r\n /** The name of the selection source which caused the selection change. */\r\n source: string;\r\n\r\n /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */\r\n level: number;\r\n\r\n /** The selection change type. */\r\n changeType: SelectionChangeType;\r\n\r\n /** Set of keys affected by this selection change event. */\r\n keys: Readonly<KeySet>;\r\n\r\n /** iModel connection with which the selection is associated with. */\r\n imodel: IModelConnection;\r\n\r\n /** The timestamp of when the selection change happened */\r\n timestamp: Date;\r\n\r\n /** Id of the ruleset associated with the selection change. */\r\n rulesetId?: string;\r\n}\r\n"]}