@itwin/unified-selection 0.2.0 → 0.4.0

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 (94) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/README.md +34 -14
  3. package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts +3 -7
  4. package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -1
  5. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js +14 -17
  6. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js.map +1 -1
  7. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts +91 -0
  8. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +1 -0
  9. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js +205 -0
  10. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +1 -0
  11. package/lib/cjs/unified-selection/HiliteSetProvider.d.ts +2 -4
  12. package/lib/cjs/unified-selection/HiliteSetProvider.d.ts.map +1 -1
  13. package/lib/cjs/unified-selection/HiliteSetProvider.js +174 -131
  14. package/lib/cjs/unified-selection/HiliteSetProvider.js.map +1 -1
  15. package/lib/cjs/unified-selection/Selectable.d.ts +0 -3
  16. package/lib/cjs/unified-selection/Selectable.d.ts.map +1 -1
  17. package/lib/cjs/unified-selection/Selectable.js +2 -2
  18. package/lib/cjs/unified-selection/Selectable.js.map +1 -1
  19. package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts +5 -3
  20. package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts.map +1 -1
  21. package/lib/cjs/unified-selection/SelectionChangeEvent.js.map +1 -1
  22. package/lib/cjs/unified-selection/SelectionScope.d.ts +2 -2
  23. package/lib/cjs/unified-selection/SelectionScope.d.ts.map +1 -1
  24. package/lib/cjs/unified-selection/SelectionScope.js +87 -54
  25. package/lib/cjs/unified-selection/SelectionScope.js.map +1 -1
  26. package/lib/cjs/unified-selection/SelectionStorage.d.ts +20 -28
  27. package/lib/cjs/unified-selection/SelectionStorage.d.ts.map +1 -1
  28. package/lib/cjs/unified-selection/SelectionStorage.js +21 -18
  29. package/lib/cjs/unified-selection/SelectionStorage.js.map +1 -1
  30. package/lib/cjs/unified-selection/Utils.d.ts +7 -0
  31. package/lib/cjs/unified-selection/Utils.d.ts.map +1 -0
  32. package/lib/cjs/unified-selection/{queries/ECSqlCore.js → Utils.js} +2 -1
  33. package/lib/cjs/unified-selection/Utils.js.map +1 -0
  34. package/lib/cjs/unified-selection/types/IModel.d.ts +84 -0
  35. package/lib/cjs/unified-selection/types/IModel.d.ts.map +1 -0
  36. package/lib/cjs/unified-selection/types/IModel.js +24 -0
  37. package/lib/cjs/unified-selection/types/IModel.js.map +1 -0
  38. package/lib/cjs/unified-selection.d.ts +1 -6
  39. package/lib/cjs/unified-selection.d.ts.map +1 -1
  40. package/lib/cjs/unified-selection.js +3 -7
  41. package/lib/cjs/unified-selection.js.map +1 -1
  42. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts +3 -7
  43. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -1
  44. package/lib/esm/unified-selection/CachingHiliteSetProvider.js +14 -17
  45. package/lib/esm/unified-selection/CachingHiliteSetProvider.js.map +1 -1
  46. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts +91 -0
  47. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +1 -0
  48. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.js +200 -0
  49. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +1 -0
  50. package/lib/esm/unified-selection/HiliteSetProvider.d.ts +2 -4
  51. package/lib/esm/unified-selection/HiliteSetProvider.d.ts.map +1 -1
  52. package/lib/esm/unified-selection/HiliteSetProvider.js +174 -131
  53. package/lib/esm/unified-selection/HiliteSetProvider.js.map +1 -1
  54. package/lib/esm/unified-selection/Selectable.d.ts +0 -3
  55. package/lib/esm/unified-selection/Selectable.d.ts.map +1 -1
  56. package/lib/esm/unified-selection/Selectable.js.map +1 -1
  57. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts +5 -3
  58. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts.map +1 -1
  59. package/lib/esm/unified-selection/SelectionChangeEvent.js.map +1 -1
  60. package/lib/esm/unified-selection/SelectionScope.d.ts +2 -2
  61. package/lib/esm/unified-selection/SelectionScope.d.ts.map +1 -1
  62. package/lib/esm/unified-selection/SelectionScope.js +84 -51
  63. package/lib/esm/unified-selection/SelectionScope.js.map +1 -1
  64. package/lib/esm/unified-selection/SelectionStorage.d.ts +20 -28
  65. package/lib/esm/unified-selection/SelectionStorage.d.ts.map +1 -1
  66. package/lib/esm/unified-selection/SelectionStorage.js +21 -18
  67. package/lib/esm/unified-selection/SelectionStorage.js.map +1 -1
  68. package/lib/esm/unified-selection/Utils.d.ts +7 -0
  69. package/lib/esm/unified-selection/Utils.d.ts.map +1 -0
  70. package/lib/esm/unified-selection/{queries/ECSqlCore.js → Utils.js} +2 -1
  71. package/lib/esm/unified-selection/Utils.js.map +1 -0
  72. package/lib/esm/unified-selection/types/IModel.d.ts +84 -0
  73. package/lib/esm/unified-selection/types/IModel.d.ts.map +1 -0
  74. package/lib/esm/unified-selection/types/IModel.js +21 -0
  75. package/lib/esm/unified-selection/types/IModel.js.map +1 -0
  76. package/lib/esm/unified-selection.d.ts +1 -6
  77. package/lib/esm/unified-selection.d.ts.map +1 -1
  78. package/lib/esm/unified-selection.js +1 -6
  79. package/lib/esm/unified-selection.js.map +1 -1
  80. package/package.json +23 -16
  81. package/lib/cjs/unified-selection/queries/ECMetadata.d.ts +0 -44
  82. package/lib/cjs/unified-selection/queries/ECMetadata.d.ts.map +0 -1
  83. package/lib/cjs/unified-selection/queries/ECMetadata.js +0 -17
  84. package/lib/cjs/unified-selection/queries/ECMetadata.js.map +0 -1
  85. package/lib/cjs/unified-selection/queries/ECSqlCore.d.ts +0 -69
  86. package/lib/cjs/unified-selection/queries/ECSqlCore.d.ts.map +0 -1
  87. package/lib/cjs/unified-selection/queries/ECSqlCore.js.map +0 -1
  88. package/lib/esm/unified-selection/queries/ECMetadata.d.ts +0 -44
  89. package/lib/esm/unified-selection/queries/ECMetadata.d.ts.map +0 -1
  90. package/lib/esm/unified-selection/queries/ECMetadata.js +0 -13
  91. package/lib/esm/unified-selection/queries/ECMetadata.js.map +0 -1
  92. package/lib/esm/unified-selection/queries/ECSqlCore.d.ts +0 -69
  93. package/lib/esm/unified-selection/queries/ECSqlCore.d.ts.map +0 -1
  94. package/lib/esm/unified-selection/queries/ECSqlCore.js.map +0 -1
@@ -0,0 +1,84 @@
1
+ import { Id64Arg } from "@itwin/core-bentley";
2
+ import { Event } from "@itwin/presentation-shared";
3
+ /**
4
+ * Identifies the type of changes made to the `CoreIModelSelectionSet` to produce a `CoreSelectionSetEvent`.
5
+ * @see https://www.itwinjs.org/reference/core-frontend/selectionset/selectionseteventtype/
6
+ * @internal
7
+ */
8
+ export declare enum CoreSelectionSetEventType {
9
+ /** Elements have been added to the set. */
10
+ Add = 0,
11
+ /** Elements have been removed from the set. */
12
+ Remove = 1,
13
+ /** Some elements have been added to the set and others have been removed. */
14
+ Replace = 2,
15
+ /** All elements are about to be removed from the set. */
16
+ Clear = 3
17
+ }
18
+ /**
19
+ * Payload sent to `CoreIModelSelectionSet.onChanged` event listeners to describe how the contents of the set have changed.
20
+ * @see https://www.itwinjs.org/reference/core-frontend/selectionset/selectionsetevent/
21
+ * @internal
22
+ */
23
+ export interface CoreSelectionSetEventUnsafe {
24
+ /**
25
+ * The type of operation that produced this event.
26
+ *
27
+ * Actually, this should be `CoreSelectionSetEventType`, however we can't use it here because in TS two identical enums with
28
+ * different names aren't equal, so [`SelectionSetEventType `](https://www.itwinjs.org/reference/core-frontend/selectionset/selectionseteventtype/)
29
+ * doesn't map to `CoreSelectionSetEventType` as far as TS is concerned. Due to this reason, this interface is marked as `unsafe`.
30
+ */
31
+ type: number;
32
+ /** The element Ids added to the set. */
33
+ added?: Id64Arg;
34
+ /** The element Ids removed from the set. */
35
+ removed?: Id64Arg;
36
+ /** The affected `CoreIModelSelectionSet`. */
37
+ set: CoreIModelSelectionSet;
38
+ }
39
+ /**
40
+ * A set of *currently selected* elements in an iModel.
41
+ * @see https://www.itwinjs.org/reference/core-frontend/selectionset/
42
+ * @internal
43
+ */
44
+ export interface CoreIModelSelectionSet {
45
+ /** Event called whenever elements are added or removed from this SelectionSet. */
46
+ onChanged: Event<(ev: CoreSelectionSetEventUnsafe) => void>;
47
+ /** The IDs of the selected elements. */
48
+ readonly elements: Set<string>;
49
+ /** Clear current selection set. */
50
+ emptyAll(): void;
51
+ /** Add one or more Ids to the current selection set. */
52
+ add(elem: Id64Arg): boolean;
53
+ /** Remove one or more Ids from the current selection set. */
54
+ remove(elem: Id64Arg): boolean;
55
+ }
56
+ /**
57
+ * A set if ID's optimized for performance-critical code which represents large sets of ID's as pairs of 32-bit integers.
58
+ * @see https://www.itwinjs.org/reference/core-bentley/ids/id64/id64.uint32set/
59
+ */
60
+ interface Uint32Set {
61
+ /** Add any number of Ids to the set. */
62
+ addIds(ids: Id64Arg): void;
63
+ /** Remove any number of Ids from the set. */
64
+ deleteIds(ids: Id64Arg): void;
65
+ }
66
+ /**
67
+ * A set of *hilited* elements in an iModel, by element id.
68
+ * @see https://www.itwinjs.org/reference/core-frontend/selectionset/hiliteset/
69
+ * @internal
70
+ */
71
+ export interface CoreIModelHiliteSet {
72
+ /** Control whether the hilited elements should be synchronized with the contents of `CoreIModelSelectionSet`.*/
73
+ wantSyncWithSelectionSet: boolean;
74
+ /** The set of hilited elements. */
75
+ readonly elements: Uint32Set;
76
+ /** The set of hilited subcategories. */
77
+ readonly subcategories: Uint32Set;
78
+ /** The set of hilited models. */
79
+ readonly models: Uint32Set;
80
+ /** Remove all elements from the hilited set. */
81
+ clear(): void;
82
+ }
83
+ export {};
84
+ //# sourceMappingURL=IModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IModel.d.ts","sourceRoot":"","sources":["../../../../src/unified-selection/types/IModel.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;;;GAIG;AACH,oBAAY,yBAAyB;IACnC,2CAA2C;IAC3C,GAAG,IAAA;IACH,+CAA+C;IAC/C,MAAM,IAAA;IACN,6EAA6E;IAC7E,OAAO,IAAA;IACP,yDAAyD;IACzD,KAAK,IAAA;CACN;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,GAAG,EAAE,sBAAsB,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,SAAS,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,2BAA2B,KAAK,IAAI,CAAC,CAAC;IAC5D,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,mCAAmC;IACnC,QAAQ,IAAI,IAAI,CAAC;IACjB,wDAAwD;IACxD,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,6DAA6D;IAC7D,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;CAChC;AAED;;;GAGG;AACH,UAAU,SAAS;IACjB,wCAAwC;IACxC,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,6CAA6C;IAC7C,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,gHAAgH;IAChH,wBAAwB,EAAE,OAAO,CAAC;IAClC,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,gDAAgD;IAChD,KAAK,IAAI,IAAI,CAAC;CACf"}
@@ -0,0 +1,21 @@
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
+ /**
6
+ * Identifies the type of changes made to the `CoreIModelSelectionSet` to produce a `CoreSelectionSetEvent`.
7
+ * @see https://www.itwinjs.org/reference/core-frontend/selectionset/selectionseteventtype/
8
+ * @internal
9
+ */
10
+ export var CoreSelectionSetEventType;
11
+ (function (CoreSelectionSetEventType) {
12
+ /** Elements have been added to the set. */
13
+ CoreSelectionSetEventType[CoreSelectionSetEventType["Add"] = 0] = "Add";
14
+ /** Elements have been removed from the set. */
15
+ CoreSelectionSetEventType[CoreSelectionSetEventType["Remove"] = 1] = "Remove";
16
+ /** Some elements have been added to the set and others have been removed. */
17
+ CoreSelectionSetEventType[CoreSelectionSetEventType["Replace"] = 2] = "Replace";
18
+ /** All elements are about to be removed from the set. */
19
+ CoreSelectionSetEventType[CoreSelectionSetEventType["Clear"] = 3] = "Clear";
20
+ })(CoreSelectionSetEventType || (CoreSelectionSetEventType = {}));
21
+ //# sourceMappingURL=IModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../../../src/unified-selection/types/IModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG;;;;GAIG;AACH,MAAM,CAAN,IAAY,yBASX;AATD,WAAY,yBAAyB;IACnC,2CAA2C;IAC3C,uEAAG,CAAA;IACH,+CAA+C;IAC/C,6EAAM,CAAA;IACN,6EAA6E;IAC7E,+EAAO,CAAA;IACP,yDAAyD;IACzD,2EAAK,CAAA;AACP,CAAC,EATW,yBAAyB,KAAzB,yBAAyB,QASpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Id64Arg } from \"@itwin/core-bentley\";\nimport { Event } from \"@itwin/presentation-shared\";\n\n/**\n * Identifies the type of changes made to the `CoreIModelSelectionSet` to produce a `CoreSelectionSetEvent`.\n * @see https://www.itwinjs.org/reference/core-frontend/selectionset/selectionseteventtype/\n * @internal\n */\nexport enum CoreSelectionSetEventType {\n /** Elements have been added to the set. */\n Add,\n /** Elements have been removed from the set. */\n Remove,\n /** Some elements have been added to the set and others have been removed. */\n Replace,\n /** All elements are about to be removed from the set. */\n Clear,\n}\n\n/**\n * Payload sent to `CoreIModelSelectionSet.onChanged` event listeners to describe how the contents of the set have changed.\n * @see https://www.itwinjs.org/reference/core-frontend/selectionset/selectionsetevent/\n * @internal\n */\nexport interface CoreSelectionSetEventUnsafe {\n /**\n * The type of operation that produced this event.\n *\n * Actually, this should be `CoreSelectionSetEventType`, however we can't use it here because in TS two identical enums with\n * different names aren't equal, so [`SelectionSetEventType `](https://www.itwinjs.org/reference/core-frontend/selectionset/selectionseteventtype/)\n * doesn't map to `CoreSelectionSetEventType` as far as TS is concerned. Due to this reason, this interface is marked as `unsafe`.\n */\n type: number;\n /** The element Ids added to the set. */\n added?: Id64Arg;\n /** The element Ids removed from the set. */\n removed?: Id64Arg;\n /** The affected `CoreIModelSelectionSet`. */\n set: CoreIModelSelectionSet;\n}\n\n/**\n * A set of *currently selected* elements in an iModel.\n * @see https://www.itwinjs.org/reference/core-frontend/selectionset/\n * @internal\n */\nexport interface CoreIModelSelectionSet {\n /** Event called whenever elements are added or removed from this SelectionSet. */\n onChanged: Event<(ev: CoreSelectionSetEventUnsafe) => void>;\n /** The IDs of the selected elements. */\n readonly elements: Set<string>;\n /** Clear current selection set. */\n emptyAll(): void;\n /** Add one or more Ids to the current selection set. */\n add(elem: Id64Arg): boolean;\n /** Remove one or more Ids from the current selection set. */\n remove(elem: Id64Arg): boolean;\n}\n\n/**\n * A set if ID's optimized for performance-critical code which represents large sets of ID's as pairs of 32-bit integers.\n * @see https://www.itwinjs.org/reference/core-bentley/ids/id64/id64.uint32set/\n */\ninterface Uint32Set {\n /** Add any number of Ids to the set. */\n addIds(ids: Id64Arg): void;\n /** Remove any number of Ids from the set. */\n deleteIds(ids: Id64Arg): void;\n}\n\n/**\n * A set of *hilited* elements in an iModel, by element id.\n * @see https://www.itwinjs.org/reference/core-frontend/selectionset/hiliteset/\n * @internal\n */\nexport interface CoreIModelHiliteSet {\n /** Control whether the hilited elements should be synchronized with the contents of `CoreIModelSelectionSet`.*/\n wantSyncWithSelectionSet: boolean;\n /** The set of hilited elements. */\n readonly elements: Uint32Set;\n /** The set of hilited subcategories. */\n readonly subcategories: Uint32Set;\n /** The set of hilited models. */\n readonly models: Uint32Set;\n /** Remove all elements from the hilited set. */\n clear(): void;\n}\n"]}
@@ -1,13 +1,8 @@
1
- /**
2
- * @module UnifiedSelection
3
- *
4
- * @docs-group-description UnifiedSelection
5
- * API for working with unified selection.
6
- */
7
1
  export * from "./unified-selection/Selectable";
8
2
  export { SelectionStorage, createStorage } from "./unified-selection/SelectionStorage";
9
3
  export { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from "./unified-selection/HiliteSetProvider";
10
4
  export { createCachingHiliteSetProvider, CachingHiliteSetProvider } from "./unified-selection/CachingHiliteSetProvider";
11
5
  export { computeSelection } from "./unified-selection/SelectionScope";
6
+ export { enableUnifiedSelectionSyncWithIModel } from "./unified-selection/EnableUnifiedSelectionSyncWithIModel";
12
7
  export { StorageSelectionChangeType, StorageSelectionChangeEventArgs, StorageSelectionChangesListener, SelectionChangeEvent, } from "./unified-selection/SelectionChangeEvent";
13
8
  //# sourceMappingURL=unified-selection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unified-selection.d.ts","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"unified-selection.d.ts","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAKA,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,oCAAoC,EAAE,MAAM,0DAA0D,CAAC;AAChH,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,0CAA0C,CAAC"}
@@ -2,15 +2,10 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- /**
6
- * @module UnifiedSelection
7
- *
8
- * @docs-group-description UnifiedSelection
9
- * API for working with unified selection.
10
- */
11
5
  export * from "./unified-selection/Selectable";
12
6
  export { createStorage } from "./unified-selection/SelectionStorage";
13
7
  export { createHiliteSetProvider } from "./unified-selection/HiliteSetProvider";
14
8
  export { createCachingHiliteSetProvider } from "./unified-selection/CachingHiliteSetProvider";
15
9
  export { computeSelection } from "./unified-selection/SelectionScope";
10
+ export { enableUnifiedSelectionSyncWithIModel } from "./unified-selection/EnableUnifiedSelectionSyncWithIModel";
16
11
  //# sourceMappingURL=unified-selection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unified-selection.js","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAgC,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,8BAA8B,EAA4B,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * API for working with unified selection.\n */\nexport * from \"./unified-selection/Selectable\";\nexport { SelectionStorage, createStorage } from \"./unified-selection/SelectionStorage\";\nexport { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from \"./unified-selection/HiliteSetProvider\";\nexport { createCachingHiliteSetProvider, CachingHiliteSetProvider } from \"./unified-selection/CachingHiliteSetProvider\";\nexport { computeSelection } from \"./unified-selection/SelectionScope\";\nexport {\n StorageSelectionChangeType,\n StorageSelectionChangeEventArgs,\n StorageSelectionChangesListener,\n SelectionChangeEvent,\n} from \"./unified-selection/SelectionChangeEvent\";\n"]}
1
+ {"version":3,"file":"unified-selection.js","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAgC,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,8BAA8B,EAA4B,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,oCAAoC,EAAE,MAAM,0DAA0D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nexport * from \"./unified-selection/Selectable\";\nexport { SelectionStorage, createStorage } from \"./unified-selection/SelectionStorage\";\nexport { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from \"./unified-selection/HiliteSetProvider\";\nexport { createCachingHiliteSetProvider, CachingHiliteSetProvider } from \"./unified-selection/CachingHiliteSetProvider\";\nexport { computeSelection } from \"./unified-selection/SelectionScope\";\nexport { enableUnifiedSelectionSyncWithIModel } from \"./unified-selection/EnableUnifiedSelectionSyncWithIModel\";\nexport {\n StorageSelectionChangeType,\n StorageSelectionChangeEventArgs,\n StorageSelectionChangesListener,\n SelectionChangeEvent,\n} from \"./unified-selection/SelectionChangeEvent\";\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@itwin/unified-selection",
3
- "version": "0.2.0",
4
- "description": "Package for managing unified selection",
3
+ "version": "0.4.0",
4
+ "description": "Package for managing unified selection in iTwin.js applications.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -10,9 +10,15 @@
10
10
  },
11
11
  "keywords": [
12
12
  "Bentley",
13
- "EC",
14
- "Unified selection",
15
- "iTwin.js"
13
+ "Highlight",
14
+ "Hilite",
15
+ "iTwin.js",
16
+ "Presentation",
17
+ "Selection",
18
+ "Selection level",
19
+ "Selection scope",
20
+ "Selection storage",
21
+ "Unified selection"
16
22
  ],
17
23
  "author": {
18
24
  "name": "Bentley Systems, Inc.",
@@ -22,29 +28,30 @@
22
28
  "module": "lib/esm/unified-selection.js",
23
29
  "types": "lib/cjs/unified-selection.d.ts",
24
30
  "dependencies": {
25
- "@itwin/core-bentley": "^4.4.0",
31
+ "@itwin/core-bentley": "^4.5.2",
26
32
  "rxjs": "^7.8.1",
27
- "rxjs-for-await": "^1.0.0"
33
+ "rxjs-for-await": "^1.0.0",
34
+ "@itwin/presentation-shared": "^0.1.0"
28
35
  },
29
36
  "devDependencies": {
30
- "@itwin/build-tools": "^4.4.0",
31
- "@itwin/eslint-plugin": "4.0.0-dev.48",
32
- "@types/chai": "^4.3.11",
37
+ "@itwin/build-tools": "^4.5.2",
38
+ "@itwin/eslint-plugin": "^4.0.0",
39
+ "@types/chai": "^4.3.14",
33
40
  "@types/chai-as-promised": "^7.1.8",
34
41
  "@types/mocha": "^10.0.6",
35
- "@types/node": "^18.17.7",
42
+ "@types/node": "^18.19.31",
36
43
  "@types/sinon": "^17.0.3",
37
44
  "@types/sinon-chai": "^3.2.12",
38
45
  "chai": "^4.4.1",
39
46
  "chai-as-promised": "^7.1.1",
40
47
  "cpx2": "^7.0.1",
41
- "eslint": "^8.56.0",
42
- "mocha": "^10.3.0",
48
+ "eslint": "^8.57.0",
49
+ "mocha": "^10.4.0",
43
50
  "nyc": "^15.1.0",
51
+ "rimraf": "^5.0.5",
44
52
  "sinon": "^17.0.1",
45
53
  "sinon-chai": "^3.7.0",
46
- "source-map-support": "^0.5.21",
47
- "typescript": "~5.0.4",
54
+ "typescript": "~5.4.5",
48
55
  "presentation-test-utilities": "^0.0.0"
49
56
  },
50
57
  "scripts": {
@@ -55,7 +62,7 @@
55
62
  "clean": "rimraf lib build",
56
63
  "cover": "nyc npm -s test",
57
64
  "lint": "eslint ./src/**/*.ts",
58
- "test": "mocha --config ./.mocharc.json \"./lib/cjs/test/**/*.test.js\"",
65
+ "test": "mocha --enable-source-maps --config ./.mocharc.json \"./lib/cjs/test/**/*.test.js\"",
59
66
  "test:watch": "npm -s test -- --reporter min --watch-extensions ts --watch",
60
67
  "extract-api": "betools extract-api --entry=unified-selection --apiReportFolder=./api --apiReportTempFolder=./api/temp --apiSummaryFolder=./api",
61
68
  "check-internal": "node ../../scripts/checkInternal.js --apiSummary ./api/unified-selection.api.md"
@@ -1,44 +0,0 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- /**
5
- * An interface of an iModel metadata provider used to retrieve information about ECSchemas,
6
- * ECClasses, ECProperties, etc.
7
- */
8
- export interface IMetadataProvider {
9
- getSchema(schemaName: string): Promise<ECSchema | undefined>;
10
- }
11
- /**
12
- * Represents an ECSchema that contains classes, relationships, etc.
13
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/
14
- */
15
- export interface ECSchema {
16
- name: string;
17
- getClass(name: string): Promise<ECClass | undefined>;
18
- }
19
- /**
20
- * Represents an ECSchema item - a class, relationship, etc.
21
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/
22
- */
23
- export interface ECSchemaItem {
24
- schema: ECSchema;
25
- fullName: string;
26
- name: string;
27
- label?: string;
28
- }
29
- /**
30
- * Represents an ECClass.
31
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/
32
- */
33
- export interface ECClass extends ECSchemaItem {
34
- is(className: string, schemaName: string): Promise<boolean>;
35
- }
36
- /**
37
- * An utility to parse schema and class names from full class name, where
38
- * schema and class names are separated by either `:` or `.`
39
- */
40
- export declare function parseFullClassName(fullClassName: string): {
41
- schemaName: string;
42
- className: string;
43
- };
44
- //# sourceMappingURL=ECMetadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECMetadata.d.ts","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECMetadata.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;CAC9D;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;;;EAGvD"}
@@ -1,17 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.parseFullClassName = void 0;
8
- /**
9
- * An utility to parse schema and class names from full class name, where
10
- * schema and class names are separated by either `:` or `.`
11
- */
12
- function parseFullClassName(fullClassName) {
13
- const [schemaName, className] = fullClassName.split(/[\.:]/);
14
- return { schemaName, className };
15
- }
16
- exports.parseFullClassName = parseFullClassName;
17
- //# sourceMappingURL=ECMetadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECMetadata.js","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECMetadata.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA0ChG;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,aAAqB;IACtD,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC;AAHD,gDAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\n/**\n * An interface of an iModel metadata provider used to retrieve information about ECSchemas,\n * ECClasses, ECProperties, etc.\n */\nexport interface IMetadataProvider {\n getSchema(schemaName: string): Promise<ECSchema | undefined>;\n}\n\n/**\n * Represents an ECSchema that contains classes, relationships, etc.\n * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/\n */\nexport interface ECSchema {\n name: string;\n getClass(name: string): Promise<ECClass | undefined>;\n}\n\n/**\n * Represents an ECSchema item - a class, relationship, etc.\n * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/\n */\nexport interface ECSchemaItem {\n schema: ECSchema;\n fullName: string;\n name: string;\n label?: string;\n}\n\n/**\n * Represents an ECClass.\n * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/\n */\nexport interface ECClass extends ECSchemaItem {\n is(className: string, schemaName: string): Promise<boolean>;\n}\n\n/**\n * An utility to parse schema and class names from full class name, where\n * schema and class names are separated by either `:` or `.`\n */\nexport function parseFullClassName(fullClassName: string) {\n const [schemaName, className] = fullClassName.split(/[\\.:]/);\n return { schemaName, className };\n}\n"]}
@@ -1,69 +0,0 @@
1
- /**
2
- * Types of values that can be bound to an ECSql query.
3
- */
4
- export type ECSqlBindingType = "boolean" | "double" | "id" | "idset" | "int" | "long" | "string" | "point2d" | "point3d";
5
- /**
6
- * Defines an ECSql binding consisting of a value and its type. Necessary to differentiate between numeric
7
- * types and `Id64String` vs `string`.
8
- */
9
- export type ECSqlBinding = {
10
- type: "boolean";
11
- value?: boolean;
12
- } | {
13
- type: "double" | "int" | "long";
14
- value?: number;
15
- } | {
16
- type: "id";
17
- value?: string;
18
- } | {
19
- type: "idset";
20
- value?: string[];
21
- } | {
22
- type: "string";
23
- value?: string;
24
- } | {
25
- type: "point2d";
26
- value?: {
27
- x: number;
28
- y: number;
29
- };
30
- } | {
31
- type: "point3d";
32
- value?: {
33
- x: number;
34
- y: number;
35
- z: number;
36
- };
37
- };
38
- /**
39
- * Defines requested ECSQL result row format.
40
- */
41
- export type ECSqlQueryRowFormat = "ECSqlPropertyNames" | "Indexes";
42
- /**
43
- * Defines options for ECSQL query reader.
44
- */
45
- export interface ECSqlQueryReaderOptions {
46
- rowFormat?: ECSqlQueryRowFormat;
47
- }
48
- /**
49
- * Represents a single row of an ECSQL query result.
50
- */
51
- export interface ECSqlQueryRow {
52
- [propertyName: string]: any;
53
- [propertyIndex: number]: any;
54
- }
55
- /**
56
- * Represents ECSQL query results reader.
57
- */
58
- export type ECSqlQueryReader = AsyncIterableIterator<ECSqlQueryRow>;
59
- /**
60
- * An interface for something that knows how to create an ECSQL query reader.
61
- */
62
- export interface IECSqlQueryExecutor {
63
- createQueryReader(ecsql: string, bindings?: ECSqlBinding[], config?: ECSqlQueryReaderOptions): ECSqlQueryReader;
64
- }
65
- /**
66
- * Forms ECSql bindings from given ID's.
67
- */
68
- export declare function formIdBindings(property: string, ids: string[], bindings: ECSqlBinding[]): string;
69
- //# sourceMappingURL=ECSqlCore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECSqlCore.d.ts","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECSqlCore.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzH;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,SAAS,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CAAC;IAC5B,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAAG,gBAAgB,CAAC;CACjH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAYhG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECSqlCore.js","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECSqlCore.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAyEhG;;GAEG;AACH,SAAgB,cAAc,CAAC,QAAgB,EAAE,GAAa,EAAE,QAAwB;IACtF,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE;QACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7C,OAAO,mBAAmB,QAAQ,GAAG,CAAC;KACvC;IAED,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,OAAO,CAAC;KAChB;IAED,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9D,OAAO,GAAG,QAAQ,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAC5D,CAAC;AAZD,wCAYC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Types of values that can be bound to an ECSql query.\n */\nexport type ECSqlBindingType = \"boolean\" | \"double\" | \"id\" | \"idset\" | \"int\" | \"long\" | \"string\" | \"point2d\" | \"point3d\";\n\n/**\n * Defines an ECSql binding consisting of a value and its type. Necessary to differentiate between numeric\n * types and `Id64String` vs `string`.\n */\nexport type ECSqlBinding =\n | {\n type: \"boolean\";\n value?: boolean;\n }\n | {\n type: \"double\" | \"int\" | \"long\";\n value?: number;\n }\n | {\n type: \"id\";\n value?: string;\n }\n | {\n type: \"idset\";\n value?: string[];\n }\n | {\n type: \"string\";\n value?: string;\n }\n | {\n type: \"point2d\";\n value?: { x: number; y: number };\n }\n | {\n type: \"point3d\";\n value?: { x: number; y: number; z: number };\n };\n\n/**\n * Defines requested ECSQL result row format.\n */\nexport type ECSqlQueryRowFormat = \"ECSqlPropertyNames\" | \"Indexes\";\n\n/**\n * Defines options for ECSQL query reader.\n */\nexport interface ECSqlQueryReaderOptions {\n rowFormat?: ECSqlQueryRowFormat;\n}\n\n/**\n * Represents a single row of an ECSQL query result.\n */\nexport interface ECSqlQueryRow {\n [propertyName: string]: any;\n [propertyIndex: number]: any;\n}\n\n/**\n * Represents ECSQL query results reader.\n */\nexport type ECSqlQueryReader = AsyncIterableIterator<ECSqlQueryRow>;\n\n/**\n * An interface for something that knows how to create an ECSQL query reader.\n */\nexport interface IECSqlQueryExecutor {\n createQueryReader(ecsql: string, bindings?: ECSqlBinding[], config?: ECSqlQueryReaderOptions): ECSqlQueryReader;\n}\n\n/**\n * Forms ECSql bindings from given ID's.\n */\nexport function formIdBindings(property: string, ids: string[], bindings: ECSqlBinding[]): string {\n if (ids.length > 1000) {\n bindings.push({ type: \"idset\", value: ids });\n return `InVirtualSet(?, ${property})`;\n }\n\n if (ids.length === 0) {\n return `FALSE`;\n }\n\n ids.forEach((id) => bindings.push({ type: \"id\", value: id }));\n return `${property} IN (${ids.map(() => \"?\").join(\",\")})`;\n}\n"]}
@@ -1,44 +0,0 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- /**
5
- * An interface of an iModel metadata provider used to retrieve information about ECSchemas,
6
- * ECClasses, ECProperties, etc.
7
- */
8
- export interface IMetadataProvider {
9
- getSchema(schemaName: string): Promise<ECSchema | undefined>;
10
- }
11
- /**
12
- * Represents an ECSchema that contains classes, relationships, etc.
13
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/
14
- */
15
- export interface ECSchema {
16
- name: string;
17
- getClass(name: string): Promise<ECClass | undefined>;
18
- }
19
- /**
20
- * Represents an ECSchema item - a class, relationship, etc.
21
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/
22
- */
23
- export interface ECSchemaItem {
24
- schema: ECSchema;
25
- fullName: string;
26
- name: string;
27
- label?: string;
28
- }
29
- /**
30
- * Represents an ECClass.
31
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/
32
- */
33
- export interface ECClass extends ECSchemaItem {
34
- is(className: string, schemaName: string): Promise<boolean>;
35
- }
36
- /**
37
- * An utility to parse schema and class names from full class name, where
38
- * schema and class names are separated by either `:` or `.`
39
- */
40
- export declare function parseFullClassName(fullClassName: string): {
41
- schemaName: string;
42
- className: string;
43
- };
44
- //# sourceMappingURL=ECMetadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECMetadata.d.ts","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECMetadata.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;CAC9D;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;;;EAGvD"}
@@ -1,13 +0,0 @@
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
- /**
6
- * An utility to parse schema and class names from full class name, where
7
- * schema and class names are separated by either `:` or `.`
8
- */
9
- export function parseFullClassName(fullClassName) {
10
- const [schemaName, className] = fullClassName.split(/[\.:]/);
11
- return { schemaName, className };
12
- }
13
- //# sourceMappingURL=ECMetadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECMetadata.js","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECMetadata.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AA0ChG;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,aAAqB;IACtD,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\n/**\n * An interface of an iModel metadata provider used to retrieve information about ECSchemas,\n * ECClasses, ECProperties, etc.\n */\nexport interface IMetadataProvider {\n getSchema(schemaName: string): Promise<ECSchema | undefined>;\n}\n\n/**\n * Represents an ECSchema that contains classes, relationships, etc.\n * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/\n */\nexport interface ECSchema {\n name: string;\n getClass(name: string): Promise<ECClass | undefined>;\n}\n\n/**\n * Represents an ECSchema item - a class, relationship, etc.\n * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/\n */\nexport interface ECSchemaItem {\n schema: ECSchema;\n fullName: string;\n name: string;\n label?: string;\n}\n\n/**\n * Represents an ECClass.\n * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/\n */\nexport interface ECClass extends ECSchemaItem {\n is(className: string, schemaName: string): Promise<boolean>;\n}\n\n/**\n * An utility to parse schema and class names from full class name, where\n * schema and class names are separated by either `:` or `.`\n */\nexport function parseFullClassName(fullClassName: string) {\n const [schemaName, className] = fullClassName.split(/[\\.:]/);\n return { schemaName, className };\n}\n"]}
@@ -1,69 +0,0 @@
1
- /**
2
- * Types of values that can be bound to an ECSql query.
3
- */
4
- export type ECSqlBindingType = "boolean" | "double" | "id" | "idset" | "int" | "long" | "string" | "point2d" | "point3d";
5
- /**
6
- * Defines an ECSql binding consisting of a value and its type. Necessary to differentiate between numeric
7
- * types and `Id64String` vs `string`.
8
- */
9
- export type ECSqlBinding = {
10
- type: "boolean";
11
- value?: boolean;
12
- } | {
13
- type: "double" | "int" | "long";
14
- value?: number;
15
- } | {
16
- type: "id";
17
- value?: string;
18
- } | {
19
- type: "idset";
20
- value?: string[];
21
- } | {
22
- type: "string";
23
- value?: string;
24
- } | {
25
- type: "point2d";
26
- value?: {
27
- x: number;
28
- y: number;
29
- };
30
- } | {
31
- type: "point3d";
32
- value?: {
33
- x: number;
34
- y: number;
35
- z: number;
36
- };
37
- };
38
- /**
39
- * Defines requested ECSQL result row format.
40
- */
41
- export type ECSqlQueryRowFormat = "ECSqlPropertyNames" | "Indexes";
42
- /**
43
- * Defines options for ECSQL query reader.
44
- */
45
- export interface ECSqlQueryReaderOptions {
46
- rowFormat?: ECSqlQueryRowFormat;
47
- }
48
- /**
49
- * Represents a single row of an ECSQL query result.
50
- */
51
- export interface ECSqlQueryRow {
52
- [propertyName: string]: any;
53
- [propertyIndex: number]: any;
54
- }
55
- /**
56
- * Represents ECSQL query results reader.
57
- */
58
- export type ECSqlQueryReader = AsyncIterableIterator<ECSqlQueryRow>;
59
- /**
60
- * An interface for something that knows how to create an ECSQL query reader.
61
- */
62
- export interface IECSqlQueryExecutor {
63
- createQueryReader(ecsql: string, bindings?: ECSqlBinding[], config?: ECSqlQueryReaderOptions): ECSqlQueryReader;
64
- }
65
- /**
66
- * Forms ECSql bindings from given ID's.
67
- */
68
- export declare function formIdBindings(property: string, ids: string[], bindings: ECSqlBinding[]): string;
69
- //# sourceMappingURL=ECSqlCore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECSqlCore.d.ts","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECSqlCore.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzH;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,SAAS,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CAAC;IAC5B,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAAG,gBAAgB,CAAC;CACjH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAYhG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ECSqlCore.js","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECSqlCore.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAyEhG;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,GAAa,EAAE,QAAwB;IACtF,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE;QACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7C,OAAO,mBAAmB,QAAQ,GAAG,CAAC;KACvC;IAED,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,OAAO,CAAC;KAChB;IAED,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9D,OAAO,GAAG,QAAQ,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAC5D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Types of values that can be bound to an ECSql query.\n */\nexport type ECSqlBindingType = \"boolean\" | \"double\" | \"id\" | \"idset\" | \"int\" | \"long\" | \"string\" | \"point2d\" | \"point3d\";\n\n/**\n * Defines an ECSql binding consisting of a value and its type. Necessary to differentiate between numeric\n * types and `Id64String` vs `string`.\n */\nexport type ECSqlBinding =\n | {\n type: \"boolean\";\n value?: boolean;\n }\n | {\n type: \"double\" | \"int\" | \"long\";\n value?: number;\n }\n | {\n type: \"id\";\n value?: string;\n }\n | {\n type: \"idset\";\n value?: string[];\n }\n | {\n type: \"string\";\n value?: string;\n }\n | {\n type: \"point2d\";\n value?: { x: number; y: number };\n }\n | {\n type: \"point3d\";\n value?: { x: number; y: number; z: number };\n };\n\n/**\n * Defines requested ECSQL result row format.\n */\nexport type ECSqlQueryRowFormat = \"ECSqlPropertyNames\" | \"Indexes\";\n\n/**\n * Defines options for ECSQL query reader.\n */\nexport interface ECSqlQueryReaderOptions {\n rowFormat?: ECSqlQueryRowFormat;\n}\n\n/**\n * Represents a single row of an ECSQL query result.\n */\nexport interface ECSqlQueryRow {\n [propertyName: string]: any;\n [propertyIndex: number]: any;\n}\n\n/**\n * Represents ECSQL query results reader.\n */\nexport type ECSqlQueryReader = AsyncIterableIterator<ECSqlQueryRow>;\n\n/**\n * An interface for something that knows how to create an ECSQL query reader.\n */\nexport interface IECSqlQueryExecutor {\n createQueryReader(ecsql: string, bindings?: ECSqlBinding[], config?: ECSqlQueryReaderOptions): ECSqlQueryReader;\n}\n\n/**\n * Forms ECSql bindings from given ID's.\n */\nexport function formIdBindings(property: string, ids: string[], bindings: ECSqlBinding[]): string {\n if (ids.length > 1000) {\n bindings.push({ type: \"idset\", value: ids });\n return `InVirtualSet(?, ${property})`;\n }\n\n if (ids.length === 0) {\n return `FALSE`;\n }\n\n ids.forEach((id) => bindings.push({ type: \"id\", value: id }));\n return `${property} IN (${ids.map(() => \"?\").join(\",\")})`;\n}\n"]}