@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,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,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,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