@itwin/presentation-frontend 4.0.0-dev.52 → 4.0.0-dev.55

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 (88) hide show
  1. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  2. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +47 -47
  3. package/lib/cjs/presentation-frontend/Diagnostics.d.ts +14 -14
  4. package/lib/cjs/presentation-frontend/Diagnostics.js +61 -61
  5. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  6. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +20 -20
  7. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  8. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +41 -41
  9. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +10 -10
  10. package/lib/cjs/presentation-frontend/LocalizationHelper.js +31 -31
  11. package/lib/cjs/presentation-frontend/Presentation.d.ts +73 -73
  12. package/lib/cjs/presentation-frontend/Presentation.js +159 -159
  13. package/lib/cjs/presentation-frontend/PresentationManager.d.ts +205 -205
  14. package/lib/cjs/presentation-frontend/PresentationManager.js +438 -438
  15. package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
  16. package/lib/cjs/presentation-frontend/RulesetManager.d.ts +63 -63
  17. package/lib/cjs/presentation-frontend/RulesetManager.js +85 -85
  18. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  19. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +195 -195
  20. package/lib/cjs/presentation-frontend/StateTracker.d.ts +38 -38
  21. package/lib/cjs/presentation-frontend/StateTracker.js +128 -128
  22. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  23. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  24. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +519 -519
  25. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  26. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  27. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +290 -290
  28. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  29. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +97 -97
  30. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  31. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +9 -9
  32. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  33. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +33 -33
  34. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  35. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +108 -108
  36. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +17 -17
  37. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +40 -40
  38. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  39. package/lib/cjs/presentation-frontend/selection/SelectionManager.js +414 -414
  40. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  41. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +91 -91
  42. package/lib/cjs/presentation-frontend.d.ts +34 -34
  43. package/lib/cjs/presentation-frontend.js +54 -50
  44. package/lib/cjs/presentation-frontend.js.map +1 -1
  45. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  46. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +43 -43
  47. package/lib/esm/presentation-frontend/Diagnostics.d.ts +14 -14
  48. package/lib/esm/presentation-frontend/Diagnostics.js +56 -56
  49. package/lib/esm/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  50. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +17 -17
  51. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  52. package/lib/esm/presentation-frontend/IpcRequestsHandler.js +37 -37
  53. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +10 -10
  54. package/lib/esm/presentation-frontend/LocalizationHelper.js +27 -27
  55. package/lib/esm/presentation-frontend/Presentation.d.ts +73 -73
  56. package/lib/esm/presentation-frontend/Presentation.js +155 -155
  57. package/lib/esm/presentation-frontend/PresentationManager.d.ts +205 -205
  58. package/lib/esm/presentation-frontend/PresentationManager.js +433 -433
  59. package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
  60. package/lib/esm/presentation-frontend/RulesetManager.d.ts +63 -63
  61. package/lib/esm/presentation-frontend/RulesetManager.js +81 -81
  62. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  63. package/lib/esm/presentation-frontend/RulesetVariablesManager.js +191 -191
  64. package/lib/esm/presentation-frontend/StateTracker.d.ts +38 -38
  65. package/lib/esm/presentation-frontend/StateTracker.js +124 -124
  66. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  67. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  68. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +514 -513
  69. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  70. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  71. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +282 -282
  72. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  73. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +93 -93
  74. package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  75. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +8 -8
  76. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  77. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +29 -29
  78. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  79. package/lib/esm/presentation-frontend/selection/SelectionHandler.js +104 -104
  80. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +17 -17
  81. package/lib/esm/presentation-frontend/selection/SelectionHelper.js +36 -36
  82. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  83. package/lib/esm/presentation-frontend/selection/SelectionManager.js +409 -409
  84. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  85. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +85 -85
  86. package/lib/esm/presentation-frontend.d.ts +34 -34
  87. package/lib/esm/presentation-frontend.js +38 -38
  88. package/package.json +15 -15
@@ -1,104 +1,104 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { IDisposable } from "@itwin/core-bentley";
5
- import { IModelConnection } from "@itwin/core-frontend";
6
- import { Keys, KeySet } from "@itwin/presentation-common";
7
- import { ISelectionProvider } from "./ISelectionProvider";
8
- import { SelectionChangeEventArgs, SelectionChangesListener } from "./SelectionChangeEvent";
9
- import { SelectionManager } from "./SelectionManager";
10
- /**
11
- * Properties for creating a `SelectionHandler` instance.
12
- * @public
13
- */
14
- export interface SelectionHandlerProps {
15
- /** SelectionManager used to store overall selection. */
16
- manager: SelectionManager;
17
- /** iModel connection the selection changes will be associated with. */
18
- imodel: IModelConnection;
19
- /**
20
- * Name of the selection handler. This is an identifier of what caused the
21
- * selection to change, set as `SelectionChangeEventArgs.source` when firing
22
- * selection change events. `SelectionHandler.shouldHandle` uses `name` to filter
23
- * events that it doesn't need to handle.
24
- */
25
- name: string;
26
- /**
27
- * ID of presentation ruleset used by the component using this handler. The ID is set as
28
- * `SelectionChangeEventArgs.rulesetId` when making selection changes and event
29
- * listeners can use or ignore this information.
30
- */
31
- rulesetId?: string;
32
- /** Callback function called when selection changes. */
33
- onSelect?: SelectionChangesListener;
34
- }
35
- /**
36
- * A class that handles selection changes and helps to change
37
- * internal the selection state.
38
- *
39
- * @public
40
- */
41
- export declare class SelectionHandler implements IDisposable {
42
- private _inSelect;
43
- private _disposables;
44
- /** Selection manager used by this handler to manage selection */
45
- readonly manager: SelectionManager;
46
- /** Name that's used as `SelectionChangeEventArgs.source` when making selection changes */
47
- name: string;
48
- /** iModel whose selection is being handled */
49
- imodel: IModelConnection;
50
- /**
51
- * Id of a ruleset selection changes will be associated with.
52
- * @see `SelectionHandlerProps.rulesetId`
53
- */
54
- rulesetId?: string;
55
- /** Callback function called when selection changes */
56
- onSelect?: SelectionChangesListener;
57
- /**
58
- * Constructor.
59
- */
60
- constructor(props: SelectionHandlerProps);
61
- /**
62
- * Destructor. Must be called before disposing this object to make sure it cleans
63
- * up correctly.
64
- */
65
- dispose(): void;
66
- /**
67
- * Called when the selection changes. Handles this callback by first checking whether
68
- * the event should be handled at all (using the `shouldHandle` method) and then calling `onSelect`
69
- */
70
- protected onSelectionChanged: (evt: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
71
- /** Called to check whether the event should be handled by this handler */
72
- protected shouldHandle(evt: SelectionChangeEventArgs): boolean;
73
- /** Get selection levels for the imodel managed by this handler */
74
- getSelectionLevels(): number[];
75
- /**
76
- * Get selection for the imodel managed by this handler.
77
- * @param level Level of the selection to get. Defaults to 0.
78
- */
79
- getSelection(level?: number): Readonly<KeySet>;
80
- /**
81
- * Add to selection.
82
- * @param keys The keys to add to selection.
83
- * @param level Level of the selection.
84
- */
85
- addToSelection(keys: Keys, level?: number): void;
86
- /**
87
- * Remove from selection.
88
- * @param keys The keys to remove from selection.
89
- * @param level Level of the selection.
90
- */
91
- removeFromSelection(keys: Keys, level?: number): void;
92
- /**
93
- * Change selection.
94
- * @param keys The keys indicating the new selection.
95
- * @param level Level of the selection.
96
- */
97
- replaceSelection(keys: Keys, level?: number): void;
98
- /**
99
- * Clear selection.
100
- * @param level Level of the selection.
101
- */
102
- clearSelection(level?: number): void;
103
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { IDisposable } from "@itwin/core-bentley";
5
+ import { IModelConnection } from "@itwin/core-frontend";
6
+ import { Keys, KeySet } from "@itwin/presentation-common";
7
+ import { ISelectionProvider } from "./ISelectionProvider";
8
+ import { SelectionChangeEventArgs, SelectionChangesListener } from "./SelectionChangeEvent";
9
+ import { SelectionManager } from "./SelectionManager";
10
+ /**
11
+ * Properties for creating a `SelectionHandler` instance.
12
+ * @public
13
+ */
14
+ export interface SelectionHandlerProps {
15
+ /** SelectionManager used to store overall selection. */
16
+ manager: SelectionManager;
17
+ /** iModel connection the selection changes will be associated with. */
18
+ imodel: IModelConnection;
19
+ /**
20
+ * Name of the selection handler. This is an identifier of what caused the
21
+ * selection to change, set as `SelectionChangeEventArgs.source` when firing
22
+ * selection change events. `SelectionHandler.shouldHandle` uses `name` to filter
23
+ * events that it doesn't need to handle.
24
+ */
25
+ name: string;
26
+ /**
27
+ * ID of presentation ruleset used by the component using this handler. The ID is set as
28
+ * `SelectionChangeEventArgs.rulesetId` when making selection changes and event
29
+ * listeners can use or ignore this information.
30
+ */
31
+ rulesetId?: string;
32
+ /** Callback function called when selection changes. */
33
+ onSelect?: SelectionChangesListener;
34
+ }
35
+ /**
36
+ * A class that handles selection changes and helps to change
37
+ * internal the selection state.
38
+ *
39
+ * @public
40
+ */
41
+ export declare class SelectionHandler implements IDisposable {
42
+ private _inSelect;
43
+ private _disposables;
44
+ /** Selection manager used by this handler to manage selection */
45
+ readonly manager: SelectionManager;
46
+ /** Name that's used as `SelectionChangeEventArgs.source` when making selection changes */
47
+ name: string;
48
+ /** iModel whose selection is being handled */
49
+ imodel: IModelConnection;
50
+ /**
51
+ * Id of a ruleset selection changes will be associated with.
52
+ * @see `SelectionHandlerProps.rulesetId`
53
+ */
54
+ rulesetId?: string;
55
+ /** Callback function called when selection changes */
56
+ onSelect?: SelectionChangesListener;
57
+ /**
58
+ * Constructor.
59
+ */
60
+ constructor(props: SelectionHandlerProps);
61
+ /**
62
+ * Destructor. Must be called before disposing this object to make sure it cleans
63
+ * up correctly.
64
+ */
65
+ dispose(): void;
66
+ /**
67
+ * Called when the selection changes. Handles this callback by first checking whether
68
+ * the event should be handled at all (using the `shouldHandle` method) and then calling `onSelect`
69
+ */
70
+ protected onSelectionChanged: (evt: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
71
+ /** Called to check whether the event should be handled by this handler */
72
+ protected shouldHandle(evt: SelectionChangeEventArgs): boolean;
73
+ /** Get selection levels for the imodel managed by this handler */
74
+ getSelectionLevels(): number[];
75
+ /**
76
+ * Get selection for the imodel managed by this handler.
77
+ * @param level Level of the selection to get. Defaults to 0.
78
+ */
79
+ getSelection(level?: number): Readonly<KeySet>;
80
+ /**
81
+ * Add to selection.
82
+ * @param keys The keys to add to selection.
83
+ * @param level Level of the selection.
84
+ */
85
+ addToSelection(keys: Keys, level?: number): void;
86
+ /**
87
+ * Remove from selection.
88
+ * @param keys The keys to remove from selection.
89
+ * @param level Level of the selection.
90
+ */
91
+ removeFromSelection(keys: Keys, level?: number): void;
92
+ /**
93
+ * Change selection.
94
+ * @param keys The keys indicating the new selection.
95
+ * @param level Level of the selection.
96
+ */
97
+ replaceSelection(keys: Keys, level?: number): void;
98
+ /**
99
+ * Clear selection.
100
+ * @param level Level of the selection.
101
+ */
102
+ clearSelection(level?: number): void;
103
+ }
104
104
  //# sourceMappingURL=SelectionHandler.d.ts.map
@@ -1,105 +1,105 @@
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 { DisposableList } from "@itwin/core-bentley";
9
- /**
10
- * A class that handles selection changes and helps to change
11
- * internal the selection state.
12
- *
13
- * @public
14
- */
15
- export class SelectionHandler {
16
- /**
17
- * Constructor.
18
- */
19
- constructor(props) {
20
- /**
21
- * Called when the selection changes. Handles this callback by first checking whether
22
- * the event should be handled at all (using the `shouldHandle` method) and then calling `onSelect`
23
- */
24
- // eslint-disable-next-line @typescript-eslint/naming-convention
25
- this.onSelectionChanged = (evt, provider) => {
26
- if (!this.onSelect || !this.shouldHandle(evt))
27
- return;
28
- this._inSelect = true;
29
- this.onSelect(evt, provider);
30
- this._inSelect = false;
31
- };
32
- this._inSelect = false;
33
- this.manager = props.manager;
34
- this._disposables = new DisposableList();
35
- this.name = props.name;
36
- this.rulesetId = props.rulesetId;
37
- this.imodel = props.imodel;
38
- this.onSelect = props.onSelect;
39
- this._disposables.add(this.manager.selectionChange.addListener(this.onSelectionChanged));
40
- }
41
- /**
42
- * Destructor. Must be called before disposing this object to make sure it cleans
43
- * up correctly.
44
- */
45
- dispose() {
46
- this._disposables.dispose();
47
- }
48
- /** Called to check whether the event should be handled by this handler */
49
- shouldHandle(evt) {
50
- if (this.name === evt.source)
51
- return false;
52
- return true;
53
- }
54
- /** Get selection levels for the imodel managed by this handler */
55
- getSelectionLevels() {
56
- return this.manager.getSelectionLevels(this.imodel);
57
- }
58
- /**
59
- * Get selection for the imodel managed by this handler.
60
- * @param level Level of the selection to get. Defaults to 0.
61
- */
62
- getSelection(level) {
63
- return this.manager.getSelection(this.imodel, level);
64
- }
65
- /**
66
- * Add to selection.
67
- * @param keys The keys to add to selection.
68
- * @param level Level of the selection.
69
- */
70
- addToSelection(keys, level = 0) {
71
- if (this._inSelect)
72
- return;
73
- return this.manager.addToSelection(this.name, this.imodel, keys, level, this.rulesetId);
74
- }
75
- /**
76
- * Remove from selection.
77
- * @param keys The keys to remove from selection.
78
- * @param level Level of the selection.
79
- */
80
- removeFromSelection(keys, level = 0) {
81
- if (this._inSelect)
82
- return;
83
- return this.manager.removeFromSelection(this.name, this.imodel, keys, level, this.rulesetId);
84
- }
85
- /**
86
- * Change selection.
87
- * @param keys The keys indicating the new selection.
88
- * @param level Level of the selection.
89
- */
90
- replaceSelection(keys, level = 0) {
91
- if (this._inSelect)
92
- return;
93
- return this.manager.replaceSelection(this.name, this.imodel, keys, level, this.rulesetId);
94
- }
95
- /**
96
- * Clear selection.
97
- * @param level Level of the selection.
98
- */
99
- clearSelection(level = 0) {
100
- if (this._inSelect)
101
- return;
102
- return this.manager.clearSelection(this.name, this.imodel, level, this.rulesetId);
103
- }
104
- }
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 { DisposableList } from "@itwin/core-bentley";
9
+ /**
10
+ * A class that handles selection changes and helps to change
11
+ * internal the selection state.
12
+ *
13
+ * @public
14
+ */
15
+ export class SelectionHandler {
16
+ /**
17
+ * Constructor.
18
+ */
19
+ constructor(props) {
20
+ /**
21
+ * Called when the selection changes. Handles this callback by first checking whether
22
+ * the event should be handled at all (using the `shouldHandle` method) and then calling `onSelect`
23
+ */
24
+ // eslint-disable-next-line @typescript-eslint/naming-convention
25
+ this.onSelectionChanged = (evt, provider) => {
26
+ if (!this.onSelect || !this.shouldHandle(evt))
27
+ return;
28
+ this._inSelect = true;
29
+ this.onSelect(evt, provider);
30
+ this._inSelect = false;
31
+ };
32
+ this._inSelect = false;
33
+ this.manager = props.manager;
34
+ this._disposables = new DisposableList();
35
+ this.name = props.name;
36
+ this.rulesetId = props.rulesetId;
37
+ this.imodel = props.imodel;
38
+ this.onSelect = props.onSelect;
39
+ this._disposables.add(this.manager.selectionChange.addListener(this.onSelectionChanged));
40
+ }
41
+ /**
42
+ * Destructor. Must be called before disposing this object to make sure it cleans
43
+ * up correctly.
44
+ */
45
+ dispose() {
46
+ this._disposables.dispose();
47
+ }
48
+ /** Called to check whether the event should be handled by this handler */
49
+ shouldHandle(evt) {
50
+ if (this.name === evt.source)
51
+ return false;
52
+ return true;
53
+ }
54
+ /** Get selection levels for the imodel managed by this handler */
55
+ getSelectionLevels() {
56
+ return this.manager.getSelectionLevels(this.imodel);
57
+ }
58
+ /**
59
+ * Get selection for the imodel managed by this handler.
60
+ * @param level Level of the selection to get. Defaults to 0.
61
+ */
62
+ getSelection(level) {
63
+ return this.manager.getSelection(this.imodel, level);
64
+ }
65
+ /**
66
+ * Add to selection.
67
+ * @param keys The keys to add to selection.
68
+ * @param level Level of the selection.
69
+ */
70
+ addToSelection(keys, level = 0) {
71
+ if (this._inSelect)
72
+ return;
73
+ return this.manager.addToSelection(this.name, this.imodel, keys, level, this.rulesetId);
74
+ }
75
+ /**
76
+ * Remove from selection.
77
+ * @param keys The keys to remove from selection.
78
+ * @param level Level of the selection.
79
+ */
80
+ removeFromSelection(keys, level = 0) {
81
+ if (this._inSelect)
82
+ return;
83
+ return this.manager.removeFromSelection(this.name, this.imodel, keys, level, this.rulesetId);
84
+ }
85
+ /**
86
+ * Change selection.
87
+ * @param keys The keys indicating the new selection.
88
+ * @param level Level of the selection.
89
+ */
90
+ replaceSelection(keys, level = 0) {
91
+ if (this._inSelect)
92
+ return;
93
+ return this.manager.replaceSelection(this.name, this.imodel, keys, level, this.rulesetId);
94
+ }
95
+ /**
96
+ * Clear selection.
97
+ * @param level Level of the selection.
98
+ */
99
+ clearSelection(level = 0) {
100
+ if (this._inSelect)
101
+ return;
102
+ return this.manager.clearSelection(this.name, this.imodel, level, this.rulesetId);
103
+ }
104
+ }
105
105
  //# sourceMappingURL=SelectionHandler.js.map
@@ -1,18 +1,18 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { Key, Keys } from "@itwin/presentation-common";
5
- /**
6
- * Helper class for working with selection.
7
- * @public
8
- */
9
- export declare class SelectionHelper {
10
- private constructor();
11
- /**
12
- * Re-map the given keyset for selection. This means all instance node keys get converted
13
- * to instance keys, because in that case we want to select instances instead of nodes. All
14
- * other types of keys ar left as is.
15
- */
16
- static getKeysForSelection(keys: Readonly<Keys>): Key[];
17
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { Key, Keys } from "@itwin/presentation-common";
5
+ /**
6
+ * Helper class for working with selection.
7
+ * @public
8
+ */
9
+ export declare class SelectionHelper {
10
+ private constructor();
11
+ /**
12
+ * Re-map the given keyset for selection. This means all instance node keys get converted
13
+ * to instance keys, because in that case we want to select instances instead of nodes. All
14
+ * other types of keys ar left as is.
15
+ */
16
+ static getKeysForSelection(keys: Readonly<Keys>): Key[];
17
+ }
18
18
  //# sourceMappingURL=SelectionHelper.d.ts.map
@@ -1,37 +1,37 @@
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 { Key, NodeKey } from "@itwin/presentation-common";
9
- /**
10
- * Helper class for working with selection.
11
- * @public
12
- */
13
- export class SelectionHelper {
14
- // istanbul ignore next
15
- constructor() { }
16
- /**
17
- * Re-map the given keyset for selection. This means all instance node keys get converted
18
- * to instance keys, because in that case we want to select instances instead of nodes. All
19
- * other types of keys ar left as is.
20
- */
21
- static getKeysForSelection(keys) {
22
- const result = new Array();
23
- keys.forEach((key) => {
24
- if (Key.isNodeKey(key)) {
25
- if (NodeKey.isInstancesNodeKey(key))
26
- result.push(...key.instanceKeys);
27
- else
28
- result.push(key);
29
- }
30
- else {
31
- result.push(key);
32
- }
33
- });
34
- return result;
35
- }
36
- }
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 { Key, NodeKey } from "@itwin/presentation-common";
9
+ /**
10
+ * Helper class for working with selection.
11
+ * @public
12
+ */
13
+ export class SelectionHelper {
14
+ // istanbul ignore next
15
+ constructor() { }
16
+ /**
17
+ * Re-map the given keyset for selection. This means all instance node keys get converted
18
+ * to instance keys, because in that case we want to select instances instead of nodes. All
19
+ * other types of keys ar left as is.
20
+ */
21
+ static getKeysForSelection(keys) {
22
+ const result = new Array();
23
+ keys.forEach((key) => {
24
+ if (Key.isNodeKey(key)) {
25
+ if (NodeKey.isInstancesNodeKey(key))
26
+ result.push(...key.instanceKeys);
27
+ else
28
+ result.push(key);
29
+ }
30
+ else {
31
+ result.push(key);
32
+ }
33
+ });
34
+ return result;
35
+ }
36
+ }
37
37
  //# sourceMappingURL=SelectionHelper.js.map