@itwin/unified-selection 0.2.0 → 0.3.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 +119 -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 +90 -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 +156 -110
  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 +90 -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 +155 -109
  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
@@ -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;CACl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,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;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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"]}