@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,109 +1,109 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module UnifiedSelection
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SelectionHandler = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- /**
13
- * A class that handles selection changes and helps to change
14
- * internal the selection state.
15
- *
16
- * @public
17
- */
18
- class SelectionHandler {
19
- /**
20
- * Constructor.
21
- */
22
- constructor(props) {
23
- /**
24
- * Called when the selection changes. Handles this callback by first checking whether
25
- * the event should be handled at all (using the `shouldHandle` method) and then calling `onSelect`
26
- */
27
- // eslint-disable-next-line @typescript-eslint/naming-convention
28
- this.onSelectionChanged = (evt, provider) => {
29
- if (!this.onSelect || !this.shouldHandle(evt))
30
- return;
31
- this._inSelect = true;
32
- this.onSelect(evt, provider);
33
- this._inSelect = false;
34
- };
35
- this._inSelect = false;
36
- this.manager = props.manager;
37
- this._disposables = new core_bentley_1.DisposableList();
38
- this.name = props.name;
39
- this.rulesetId = props.rulesetId;
40
- this.imodel = props.imodel;
41
- this.onSelect = props.onSelect;
42
- this._disposables.add(this.manager.selectionChange.addListener(this.onSelectionChanged));
43
- }
44
- /**
45
- * Destructor. Must be called before disposing this object to make sure it cleans
46
- * up correctly.
47
- */
48
- dispose() {
49
- this._disposables.dispose();
50
- }
51
- /** Called to check whether the event should be handled by this handler */
52
- shouldHandle(evt) {
53
- if (this.name === evt.source)
54
- return false;
55
- return true;
56
- }
57
- /** Get selection levels for the imodel managed by this handler */
58
- getSelectionLevels() {
59
- return this.manager.getSelectionLevels(this.imodel);
60
- }
61
- /**
62
- * Get selection for the imodel managed by this handler.
63
- * @param level Level of the selection to get. Defaults to 0.
64
- */
65
- getSelection(level) {
66
- return this.manager.getSelection(this.imodel, level);
67
- }
68
- /**
69
- * Add to selection.
70
- * @param keys The keys to add to selection.
71
- * @param level Level of the selection.
72
- */
73
- addToSelection(keys, level = 0) {
74
- if (this._inSelect)
75
- return;
76
- return this.manager.addToSelection(this.name, this.imodel, keys, level, this.rulesetId);
77
- }
78
- /**
79
- * Remove from selection.
80
- * @param keys The keys to remove from selection.
81
- * @param level Level of the selection.
82
- */
83
- removeFromSelection(keys, level = 0) {
84
- if (this._inSelect)
85
- return;
86
- return this.manager.removeFromSelection(this.name, this.imodel, keys, level, this.rulesetId);
87
- }
88
- /**
89
- * Change selection.
90
- * @param keys The keys indicating the new selection.
91
- * @param level Level of the selection.
92
- */
93
- replaceSelection(keys, level = 0) {
94
- if (this._inSelect)
95
- return;
96
- return this.manager.replaceSelection(this.name, this.imodel, keys, level, this.rulesetId);
97
- }
98
- /**
99
- * Clear selection.
100
- * @param level Level of the selection.
101
- */
102
- clearSelection(level = 0) {
103
- if (this._inSelect)
104
- return;
105
- return this.manager.clearSelection(this.name, this.imodel, level, this.rulesetId);
106
- }
107
- }
108
- exports.SelectionHandler = SelectionHandler;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module UnifiedSelection
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SelectionHandler = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ /**
13
+ * A class that handles selection changes and helps to change
14
+ * internal the selection state.
15
+ *
16
+ * @public
17
+ */
18
+ class SelectionHandler {
19
+ /**
20
+ * Constructor.
21
+ */
22
+ constructor(props) {
23
+ /**
24
+ * Called when the selection changes. Handles this callback by first checking whether
25
+ * the event should be handled at all (using the `shouldHandle` method) and then calling `onSelect`
26
+ */
27
+ // eslint-disable-next-line @typescript-eslint/naming-convention
28
+ this.onSelectionChanged = (evt, provider) => {
29
+ if (!this.onSelect || !this.shouldHandle(evt))
30
+ return;
31
+ this._inSelect = true;
32
+ this.onSelect(evt, provider);
33
+ this._inSelect = false;
34
+ };
35
+ this._inSelect = false;
36
+ this.manager = props.manager;
37
+ this._disposables = new core_bentley_1.DisposableList();
38
+ this.name = props.name;
39
+ this.rulesetId = props.rulesetId;
40
+ this.imodel = props.imodel;
41
+ this.onSelect = props.onSelect;
42
+ this._disposables.add(this.manager.selectionChange.addListener(this.onSelectionChanged));
43
+ }
44
+ /**
45
+ * Destructor. Must be called before disposing this object to make sure it cleans
46
+ * up correctly.
47
+ */
48
+ dispose() {
49
+ this._disposables.dispose();
50
+ }
51
+ /** Called to check whether the event should be handled by this handler */
52
+ shouldHandle(evt) {
53
+ if (this.name === evt.source)
54
+ return false;
55
+ return true;
56
+ }
57
+ /** Get selection levels for the imodel managed by this handler */
58
+ getSelectionLevels() {
59
+ return this.manager.getSelectionLevels(this.imodel);
60
+ }
61
+ /**
62
+ * Get selection for the imodel managed by this handler.
63
+ * @param level Level of the selection to get. Defaults to 0.
64
+ */
65
+ getSelection(level) {
66
+ return this.manager.getSelection(this.imodel, level);
67
+ }
68
+ /**
69
+ * Add to selection.
70
+ * @param keys The keys to add to selection.
71
+ * @param level Level of the selection.
72
+ */
73
+ addToSelection(keys, level = 0) {
74
+ if (this._inSelect)
75
+ return;
76
+ return this.manager.addToSelection(this.name, this.imodel, keys, level, this.rulesetId);
77
+ }
78
+ /**
79
+ * Remove from selection.
80
+ * @param keys The keys to remove from selection.
81
+ * @param level Level of the selection.
82
+ */
83
+ removeFromSelection(keys, level = 0) {
84
+ if (this._inSelect)
85
+ return;
86
+ return this.manager.removeFromSelection(this.name, this.imodel, keys, level, this.rulesetId);
87
+ }
88
+ /**
89
+ * Change selection.
90
+ * @param keys The keys indicating the new selection.
91
+ * @param level Level of the selection.
92
+ */
93
+ replaceSelection(keys, level = 0) {
94
+ if (this._inSelect)
95
+ return;
96
+ return this.manager.replaceSelection(this.name, this.imodel, keys, level, this.rulesetId);
97
+ }
98
+ /**
99
+ * Clear selection.
100
+ * @param level Level of the selection.
101
+ */
102
+ clearSelection(level = 0) {
103
+ if (this._inSelect)
104
+ return;
105
+ return this.manager.clearSelection(this.name, this.imodel, level, this.rulesetId);
106
+ }
107
+ }
108
+ exports.SelectionHandler = SelectionHandler;
109
109
  //# 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,41 +1,41 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module UnifiedSelection
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SelectionHelper = void 0;
11
- const presentation_common_1 = require("@itwin/presentation-common");
12
- /**
13
- * Helper class for working with selection.
14
- * @public
15
- */
16
- class SelectionHelper {
17
- // istanbul ignore next
18
- constructor() { }
19
- /**
20
- * Re-map the given keyset for selection. This means all instance node keys get converted
21
- * to instance keys, because in that case we want to select instances instead of nodes. All
22
- * other types of keys ar left as is.
23
- */
24
- static getKeysForSelection(keys) {
25
- const result = new Array();
26
- keys.forEach((key) => {
27
- if (presentation_common_1.Key.isNodeKey(key)) {
28
- if (presentation_common_1.NodeKey.isInstancesNodeKey(key))
29
- result.push(...key.instanceKeys);
30
- else
31
- result.push(key);
32
- }
33
- else {
34
- result.push(key);
35
- }
36
- });
37
- return result;
38
- }
39
- }
40
- exports.SelectionHelper = SelectionHelper;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module UnifiedSelection
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SelectionHelper = void 0;
11
+ const presentation_common_1 = require("@itwin/presentation-common");
12
+ /**
13
+ * Helper class for working with selection.
14
+ * @public
15
+ */
16
+ class SelectionHelper {
17
+ // istanbul ignore next
18
+ constructor() { }
19
+ /**
20
+ * Re-map the given keyset for selection. This means all instance node keys get converted
21
+ * to instance keys, because in that case we want to select instances instead of nodes. All
22
+ * other types of keys ar left as is.
23
+ */
24
+ static getKeysForSelection(keys) {
25
+ const result = new Array();
26
+ keys.forEach((key) => {
27
+ if (presentation_common_1.Key.isNodeKey(key)) {
28
+ if (presentation_common_1.NodeKey.isInstancesNodeKey(key))
29
+ result.push(...key.instanceKeys);
30
+ else
31
+ result.push(key);
32
+ }
33
+ else {
34
+ result.push(key);
35
+ }
36
+ });
37
+ return result;
38
+ }
39
+ }
40
+ exports.SelectionHelper = SelectionHelper;
41
41
  //# sourceMappingURL=SelectionHelper.js.map