@itwin/presentation-shared 2.0.0-alpha.12 → 2.0.0-alpha.13

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 (35) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/README.md +19 -34
  3. package/lib/presentation-shared.d.ts +2 -1
  4. package/lib/presentation-shared.d.ts.map +1 -1
  5. package/lib/presentation-shared.js +4 -1
  6. package/lib/presentation-shared.js.map +1 -1
  7. package/lib/shared/EachValueFrom.d.ts +30 -0
  8. package/lib/shared/EachValueFrom.d.ts.map +1 -0
  9. package/lib/shared/EachValueFrom.js +115 -0
  10. package/lib/shared/EachValueFrom.js.map +1 -0
  11. package/lib/shared/Metadata.d.ts +43 -37
  12. package/lib/shared/Metadata.d.ts.map +1 -1
  13. package/lib/shared/Metadata.js +7 -6
  14. package/lib/shared/Metadata.js.map +1 -1
  15. package/lib/shared/Values.js +1 -1
  16. package/lib/shared/Values.js.map +1 -1
  17. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +11 -4
  18. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
  19. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.js +14 -14
  20. package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
  21. package/lib/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +2 -2
  22. package/lib/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
  23. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts +2 -2
  24. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts.map +1 -1
  25. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js +1 -4
  26. package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js.map +1 -1
  27. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts +2 -2
  28. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts.map +1 -1
  29. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js +3 -3
  30. package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js.map +1 -1
  31. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts +2 -2
  32. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts.map +1 -1
  33. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js +4 -5
  34. package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js.map +1 -1
  35. package/package.json +8 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,122 @@
1
1
  # @itwin/presentation-shared
2
2
 
3
+ ## 2.0.0-alpha.13
4
+
5
+ ### Major Changes
6
+
7
+ - [#1531](https://github.com/iTwin/presentation/pull/1531): `EC.RelationshipConstraintMultiplicity`: Changed `upperLimit` type from `number` to `number | "unbounded"`.
8
+
9
+ Previously, `createECSchemaProvider` from `@itwin/presentation-core-interop` reported an unbounded (`*`) upper limit as `0`, which silently made the natural `upperLimit > 1` check treat many-valued relationships as single-valued. The limit is now an explicit `"unbounded"` value that consumers must handle:
10
+
11
+ ```ts
12
+ const isManyValued =
13
+ constraint.multiplicity.upperLimit === "unbounded" ||
14
+ constraint.multiplicity.upperLimit > 1;
15
+ ```
16
+
17
+ - [#1503](https://github.com/iTwin/presentation/pull/1503): Full class and property names are now compared case-sensitively. Provide names using the casing defined by their EC schemas.
18
+ - [#1493](https://github.com/iTwin/presentation/pull/1493): Expose access to enumerations, kind-of-quantities and property categories through `EC.Schema`, and extend `EC.KindOfQuantity` with `relativeError` and `persistenceUnit` attributes. Schemas returned by `createECSchemaProvider` now implement the new getters.
19
+
20
+ - `EC.Schema` now requires `getEnumeration`, `getKindOfQuantity` and `getPropertyCategory` methods (mirroring the existing `getClass`). Consumers that only use `EC.Schema` are unaffected, but custom implementations of the interface must add these getters:
21
+
22
+ ```ts
23
+ const schema: EC.Schema = {
24
+ name,
25
+ version,
26
+ isHidden,
27
+ getClass: (className) => classes.get(className),
28
+ // added:
29
+ getEnumeration: (enumName) => enumerations.get(enumName),
30
+ getKindOfQuantity: (koqName) => kindOfQuantities.get(koqName),
31
+ getPropertyCategory: (categoryName) => categories.get(categoryName),
32
+ };
33
+ ```
34
+
35
+ - `EC.KindOfQuantity` now requires `relativeError` (`number`) and `persistenceUnit` (`string`) attributes. Custom implementations must provide them.
36
+
37
+ - `createECSchemaProvider`: The `EC.Schema` returned by the provider now implements the new getters, giving access to enumerations, kind-of-quantities and property categories in addition to classes. Existing code keeps working without changes and can now read these additional schema items:
38
+
39
+ ```ts
40
+ const schemaProvider = createECSchemaProvider(imodel);
41
+ const schema = await schemaProvider.getSchema("BisCore");
42
+ const enumeration = schema?.getEnumeration("MySchema.MyEnum");
43
+ const koq = schema?.getKindOfQuantity("MySchema.MyKoq");
44
+ const category = schema?.getPropertyCategory("MySchema.MyCategory");
45
+ ```
46
+
47
+ - [#1491](https://github.com/iTwin/presentation/pull/1491): `ECSchemaProvider`: Added a `classDerivesFrom` method for checking whether one ECClass is the same as, or derives from, another. `createECSchemaProvider` (in `@itwin/presentation-core-interop`) implements it using the class hierarchy information it already loads, so the answer is returned synchronously once the hierarchy has been loaded and no additional round-trips to the iModel are needed.
48
+
49
+ Also, `ECClassHierarchyInspector` and `createCachingECClassHierarchyInspector` have been deprecated. Because `ECSchemaProvider` now exposes `classDerivesFrom` directly, a separate class hierarchy inspector is no longer needed when setting up iModel access:
50
+
51
+ ```ts
52
+ // Before:
53
+ import { createCachingECClassHierarchyInspector } from "@itwin/presentation-shared";
54
+ import {
55
+ createECSchemaProvider,
56
+ createECSqlQueryExecutor,
57
+ } from "@itwin/presentation-core-interop";
58
+
59
+ const schemaProvider = createECSchemaProvider(imodel);
60
+ const imodelAccess = {
61
+ ...schemaProvider,
62
+ ...createCachingECClassHierarchyInspector({ schemaProvider }),
63
+ ...createECSqlQueryExecutor(imodel),
64
+ };
65
+
66
+ // After:
67
+ import {
68
+ createECSchemaProvider,
69
+ createECSqlQueryExecutor,
70
+ } from "@itwin/presentation-core-interop";
71
+
72
+ const imodelAccess = {
73
+ ...createECSchemaProvider(imodel), // now also provides `classDerivesFrom`
74
+ ...createECSqlQueryExecutor(imodel),
75
+ };
76
+ ```
77
+
78
+ **Breaking changes:**
79
+
80
+ - `ECSchemaProvider` now requires a `classDerivesFrom` method. Objects created via `createECSchemaProvider` get it automatically, so most consumers don't need to change anything. Only custom, hand-written `ECSchemaProvider` implementations need to add the method.
81
+
82
+ - Renamed the `classHierarchyInspector` prop to `imodelAccess` on `createClassBasedInstanceLabelSelectClauseFactory`, `createBisInstanceLabelSelectClauseFactory` (both in `@itwin/presentation-shared`) and `createPredicateBasedHierarchyDefinition` (in `@itwin/presentation-hierarchies`). The prop's type is unchanged, so the value passed to it doesn't need to change - only the prop name:
83
+
84
+ ```ts
85
+ // Before:
86
+ const classHierarchyInspector = createCachingECClassHierarchyInspector({
87
+ schemaProvider: createECSchemaProvider(imodel),
88
+ });
89
+ createPredicateBasedHierarchyDefinition({
90
+ classHierarchyInspector,
91
+ hierarchy,
92
+ });
93
+
94
+ // After:
95
+ const imodelAccess = createECSchemaProvider(imodel);
96
+ createPredicateBasedHierarchyDefinition({ imodelAccess, hierarchy });
97
+ ```
98
+
99
+ - [#1394](https://github.com/iTwin/presentation/pull/1394): `EC` namespace interfaces in `@itwin/presentation-shared` no longer use `Promise` wrappers — once a schema is loaded via the still-async `ECSchemaProvider.getSchema`, all further navigation (`baseClass`, `is()`, `getProperty()`, `getProperties()`, `kindOfQuantity`, `relationshipClass`, `enumeration`, `abstractConstraint`) is synchronous.
100
+
101
+ Additional changes:
102
+
103
+ - The `EC.Class.getDerivedClasses()` method was replaced with `getDerivedClassNames(props?: { onlyDirect?: boolean })`. `ECSchemaProvider` can be used to load the derived classes by name, if needed.
104
+ - The `getCustomAttributes()` method has been removed from `EC.Schema`, `EC.Class`, and `EC.Property` and replaced with an `isHidden: boolean` property. `EC.CustomAttributeSet` and `EC.CustomAttribute` types have been removed.
105
+ - Added an `EC.Class.getOwnProperties()` method that returns only the properties defined on the class itself, without inherited properties.
106
+ - Added an `EC.EntityClass.getMixins()` method that returns all mixins applied to the entity class.
107
+ - Added an optional `EC.Property.category` attribute.
108
+ - Added a required `EC.RelationshipConstraint.constraintClasses` attribute.
109
+ - Added missing optional `description` attributes to `EC.Schema` and `EC.Property`.
110
+
111
+ ### Minor Changes
112
+
113
+ - [#1507](https://github.com/iTwin/presentation/pull/1507): Add `eachValueFrom` for consuming subscribable streams through async iteration.
114
+
115
+ ### Patch Changes
116
+
117
+ - [#1524](https://github.com/iTwin/presentation/pull/1524): Fix `eachValueFrom` dropping legitimately emitted `undefined` values when they're buffered before the consumer requests them.
118
+ - [#1496](https://github.com/iTwin/presentation/pull/1496): `createRelationshipPathJoinClause`: The pre-resolved (sync) overload now accepts a rendering-only input — each step only needs its `joins`, plus an optional top-level `bindings` — instead of the full `RelationshipPathJoinInfo` shape. Callers that only need to render JOINs no longer have to supply the unused `relationshipClassIdSelector`, `sourceClassIdSelector`, and `targetClassIdSelector` fields per step.
119
+
3
120
  ## 2.0.0-alpha.12
4
121
 
5
122
  ### Major Changes
@@ -248,6 +365,30 @@
248
365
 
249
366
  In reality, consumers will likely use `@itwin/presentation-core-interop` package for creating them, and the package has been updated to handle the change, so reacting to the breaking change is as simple as bumping the version of `@itwin/presentation-core-interop` package in the consumer's `package.json`.
250
367
 
368
+ ## 1.2.22
369
+
370
+ ### Patch Changes
371
+
372
+ - [#1543](https://github.com/iTwin/presentation/pull/1543): Update iTwin.js core dependencies to `^5.13.1` and refresh related tooling/test dependencies.
373
+
374
+ ## 1.2.21
375
+
376
+ ### Patch Changes
377
+
378
+ - [#1521](https://github.com/iTwin/presentation/pull/1521): `createRelationshipPathJoinClause`: fix produced ECSQL being invalid when joining with `joinType: "outer"`. The produced snippet used `OUTER JOIN`, which ECSQL fails to parse - now it uses `LEFT OUTER JOIN`.
379
+
380
+ ## 1.2.20
381
+
382
+ ### Patch Changes
383
+
384
+ - [#1500](https://github.com/iTwin/presentation/pull/1500): Update iTwin.js core dependencies to ^5.12.4 and refresh related tooling/test dependencies.
385
+
386
+ ## 1.2.19
387
+
388
+ ### Patch Changes
389
+
390
+ - [#1473](https://github.com/iTwin/presentation/pull/1473): Bump dependencies.
391
+
251
392
  ## 1.2.18
252
393
 
253
394
  ### Patch Changes
package/README.md CHANGED
@@ -16,50 +16,38 @@ The namespace defines all the [EC](https://www.itwinjs.org/bis/ec/) types that P
16
16
 
17
17
  ### `ECSchemaProvider` & `getClass`
18
18
 
19
- - `ECSchemaProvider` is an interface for something that knows how to get an [ECSchema](https://www.itwinjs.org/bis/ec/ec-schema/) from an iModel. The package itself doesn't provide an implementation for this interface and instead relies on `@itwin/presentation-core-interop` to do that.
19
+ - `ECSchemaProvider` is an interface for something that knows how to get an [ECSchema](https://www.itwinjs.org/bis/ec/ec-schema/) from an iModel, or check if one class is the same as, or derives from, another. The package itself doesn't provide an implementation for this interface and instead relies on `@itwin/presentation-core-interop` to do that.
20
20
 
21
21
  - `getClass` is an utility function that makes it easier to get an `EC.Class`, given an `ECSchemaProvider` and a full class name.
22
22
 
23
23
  Example usage:
24
24
 
25
25
  ```ts
26
- import { SchemaContext } from "@itwin/ecschema-metadata";
26
+ import { IModelConnection } from "@itwin/core-frontend";
27
27
  import { createECSchemaProvider } from "@itwin/presentation-core-interop";
28
28
  import { ECSchemaProvider, getClass } from "@itwin/presentation-shared";
29
29
 
30
- const schemas = new SchemaContext();
31
- const schemaProvider: ECSchemaProvider = createECSchemaProvider(schemas);
30
+ const iModelConnection: IModelConnection = ...; // obtain the IModelConnection instance
31
+ const schemaProvider: ECSchemaProvider = createECSchemaProvider(iModelConnection);
32
32
 
33
33
  // get schema and a class from it
34
34
  const ecSchema = await schemaProvider.getSchema("MySchema");
35
- const ecClassFromSchema = await ecSchema.getClass("MyClass");
35
+ const ecClassFromSchema = ecSchema.getClass("MyClass");
36
36
 
37
37
  // ... or use the `getClass` utility to get straight to the class
38
38
  const ecClassFromUtility = await getClass(schemaProvider, "MySchema.MyClass");
39
- ```
40
-
41
- ### `ECClassHierarchyInspector` & `createCachingECClassHierarchyInspector`
42
39
 
43
- - `ECClassHierarchyInspector` is an interface for something that knows how to check whether one `EC.Class` derives from another. While that can be achieved through `ECSchemaProvider` by getting an `EC.Class` and calling its `is` method, using this interface provides a more streamlined and, possibly, more efficient way to do the check. In addition, the `ECClassHierarchyInspector.classDerivesFrom` returns a `Promise<boolean> | boolean`, which lets the implementation return the result synchronously, if it's already known.
40
+ // check whether one class derives from another
41
+ const isGeometricElement = await schemaProvider.classDerivesFrom("MySchema.MyClass", "BisCore.GeometricElement");
42
+ ```
44
43
 
45
- - `createCachingECClassHierarchyInspector` is a factory method that creates `ECClassHierarchyInspector` instance that uses a LRU cache to store the check results. In Presentation library use cases, class inheritance checks are done very frequently to warrant caching these results.
44
+ ### `ECClassHierarchyInspector` & `createCachingECClassHierarchyInspector` (deprecated)
46
45
 
47
- Example usage:
46
+ > **Deprecated:** `ECClassHierarchyInspector` and `createCachingECClassHierarchyInspector` are deprecated. `ECSchemaProvider` now exposes a `classDerivesFrom` method directly, so a separate class hierarchy inspector is no longer needed.
48
47
 
49
- ```ts
50
- import { createCachingECClassHierarchyInspector, ECClassHierarchyInspector } from "@itwin/presentation-shared";
48
+ - `ECClassHierarchyInspector` is an interface for something that knows how to check whether one `EC.Class` derives from another. The same capability is now available directly on `ECSchemaProvider` via its `classDerivesFrom` method. Like the inspector, `ECSchemaProvider.classDerivesFrom` returns a `Promise<boolean> | boolean`, which lets the implementation return the result synchronously when it's already known.
51
49
 
52
- const classHierarchyInspector: ECClassHierarchyInspector = createCachingECClassHierarchyInspector({
53
- // provide `ECSchemaProvider` that will be used to access iModels schemas
54
- schemaProvider: getMetadataProvider(),
55
- // tell how many entries should be cached in LRU cache (0 or `undefined` stand for "no caching")
56
- cacheSize: 100,
57
- });
58
- const isGeometricElement = await classHierarchyInspector.classDerivesFrom(
59
- "MySchema.MyClass",
60
- "BisCore.GeometricElement",
61
- );
62
- ```
50
+ - `createCachingECClassHierarchyInspector` is a factory method that creates an `ECClassHierarchyInspector` instance that uses a LRU cache to store the check results. It is no longer needed - use `ECSchemaProvider.classDerivesFrom` instead.
63
51
 
64
52
  ## ECSql
65
53
 
@@ -343,14 +331,11 @@ This label selectors factory doesn't create labels on its own, but allows assign
343
331
  Example usage:
344
332
 
345
333
  ```ts
346
- import {
347
- createClassBasedInstanceLabelSelectClauseFactory,
348
- ECClassHierarchyInspector,
349
- } from "@itwin/presentation-shared";
334
+ import { createClassBasedInstanceLabelSelectClauseFactory, ECSchemaProvider } from "@itwin/presentation-shared";
350
335
 
351
- const classHierarchyInspector: ECClassHierarchyInspector = getClassHierarchyInspector();
336
+ const imodelAccess: ECSchemaProvider = getSchemaProvider();
352
337
  const labelsFactory = createClassBasedInstanceLabelSelectClauseFactory({
353
- classHierarchyInspector,
338
+ imodelAccess,
354
339
  clauses: [
355
340
  {
356
341
  className: "MySchema.MyClass",
@@ -377,10 +362,10 @@ This label selectors factory creates labels according to [BIS instance label rul
377
362
  Example usage:
378
363
 
379
364
  ```ts
380
- import { createBisInstanceLabelSelectClauseFactory, ECClassHierarchyInspector } from "@itwin/presentation-shared";
365
+ import { createBisInstanceLabelSelectClauseFactory, ECSchemaProvider } from "@itwin/presentation-shared";
381
366
 
382
- const classHierarchyInspector: ECClassHierarchyInspector = getClassHierarchyInspector();
383
- const labelsFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector });
367
+ const imodelAccess: ECSchemaProvider = getSchemaProvider();
368
+ const labelsFactory = createBisInstanceLabelSelectClauseFactory({ imodelAccess });
384
369
  const ecsql = `SELECT ${await labelsFactory.createSelectClause({ classAlias: "element" })} AS [Label] FROM [BisCore].[Element] AS [element]`;
385
370
  // ...
386
371
  ```
@@ -397,7 +382,7 @@ Example usage:
397
382
  ```ts
398
383
  import { createIModelInstanceLabelSelectClauseFactory } from "@itwin/presentation-shared";
399
384
 
400
- // `imodelAccess` must satisfy `ECSqlQueryExecutor & ECClassHierarchyInspector & ECSchemaProvider`
385
+ // `imodelAccess` must satisfy `ECSqlQueryExecutor & ECSchemaProvider`
401
386
  const labelsFactory = createIModelInstanceLabelSelectClauseFactory({ imodelAccess });
402
387
  const ecsql = `SELECT ${await labelsFactory.createSelectClause({ classAlias: "element" })} AS [Label] FROM [BisCore].[Element] AS [element]`;
403
388
  // ...
@@ -1,5 +1,6 @@
1
1
  export * as ECSql from "./shared/ecsql-snippets/index.js";
2
2
  export { ConcatenatedValue, ConcatenatedValuePart } from "./shared/ConcatenatedValue.js";
3
+ export { eachValueFrom } from "./shared/EachValueFrom.js";
3
4
  export { ECSqlBinding } from "./shared/ECSqlCore.js";
4
5
  export type { ECSqlQueryDef, ECSqlQueryExecutor, ECSqlQueryReaderOptions, ECSqlQueryRow } from "./shared/ECSqlCore.js";
5
6
  export type { IPrimitiveValueFormatter } from "./shared/Formatting.js";
@@ -14,7 +15,7 @@ export type { ILogger, LogFunction, LogLevel } from "./shared/Logging.js";
14
15
  export { NOOP_LOGGER } from "./shared/Logging.js";
15
16
  export type { ArrayElement, OmitOverUnion, Props } from "./shared/MappedTypes.js";
16
17
  export type { ArrayValueDescriptor, EC, ECClassHierarchyInspector, ECSchemaProvider, NavigationValueDescriptor, PrimitiveValueDescriptor, PrimitiveValueType, RelationshipPath, StructValueDescriptor, ValueDescriptor, } from "./shared/Metadata.js";
17
- export { createCachingECClassHierarchyInspector, getClass } from "./shared/Metadata.js";
18
+ export { createCachingECClassHierarchyInspector, getClass, } from "./shared/Metadata.js";
18
19
  export { createMainThreadReleaseOnTimePassedHandler, julianToDateTime, normalizeFullClassName, parseFullClassName, releaseMainThread, trimWhitespace, } from "./shared/Utils.js";
19
20
  export { InstanceKey, PrimitiveValue, TypedPrimitiveValue } from "./shared/Values.js";
20
21
  export type { ArrayValue, StructValue, Value, Point2dValue, Point3dValue } from "./shared/Values.js";
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-shared.d.ts","sourceRoot":"","sources":["../src/presentation-shared.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvH,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,YAAY,EAAE,iCAAiC,EAAE,MAAM,8CAA8C,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,6CAA6C,EAAE,MAAM,kFAAkF,CAAC;AACjJ,OAAO,EAAE,gDAAgD,EAAE,MAAM,qFAAqF,CAAC;AACvJ,OAAO,EAAE,yCAAyC,EAAE,MAAM,8EAA8E,CAAC;AACzI,OAAO,EAAE,4CAA4C,EAAE,MAAM,iFAAiF,CAAC;AAC/I,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClF,YAAY,EACV,oBAAoB,EACpB,EAAE,EACF,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GACh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AM,8EAA8E,CAAC;AACzI,OAAO,EAAE,4CAA4C,EAAE,MAAM,iFAAiF,CAAC;AAC/I,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClF,YAAY,EACV,oBAAoB,EACpB,EAAE,EAEF,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,sCAAsC,EACtC,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0CAA0C,EAC1C,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrG,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
@@ -4,6 +4,7 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  export * as ECSql from "./shared/ecsql-snippets/index.js";
6
6
  export { ConcatenatedValue, ConcatenatedValuePart } from "./shared/ConcatenatedValue.js";
7
+ export { eachValueFrom } from "./shared/EachValueFrom.js";
7
8
  export { ECSqlBinding } from "./shared/ECSqlCore.js";
8
9
  export { createDefaultValueFormatter, formatConcatenatedValue } from "./shared/Formatting.js";
9
10
  export { parseInstanceLabel } from "./shared/InstanceLabelSelectClauseFactory.js";
@@ -12,7 +13,9 @@ export { createClassBasedInstanceLabelSelectClauseFactory } from "./shared/insta
12
13
  export { createBisInstanceLabelSelectClauseFactory } from "./shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js";
13
14
  export { createIModelInstanceLabelSelectClauseFactory } from "./shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js";
14
15
  export { NOOP_LOGGER } from "./shared/Logging.js";
15
- export { createCachingECClassHierarchyInspector, getClass } from "./shared/Metadata.js";
16
+ export {
17
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
18
+ createCachingECClassHierarchyInspector, getClass, } from "./shared/Metadata.js";
16
19
  export { createMainThreadReleaseOnTimePassedHandler, julianToDateTime, normalizeFullClassName, parseFullClassName, releaseMainThread, trimWhitespace, } from "./shared/Utils.js";
17
20
  export { InstanceKey, PrimitiveValue, TypedPrimitiveValue } from "./shared/Values.js";
18
21
  //# sourceMappingURL=presentation-shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-shared.js","sourceRoot":"","sources":["../src/presentation-shared.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,6CAA6C,EAAE,MAAM,kFAAkF,CAAC;AACjJ,OAAO,EAAE,gDAAgD,EAAE,MAAM,qFAAqF,CAAC;AACvJ,OAAO,EAAE,yCAAyC,EAAE,MAAM,8EAA8E,CAAC;AACzI,OAAO,EAAE,4CAA4C,EAAE,MAAM,iFAAiF,CAAC;AAE/I,OAAO,EAAE,WAAW,EAAE,MAAM,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EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The subscription operations required by `eachValueFrom`.
3
+ *
4
+ * @public
5
+ */
6
+ export interface Subscribable<T> {
7
+ /**
8
+ * Subscribes to stream notifications.
9
+ */
10
+ subscribe(observer: {
11
+ next: (value: T) => void;
12
+ error: (reason: unknown) => void;
13
+ complete: () => void;
14
+ }): {
15
+ unsubscribe: () => void;
16
+ };
17
+ }
18
+ /**
19
+ * Converts a subscribable stream into an async iterator.
20
+ *
21
+ * This is pretty much a combination of:
22
+ * - https://github.com/benlesh/rxjs-for-await/blob/94f9cf9cb015ac3700dfd1850eb81d36962eb70f/src/index.ts#L33,
23
+ * - https://github.com/ReactiveX/rxjs/blob/2587ee852eb43eeb0883a7787bac2944d823392b/packages/observable/src/observable.ts#L922.
24
+ *
25
+ * Our implementation uses a linked list rather than an array to store values, which is more efficient.
26
+ *
27
+ * @public
28
+ */
29
+ export declare function eachValueFrom<T>(source: Subscribable<T>): AsyncIterableIterator<T>;
30
+ //# sourceMappingURL=EachValueFrom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EachValueFrom.d.ts","sourceRoot":"","sources":["../../src/shared/EachValueFrom.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;QAAC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG;QACzG,WAAW,EAAE,MAAM,IAAI,CAAC;KACzB,CAAC;CACH;AAED;;;;;;;;;;GAUG;AACH,wBAAuB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CA0DzF"}
@@ -0,0 +1,115 @@
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
+ // cspell:words deferreds
6
+ /**
7
+ * Converts a subscribable stream into an async iterator.
8
+ *
9
+ * This is pretty much a combination of:
10
+ * - https://github.com/benlesh/rxjs-for-await/blob/94f9cf9cb015ac3700dfd1850eb81d36962eb70f/src/index.ts#L33,
11
+ * - https://github.com/ReactiveX/rxjs/blob/2587ee852eb43eeb0883a7787bac2944d823392b/packages/observable/src/observable.ts#L922.
12
+ *
13
+ * Our implementation uses a linked list rather than an array to store values, which is more efficient.
14
+ *
15
+ * @public
16
+ */
17
+ export async function* eachValueFrom(source) {
18
+ const deferreds = new Queue();
19
+ const values = new Queue();
20
+ let error;
21
+ let completed = false;
22
+ const subs = source.subscribe({
23
+ next: (value) => {
24
+ const deferred = deferreds.pop();
25
+ if (deferred) {
26
+ deferred.resolve({ value, done: false });
27
+ }
28
+ else {
29
+ values.push(value);
30
+ }
31
+ },
32
+ error: (err) => {
33
+ error = err;
34
+ for (let deferred = deferreds.pop(); deferred !== undefined; deferred = deferreds.pop()) {
35
+ deferred.reject(err);
36
+ }
37
+ },
38
+ complete: () => {
39
+ completed = true;
40
+ for (let deferred = deferreds.pop(); deferred !== undefined; deferred = deferreds.pop()) {
41
+ deferred.resolve({ value: undefined, done: true });
42
+ }
43
+ },
44
+ });
45
+ try {
46
+ while (true) {
47
+ if (!values.isEmpty) {
48
+ // The queue is non-empty, so this is an actual buffered value — possibly a legitimately
49
+ // emitted `undefined`, which is why emptiness is checked explicitly rather than by
50
+ // comparing the popped value to `undefined`.
51
+ yield values.pop();
52
+ continue;
53
+ }
54
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
55
+ if (completed) {
56
+ return;
57
+ }
58
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
59
+ if (error) {
60
+ // eslint-disable-next-line @typescript-eslint/only-throw-error
61
+ throw error;
62
+ }
63
+ const result = await new Promise((resolve, reject) => {
64
+ deferreds.push({ resolve, reject });
65
+ });
66
+ if (result.done) {
67
+ return;
68
+ }
69
+ yield result.value;
70
+ }
71
+ }
72
+ catch (err) {
73
+ throw err;
74
+ }
75
+ finally {
76
+ subs.unsubscribe();
77
+ }
78
+ }
79
+ class QueueEntry {
80
+ value;
81
+ next;
82
+ constructor(value, next) {
83
+ this.value = value;
84
+ this.next = next;
85
+ }
86
+ }
87
+ class Queue {
88
+ _front;
89
+ _back;
90
+ get isEmpty() {
91
+ return this._front === undefined;
92
+ }
93
+ push(item) {
94
+ const entry = new QueueEntry(item);
95
+ if (this._back) {
96
+ this._back.next = entry;
97
+ }
98
+ this._back = entry;
99
+ if (!this._front) {
100
+ this._front = entry;
101
+ }
102
+ }
103
+ pop() {
104
+ if (!this._front) {
105
+ return undefined;
106
+ }
107
+ const value = this._front.value;
108
+ this._front = this._front.next;
109
+ if (!this._front) {
110
+ this._back = undefined;
111
+ }
112
+ return value;
113
+ }
114
+ }
115
+ //# sourceMappingURL=EachValueFrom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EachValueFrom.js","sourceRoot":"","sources":["../../src/shared/EachValueFrom.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,yBAAyB;AAgBzB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,aAAa,CAAI,MAAuB;IAC7D,MAAM,SAAS,GAAG,IAAI,KAAK,EAAsF,CAAC;IAClH,MAAM,MAAM,GAAG,IAAI,KAAK,EAAK,CAAC;IAC9B,IAAI,KAAK,CAAC;IACV,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC;QAC5B,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACd,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;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AC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACzB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -7,10 +7,19 @@ import type { ECSqlBinding } from "./ECSqlCore.js";
7
7
  */
8
8
  export interface ECSchemaProvider {
9
9
  getSchema(schemaName: string): Promise<EC.Schema | undefined>;
10
+ /**
11
+ * Checks whether the class identified by `derivedClassFullName` is the same as, or derives from, the class
12
+ * identified by `candidateBaseClassFullName`. A class is considered to derive from itself.
13
+ *
14
+ * The result may be returned synchronously when the class hierarchy information is already available, or as a
15
+ * promise otherwise.
16
+ */
17
+ classDerivesFrom(derivedClassFullName: EC.FullClassNameDotNotation, candidateBaseClassFullName: EC.FullClassNameDotNotation): Promise<boolean> | boolean;
10
18
  }
11
19
  /**
12
20
  * An interface for a class hierarchy inspector that can be used to determine if one class derives from another.
13
21
  * @see `createCachingECClassHierarchyInspector`
22
+ * @deprecated in 2.0. Use `ECSchemaProvider` instead - it now exposes `classDerivesFrom` directly.
14
23
  * @public
15
24
  */
16
25
  export interface ECClassHierarchyInspector {
@@ -18,7 +27,10 @@ export interface ECClassHierarchyInspector {
18
27
  }
19
28
  /**
20
29
  * Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
30
+ *
21
31
  * @public
32
+ * @deprecated in 2.0. Use `createECSchemaProvider` from `@itwin/presentation-core-interop` instead - the created
33
+ * `ECSchemaProvider` exposes `classDerivesFrom` directly, without the need for a separate class hierarchy inspector.
22
34
  */
23
35
  export declare function createCachingECClassHierarchyInspector(props: {
24
36
  /** Schema provider used to load schemas and their classes. */
@@ -55,10 +67,14 @@ export declare namespace EC {
55
67
  */
56
68
  interface Schema {
57
69
  name: string;
70
+ description?: string;
58
71
  /** The schema version. Format: `"read.write.minor"`, comparison order: write > read > minor. */
59
72
  version: SchemaVersion;
60
- getClass(name: string): Promise<Class | undefined>;
61
- getCustomAttributes(): Promise<CustomAttributeSet>;
73
+ isHidden: boolean;
74
+ getClass(name: string): Class | undefined;
75
+ getEnumeration(name: string): Enumeration | undefined;
76
+ getKindOfQuantity(name: string): KindOfQuantity | undefined;
77
+ getPropertyCategory(name: string): PropertyCategory | undefined;
62
78
  }
63
79
  /**
64
80
  * Represents an ECSchema item - a class, relationship, etc.
@@ -78,19 +94,21 @@ export declare namespace EC {
78
94
  * @public
79
95
  */
80
96
  interface Class extends SchemaItem {
81
- baseClass: Promise<Class | undefined>;
82
- is(className: string, schemaName: string): Promise<boolean>;
83
- is(other: Class): Promise<boolean>;
84
- getProperty(name: string): Promise<Property | undefined>;
85
- getProperties(): Promise<Array<Property>>;
97
+ baseClass?: Class;
98
+ isHidden?: boolean;
99
+ is(className: string, schemaName: string): boolean;
100
+ is(other: Class): boolean;
101
+ getProperty(name: string): Property | undefined;
102
+ getProperties(): Array<Property>;
86
103
  /** Gets only the properties defined directly on this class, excluding those inherited from base classes. */
87
- getOwnProperties(): Promise<Array<Property>>;
104
+ getOwnProperties(): Array<Property>;
88
105
  isEntityClass(): this is EntityClass;
89
106
  isRelationshipClass(): this is RelationshipClass;
90
107
  isStructClass(): this is StructClass;
91
108
  isMixin(): this is Mixin;
92
- getDerivedClasses(): Promise<Class[]>;
93
- getCustomAttributes(): Promise<CustomAttributeSet>;
109
+ getDerivedClassNames(props?: {
110
+ onlyDirect?: boolean;
111
+ }): EC.FullClassNameDotNotation[];
94
112
  }
95
113
  /**
96
114
  * Represents an entity class.
@@ -99,7 +117,7 @@ export declare namespace EC {
99
117
  */
100
118
  interface EntityClass extends Class {
101
119
  /** Gets the mixins applied directly to this entity class. */
102
- getMixins(): Promise<Mixin[]>;
120
+ getMixins(): Mixin[];
103
121
  }
104
122
  /**
105
123
  * Represents a struct class.
@@ -118,7 +136,10 @@ export declare namespace EC {
118
136
  * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/kindofquantity/
119
137
  * @public
120
138
  */
121
- type KindOfQuantity = SchemaItem;
139
+ interface KindOfQuantity extends SchemaItem {
140
+ relativeError: number;
141
+ persistenceUnit: string;
142
+ }
122
143
  /**
123
144
  * Represents a property category used to group related properties.
124
145
  * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/propertycategory/
@@ -135,7 +156,8 @@ export declare namespace EC {
135
156
  */
136
157
  interface RelationshipConstraintMultiplicity {
137
158
  lowerLimit: number;
138
- upperLimit: number;
159
+ /** `"unbounded"` when the constraint declares no upper bound (`*`). */
160
+ upperLimit: number | "unbounded";
139
161
  }
140
162
  /**
141
163
  * Represents a relationship constraint.
@@ -145,7 +167,8 @@ export declare namespace EC {
145
167
  interface RelationshipConstraint {
146
168
  multiplicity: RelationshipConstraintMultiplicity;
147
169
  polymorphic: boolean;
148
- abstractConstraint: Promise<EntityClass | Mixin | RelationshipClass | undefined>;
170
+ constraintClasses: Class[];
171
+ abstractConstraint?: EntityClass | Mixin | RelationshipClass;
149
172
  }
150
173
  /**
151
174
  * Represents a relationship class.
@@ -185,16 +208,17 @@ export declare namespace EC {
185
208
  */
186
209
  interface Property {
187
210
  name: string;
211
+ description?: string;
188
212
  class: Class;
189
213
  label?: string;
190
- kindOfQuantity: Promise<KindOfQuantity | undefined>;
191
- category: Promise<PropertyCategory | undefined>;
214
+ isHidden: boolean;
215
+ kindOfQuantity?: KindOfQuantity;
216
+ category?: PropertyCategory;
192
217
  isArray(): this is ArrayProperty;
193
218
  isStruct(): this is StructProperty;
194
219
  isPrimitive(): this is PrimitiveProperty;
195
220
  isEnumeration(): this is EnumerationProperty;
196
221
  isNavigation(): this is NavigationProperty;
197
- getCustomAttributes(): Promise<CustomAttributeSet>;
198
222
  }
199
223
  /**
200
224
  * Defines array property attributes.
@@ -243,7 +267,7 @@ export declare namespace EC {
243
267
  * @public
244
268
  */
245
269
  interface EnumerationProperty extends Property {
246
- enumeration: Promise<Enumeration | undefined>;
270
+ enumeration?: Enumeration;
247
271
  extendedTypeName?: string;
248
272
  }
249
273
  /**
@@ -252,7 +276,7 @@ export declare namespace EC {
252
276
  * @public
253
277
  */
254
278
  interface NavigationProperty extends Property {
255
- relationshipClass: Promise<RelationshipClass>;
279
+ relationshipClass: RelationshipClass;
256
280
  direction: "Forward" | "Backward";
257
281
  }
258
282
  /**
@@ -270,24 +294,6 @@ export declare namespace EC {
270
294
  primitiveType: PrimitiveType;
271
295
  extendedTypeName?: string;
272
296
  }
273
- /**
274
- * Defines a set of custom attributes that may be applied to a class or property.
275
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/customattribute/
276
- * @public
277
- */
278
- interface CustomAttributeSet {
279
- [Symbol.iterator]: () => IterableIterator<[FullClassNameDotNotation, CustomAttribute]>;
280
- get(className: FullClassNameDotNotation): CustomAttribute | undefined;
281
- }
282
- /**
283
- * Defines a custom attribute that may be applied to a class or property.
284
- * @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/customattribute/
285
- * @public
286
- */
287
- interface CustomAttribute {
288
- className: FullClassNameDotNotation;
289
- [propName: string]: any;
290
- }
291
297
  }
292
298
  /**
293
299
  * A union of all primitive value types supported by the Presentation packages.