@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,53 +1,53 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { Id64String } from "@itwin/core-bentley";
5
- import { IModelConnection } from "@itwin/core-frontend";
6
- import { KeySet, Ruleset } from "@itwin/presentation-common";
7
- /** @internal */
8
- export declare const HILITE_RULESET: Ruleset;
9
- /**
10
- * A set of model, subcategory and element ids that can be used for specifying
11
- * viewport hilite.
12
- *
13
- * @public
14
- */
15
- export interface HiliteSet {
16
- models?: Id64String[];
17
- subCategories?: Id64String[];
18
- elements?: Id64String[];
19
- }
20
- /**
21
- * Properties for creating a `HiliteSetProvider` instance.
22
- * @public
23
- */
24
- export interface HiliteSetProviderProps {
25
- imodel: IModelConnection;
26
- }
27
- /**
28
- * Presentation-based provider which uses presentation ruleset to determine
29
- * what `HiliteSet` should be hilited in the graphics viewport based on the
30
- * supplied `KeySet`.
31
- *
32
- * @public
33
- */
34
- export declare class HiliteSetProvider {
35
- private _imodel;
36
- private _cached;
37
- private constructor();
38
- /**
39
- * Create a hilite set provider for the specified iModel.
40
- */
41
- static create(props: HiliteSetProviderProps): HiliteSetProvider;
42
- private getRecords;
43
- private createHiliteSet;
44
- /**
45
- * Get hilite set for instances and/or nodes whose keys are specified in the
46
- * given KeySet.
47
- *
48
- * Note: The provider caches result of the last request, so subsequent requests
49
- * for the same input doesn't cost.
50
- */
51
- getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet>;
52
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { Id64String } from "@itwin/core-bentley";
5
+ import { IModelConnection } from "@itwin/core-frontend";
6
+ import { KeySet, Ruleset } from "@itwin/presentation-common";
7
+ /** @internal */
8
+ export declare const HILITE_RULESET: Ruleset;
9
+ /**
10
+ * A set of model, subcategory and element ids that can be used for specifying
11
+ * viewport hilite.
12
+ *
13
+ * @public
14
+ */
15
+ export interface HiliteSet {
16
+ models?: Id64String[];
17
+ subCategories?: Id64String[];
18
+ elements?: Id64String[];
19
+ }
20
+ /**
21
+ * Properties for creating a `HiliteSetProvider` instance.
22
+ * @public
23
+ */
24
+ export interface HiliteSetProviderProps {
25
+ imodel: IModelConnection;
26
+ }
27
+ /**
28
+ * Presentation-based provider which uses presentation ruleset to determine
29
+ * what `HiliteSet` should be hilited in the graphics viewport based on the
30
+ * supplied `KeySet`.
31
+ *
32
+ * @public
33
+ */
34
+ export declare class HiliteSetProvider {
35
+ private _imodel;
36
+ private _cached;
37
+ private constructor();
38
+ /**
39
+ * Create a hilite set provider for the specified iModel.
40
+ */
41
+ static create(props: HiliteSetProviderProps): HiliteSetProvider;
42
+ private getRecords;
43
+ private createHiliteSet;
44
+ /**
45
+ * Get hilite set for instances and/or nodes whose keys are specified in the
46
+ * given KeySet.
47
+ *
48
+ * Note: The provider caches result of the last request, so subsequent requests
49
+ * for the same input doesn't cost.
50
+ */
51
+ getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet>;
52
+ }
53
53
  //# sourceMappingURL=HiliteSetProvider.d.ts.map
@@ -1,98 +1,98 @@
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.HiliteSetProvider = exports.HILITE_RULESET = void 0;
11
- const presentation_common_1 = require("@itwin/presentation-common");
12
- const Presentation_1 = require("../Presentation");
13
- const SelectionManager_1 = require("./SelectionManager");
14
- /** @internal */
15
- // eslint-disable-next-line @typescript-eslint/no-var-requires
16
- exports.HILITE_RULESET = require("./HiliteRules.json");
17
- /**
18
- * Presentation-based provider which uses presentation ruleset to determine
19
- * what `HiliteSet` should be hilited in the graphics viewport based on the
20
- * supplied `KeySet`.
21
- *
22
- * @public
23
- */
24
- class HiliteSetProvider {
25
- constructor(props) {
26
- this._imodel = props.imodel;
27
- }
28
- /**
29
- * Create a hilite set provider for the specified iModel.
30
- */
31
- static create(props) { return new HiliteSetProvider(props); }
32
- async getRecords(keys) {
33
- const descriptor = {
34
- displayType: presentation_common_1.DefaultContentDisplayTypes.Viewport,
35
- contentFlags: presentation_common_1.ContentFlags.KeysOnly,
36
- };
37
- const options = {
38
- imodel: this._imodel,
39
- rulesetOrId: exports.HILITE_RULESET,
40
- descriptor,
41
- };
42
- const contentPromises = new Array();
43
- keys.forEachBatch(presentation_common_1.DEFAULT_KEYS_BATCH_SIZE, (batch) => {
44
- contentPromises.push(Presentation_1.Presentation.presentation.getContent({ ...options, keys: batch }));
45
- });
46
- return (await Promise.all(contentPromises)).reduce((items, content) => {
47
- if (content)
48
- items.push(...content.contentSet);
49
- return items;
50
- }, new Array());
51
- }
52
- createHiliteSet(records, transientIds) {
53
- if (!records.length)
54
- return { elements: transientIds };
55
- const modelIds = new Array();
56
- const subCategoryIds = new Array();
57
- const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
58
- records.forEach((rec) => {
59
- const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
60
- rec.primaryKeys.forEach((pk) => ids.push(pk.id));
61
- });
62
- return {
63
- models: modelIds.length ? modelIds : undefined,
64
- subCategories: subCategoryIds.length ? subCategoryIds : undefined,
65
- elements: elementIds.length ? elementIds : undefined,
66
- };
67
- }
68
- /**
69
- * Get hilite set for instances and/or nodes whose keys are specified in the
70
- * given KeySet.
71
- *
72
- * Note: The provider caches result of the last request, so subsequent requests
73
- * for the same input doesn't cost.
74
- */
75
- async getHiliteSet(selection) {
76
- const selectionGuid = selection.guid;
77
- if (!this._cached || this._cached.keysGuid !== selectionGuid) {
78
- // need to create a new set without transients
79
- const transientIds = new Array();
80
- const keys = new presentation_common_1.KeySet();
81
- keys.add(selection, (key) => {
82
- if (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) {
83
- transientIds.push(key.id);
84
- return false;
85
- }
86
- return true;
87
- });
88
- const records = await this.getRecords(keys);
89
- const result = this.createHiliteSet(records, transientIds);
90
- this._cached = { keysGuid: selectionGuid, result };
91
- }
92
- return this._cached.result;
93
- }
94
- }
95
- exports.HiliteSetProvider = HiliteSetProvider;
96
- const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
97
- const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
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.HiliteSetProvider = exports.HILITE_RULESET = void 0;
11
+ const presentation_common_1 = require("@itwin/presentation-common");
12
+ const Presentation_1 = require("../Presentation");
13
+ const SelectionManager_1 = require("./SelectionManager");
14
+ /** @internal */
15
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ exports.HILITE_RULESET = require("./HiliteRules.json");
17
+ /**
18
+ * Presentation-based provider which uses presentation ruleset to determine
19
+ * what `HiliteSet` should be hilited in the graphics viewport based on the
20
+ * supplied `KeySet`.
21
+ *
22
+ * @public
23
+ */
24
+ class HiliteSetProvider {
25
+ constructor(props) {
26
+ this._imodel = props.imodel;
27
+ }
28
+ /**
29
+ * Create a hilite set provider for the specified iModel.
30
+ */
31
+ static create(props) { return new HiliteSetProvider(props); }
32
+ async getRecords(keys) {
33
+ const descriptor = {
34
+ displayType: presentation_common_1.DefaultContentDisplayTypes.Viewport,
35
+ contentFlags: presentation_common_1.ContentFlags.KeysOnly,
36
+ };
37
+ const options = {
38
+ imodel: this._imodel,
39
+ rulesetOrId: exports.HILITE_RULESET,
40
+ descriptor,
41
+ };
42
+ const contentPromises = new Array();
43
+ keys.forEachBatch(presentation_common_1.DEFAULT_KEYS_BATCH_SIZE, (batch) => {
44
+ contentPromises.push(Presentation_1.Presentation.presentation.getContent({ ...options, keys: batch }));
45
+ });
46
+ return (await Promise.all(contentPromises)).reduce((items, content) => {
47
+ if (content)
48
+ items.push(...content.contentSet);
49
+ return items;
50
+ }, new Array());
51
+ }
52
+ createHiliteSet(records, transientIds) {
53
+ if (!records.length)
54
+ return { elements: transientIds };
55
+ const modelIds = new Array();
56
+ const subCategoryIds = new Array();
57
+ const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
58
+ records.forEach((rec) => {
59
+ const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
60
+ rec.primaryKeys.forEach((pk) => ids.push(pk.id));
61
+ });
62
+ return {
63
+ models: modelIds.length ? modelIds : undefined,
64
+ subCategories: subCategoryIds.length ? subCategoryIds : undefined,
65
+ elements: elementIds.length ? elementIds : undefined,
66
+ };
67
+ }
68
+ /**
69
+ * Get hilite set for instances and/or nodes whose keys are specified in the
70
+ * given KeySet.
71
+ *
72
+ * Note: The provider caches result of the last request, so subsequent requests
73
+ * for the same input doesn't cost.
74
+ */
75
+ async getHiliteSet(selection) {
76
+ const selectionGuid = selection.guid;
77
+ if (!this._cached || this._cached.keysGuid !== selectionGuid) {
78
+ // need to create a new set without transients
79
+ const transientIds = new Array();
80
+ const keys = new presentation_common_1.KeySet();
81
+ keys.add(selection, (key) => {
82
+ if (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) {
83
+ transientIds.push(key.id);
84
+ return false;
85
+ }
86
+ return true;
87
+ });
88
+ const records = await this.getRecords(keys);
89
+ const result = this.createHiliteSet(records, transientIds);
90
+ this._cached = { keysGuid: selectionGuid, result };
91
+ }
92
+ return this._cached.result;
93
+ }
94
+ }
95
+ exports.HiliteSetProvider = HiliteSetProvider;
96
+ const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
97
+ const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
98
98
  //# sourceMappingURL=HiliteSetProvider.js.map
@@ -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,10 +1,10 @@
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 });
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
10
  //# sourceMappingURL=ISelectionProvider.js.map
@@ -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,34 +1,34 @@
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.SelectionChangeType = exports.SelectionChangeEvent = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- /**
13
- * An event broadcasted on selection changes
14
- * @public
15
- */
16
- class SelectionChangeEvent extends core_bentley_1.BeEvent {
17
- }
18
- exports.SelectionChangeEvent = SelectionChangeEvent;
19
- /**
20
- * The type of selection change
21
- * @public
22
- */
23
- var SelectionChangeType;
24
- (function (SelectionChangeType) {
25
- /** Added to selection. */
26
- SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
27
- /** Removed from selection. */
28
- SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
29
- /** Selection was replaced. */
30
- SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
31
- /** Selection was cleared. */
32
- SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
33
- })(SelectionChangeType = exports.SelectionChangeType || (exports.SelectionChangeType = {}));
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.SelectionChangeType = exports.SelectionChangeEvent = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ /**
13
+ * An event broadcasted on selection changes
14
+ * @public
15
+ */
16
+ class SelectionChangeEvent extends core_bentley_1.BeEvent {
17
+ }
18
+ exports.SelectionChangeEvent = SelectionChangeEvent;
19
+ /**
20
+ * The type of selection change
21
+ * @public
22
+ */
23
+ var SelectionChangeType;
24
+ (function (SelectionChangeType) {
25
+ /** Added to selection. */
26
+ SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
27
+ /** Removed from selection. */
28
+ SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
29
+ /** Selection was replaced. */
30
+ SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
31
+ /** Selection was cleared. */
32
+ SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
33
+ })(SelectionChangeType = exports.SelectionChangeType || (exports.SelectionChangeType = {}));
34
34
  //# sourceMappingURL=SelectionChangeEvent.js.map