@itwin/presentation-shared 2.0.0-alpha.8 → 2.0.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.
- package/CHANGELOG.md +736 -1
- package/README.md +59 -27
- package/lib/presentation-shared.d.ts +24 -0
- package/lib/presentation-shared.d.ts.map +1 -0
- package/lib/presentation-shared.js +22 -0
- package/lib/presentation-shared.js.map +1 -0
- package/lib/shared/ConcatenatedValue.d.ts.map +1 -0
- package/lib/shared/ConcatenatedValue.js.map +1 -0
- package/lib/{cjs/shared → shared}/ECSqlCore.d.ts +16 -2
- package/lib/shared/ECSqlCore.d.ts.map +1 -0
- package/lib/shared/ECSqlCore.js +37 -0
- package/lib/shared/ECSqlCore.js.map +1 -0
- package/lib/shared/EachValueFrom.d.ts +30 -0
- package/lib/shared/EachValueFrom.d.ts.map +1 -0
- package/lib/shared/EachValueFrom.js +115 -0
- package/lib/shared/EachValueFrom.js.map +1 -0
- package/lib/shared/Event.d.ts.map +1 -0
- package/lib/{esm/shared → shared}/Event.js.map +1 -1
- package/lib/shared/Formatting.d.ts.map +1 -0
- package/lib/{esm/shared → shared}/Formatting.js +10 -6
- package/lib/shared/Formatting.js.map +1 -0
- package/lib/shared/HiddenClasses.d.ts +21 -0
- package/lib/shared/HiddenClasses.d.ts.map +1 -0
- package/lib/shared/HiddenClasses.js +52 -0
- package/lib/shared/HiddenClasses.js.map +1 -0
- package/lib/{esm/shared → shared}/InstanceLabelSelectClauseFactory.d.ts +3 -63
- package/lib/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -0
- package/lib/shared/InstanceLabelSelectClauseFactory.js +27 -0
- package/lib/shared/InstanceLabelSelectClauseFactory.js.map +1 -0
- package/lib/shared/Logging.d.ts.map +1 -0
- package/lib/{esm/shared → shared}/Logging.js +2 -1
- package/lib/shared/Logging.js.map +1 -0
- package/lib/shared/MappedTypes.d.ts +55 -0
- package/lib/shared/MappedTypes.d.ts.map +1 -0
- package/lib/shared/MappedTypes.js.map +1 -0
- package/lib/shared/Metadata.d.ts +572 -0
- package/lib/shared/Metadata.d.ts.map +1 -0
- package/lib/{esm/shared → shared}/Metadata.js +7 -3
- package/lib/shared/Metadata.js.map +1 -0
- package/lib/{cjs/shared → shared}/Utils.d.ts +6 -7
- package/lib/shared/Utils.d.ts.map +1 -0
- package/lib/{esm/shared → shared}/Utils.js +21 -27
- package/lib/shared/Utils.js.map +1 -0
- package/lib/shared/Values.d.ts +144 -0
- package/lib/shared/Values.d.ts.map +1 -0
- package/lib/shared/Values.js +121 -0
- package/lib/shared/Values.js.map +1 -0
- package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.d.ts +40 -0
- package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.d.ts.map +1 -0
- package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.js +66 -0
- package/lib/shared/ecsql-snippets/ECSqlHiddenClassesSnippets.js.map +1 -0
- package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +174 -0
- package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -0
- package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.js +177 -0
- package/lib/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -0
- package/lib/{cjs/shared → shared}/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +10 -2
- package/lib/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -0
- package/lib/{esm/shared → shared}/ecsql-snippets/ECSqlValueSelectorSnippets.js +22 -8
- package/lib/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -0
- package/lib/shared/ecsql-snippets/index.d.ts +4 -0
- package/lib/shared/ecsql-snippets/index.d.ts.map +1 -0
- package/lib/shared/ecsql-snippets/index.js +8 -0
- package/lib/shared/ecsql-snippets/index.js.map +1 -0
- package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts +17 -0
- package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts.map +1 -0
- package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js +48 -0
- package/lib/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js.map +1 -0
- package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts +39 -0
- package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts.map +1 -0
- package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js +60 -0
- package/lib/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js.map +1 -0
- package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts +12 -0
- package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts.map +1 -0
- package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js +37 -0
- package/lib/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js.map +1 -0
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts +198 -0
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts.map +1 -0
- package/lib/{esm/shared/ECSqlCore.js → shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js} +4 -1
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js.map +1 -0
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts +34 -0
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts.map +1 -0
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js +332 -0
- package/lib/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js.map +1 -0
- package/lib/shared/instance-label-factory-impls/Utils.d.ts +7 -0
- package/lib/shared/instance-label-factory-impls/Utils.d.ts.map +1 -0
- package/lib/shared/instance-label-factory-impls/Utils.js +21 -0
- package/lib/shared/instance-label-factory-impls/Utils.js.map +1 -0
- package/package.json +22 -31
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/presentation-shared.d.ts +0 -17
- package/lib/cjs/presentation-shared.d.ts.map +0 -1
- package/lib/cjs/presentation-shared.js +0 -71
- package/lib/cjs/presentation-shared.js.map +0 -1
- package/lib/cjs/shared/ConcatenatedValue.d.ts.map +0 -1
- package/lib/cjs/shared/ConcatenatedValue.js +0 -49
- package/lib/cjs/shared/ConcatenatedValue.js.map +0 -1
- package/lib/cjs/shared/ECSqlCore.d.ts.map +0 -1
- package/lib/cjs/shared/ECSqlCore.js +0 -7
- package/lib/cjs/shared/ECSqlCore.js.map +0 -1
- package/lib/cjs/shared/Event.d.ts.map +0 -1
- package/lib/cjs/shared/Event.js +0 -7
- package/lib/cjs/shared/Event.js.map +0 -1
- package/lib/cjs/shared/Formatting.d.ts.map +0 -1
- package/lib/cjs/shared/Formatting.js +0 -114
- package/lib/cjs/shared/Formatting.js.map +0 -1
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts +0 -133
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts.map +0 -1
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js +0 -166
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js.map +0 -1
- package/lib/cjs/shared/Logging.d.ts.map +0 -1
- package/lib/cjs/shared/Logging.js +0 -20
- package/lib/cjs/shared/Logging.js.map +0 -1
- package/lib/cjs/shared/MappedTypes.d.ts +0 -17
- package/lib/cjs/shared/MappedTypes.d.ts.map +0 -1
- package/lib/cjs/shared/MappedTypes.js +0 -7
- package/lib/cjs/shared/MappedTypes.js.map +0 -1
- package/lib/cjs/shared/Metadata.d.ts +0 -291
- package/lib/cjs/shared/Metadata.d.ts.map +0 -1
- package/lib/cjs/shared/Metadata.js +0 -53
- package/lib/cjs/shared/Metadata.js.map +0 -1
- package/lib/cjs/shared/Utils.d.ts.map +0 -1
- package/lib/cjs/shared/Utils.js +0 -114
- package/lib/cjs/shared/Utils.js.map +0 -1
- package/lib/cjs/shared/Values.d.ts +0 -107
- package/lib/cjs/shared/Values.d.ts.map +0 -1
- package/lib/cjs/shared/Values.js +0 -155
- package/lib/cjs/shared/Values.js.map +0 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +0 -51
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +0 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js +0 -140
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +0 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +0 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +0 -260
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +0 -1
- package/lib/cjs/shared/ecsql-snippets/index.d.ts +0 -3
- package/lib/cjs/shared/ecsql-snippets/index.d.ts.map +0 -1
- package/lib/cjs/shared/ecsql-snippets/index.js +0 -18
- package/lib/cjs/shared/ecsql-snippets/index.js.map +0 -1
- package/lib/esm/presentation-shared.d.ts +0 -17
- package/lib/esm/presentation-shared.d.ts.map +0 -1
- package/lib/esm/presentation-shared.js +0 -14
- package/lib/esm/presentation-shared.js.map +0 -1
- package/lib/esm/shared/ConcatenatedValue.d.ts +0 -46
- package/lib/esm/shared/ConcatenatedValue.d.ts.map +0 -1
- package/lib/esm/shared/ConcatenatedValue.js.map +0 -1
- package/lib/esm/shared/ECSqlCore.d.ts +0 -94
- package/lib/esm/shared/ECSqlCore.d.ts.map +0 -1
- package/lib/esm/shared/ECSqlCore.js.map +0 -1
- package/lib/esm/shared/Event.d.ts +0 -27
- package/lib/esm/shared/Event.d.ts.map +0 -1
- package/lib/esm/shared/Formatting.d.ts +0 -44
- package/lib/esm/shared/Formatting.d.ts.map +0 -1
- package/lib/esm/shared/Formatting.js.map +0 -1
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts.map +0 -1
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.js +0 -160
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.js.map +0 -1
- package/lib/esm/shared/Logging.d.ts +0 -27
- package/lib/esm/shared/Logging.d.ts.map +0 -1
- package/lib/esm/shared/Logging.js.map +0 -1
- package/lib/esm/shared/MappedTypes.d.ts +0 -17
- package/lib/esm/shared/MappedTypes.d.ts.map +0 -1
- package/lib/esm/shared/MappedTypes.js.map +0 -1
- package/lib/esm/shared/Metadata.d.ts +0 -291
- package/lib/esm/shared/Metadata.d.ts.map +0 -1
- package/lib/esm/shared/Metadata.js.map +0 -1
- package/lib/esm/shared/Utils.d.ts +0 -61
- package/lib/esm/shared/Utils.d.ts.map +0 -1
- package/lib/esm/shared/Utils.js.map +0 -1
- package/lib/esm/shared/Values.d.ts +0 -107
- package/lib/esm/shared/Values.d.ts.map +0 -1
- package/lib/esm/shared/Values.js +0 -152
- package/lib/esm/shared/Values.js.map +0 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +0 -51
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +0 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js +0 -137
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +0 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +0 -122
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +0 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +0 -1
- package/lib/esm/shared/ecsql-snippets/index.d.ts +0 -3
- package/lib/esm/shared/ecsql-snippets/index.d.ts.map +0 -1
- package/lib/esm/shared/ecsql-snippets/index.js +0 -7
- package/lib/esm/shared/ecsql-snippets/index.js.map +0 -1
- /package/lib/{cjs/shared → shared}/ConcatenatedValue.d.ts +0 -0
- /package/lib/{esm/shared → shared}/ConcatenatedValue.js +0 -0
- /package/lib/{cjs/shared → shared}/Event.d.ts +0 -0
- /package/lib/{esm/shared → shared}/Event.js +0 -0
- /package/lib/{cjs/shared → shared}/Formatting.d.ts +0 -0
- /package/lib/{cjs/shared → shared}/Logging.d.ts +0 -0
- /package/lib/{esm/shared → shared}/MappedTypes.js +0 -0
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
import type { ECSqlBinding } from "./ECSqlCore.js";
|
|
2
|
+
import type { DeepReadonly } from "./MappedTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* An interface for an object that knows how to get an ECSchema from an iModel.
|
|
5
|
+
*
|
|
6
|
+
* @see `createECSchemaProvider` in `@itwin/presentation-core-interop`.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface ECSchemaProvider {
|
|
10
|
+
getSchema(schemaName: string): Promise<EC.Schema | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Checks whether the class identified by `derivedClassFullName` is the same as, or derives from, the class
|
|
13
|
+
* identified by `candidateBaseClassFullName`. A class is considered to derive from itself.
|
|
14
|
+
*
|
|
15
|
+
* The result may be returned synchronously when the class hierarchy information is already available, or as a
|
|
16
|
+
* promise otherwise.
|
|
17
|
+
*/
|
|
18
|
+
classDerivesFrom(derivedClassFullName: EC.FullClassNameDotNotation, candidateBaseClassFullName: EC.FullClassNameDotNotation): Promise<boolean> | boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a tree of classes, derived from the given class, whose visibility is changed through `HiddenClass`
|
|
21
|
+
* or `HiddenSchema` custom attributes. See `HiddenClassesTreeNode` for details on the tree structure.
|
|
22
|
+
*
|
|
23
|
+
* Building the tree requires traversing the whole derived classes' hierarchy, so implementations are expected
|
|
24
|
+
* to cache the result per selected class and share it between callers - including concurrent ones.
|
|
25
|
+
*
|
|
26
|
+
* Query authors should use `ECSql.createHiddenClassesFilter` to exclude instances of hidden classes from their queries.
|
|
27
|
+
* Implementations may use `createHiddenClassesTree` to build the tree.
|
|
28
|
+
*
|
|
29
|
+
* @throws Error if the selected class or any of its derived classes' schemas can't be found.
|
|
30
|
+
*/
|
|
31
|
+
getHiddenClassesTree(selectClassName: EC.FullClassNameDotNotation): Promise<DeepReadonly<HiddenClassesTreeNode[]>>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A node in a tree of classes, derived from some selected class, whose schema-defined visibility differs from
|
|
35
|
+
* their parent's. Visibility is defined through `CoreCustomAttributes.HiddenClass` and `CoreCustomAttributes.HiddenSchema`
|
|
36
|
+
* custom attributes.
|
|
37
|
+
*
|
|
38
|
+
* The tree is relative to the selected class, which is the visibility boundary: `HiddenClass` attributes on the selected
|
|
39
|
+
* class and on its base classes are ignored, so the selected class and its descendants are visible unless a descendant
|
|
40
|
+
* is hidden through its own `HiddenClass` attribute or the `HiddenSchema` attribute of its schema.
|
|
41
|
+
*
|
|
42
|
+
* - Root nodes are the outermost derived classes that are hidden (`state: "hide"`).
|
|
43
|
+
* - Children of a `"hide"` node are its derived classes that are explicitly shown (`state: "show"`), overriding
|
|
44
|
+
* the inherited hiding.
|
|
45
|
+
* - Children of a `"show"` node are its derived classes that are hidden again, and so on.
|
|
46
|
+
*
|
|
47
|
+
* Derived classes whose visibility matches their parent's are not included - their descendants are attached
|
|
48
|
+
* directly to the closest included ancestor. An empty tree means all instances of the selected class are visible.
|
|
49
|
+
*
|
|
50
|
+
* @see `ECSchemaProvider.getHiddenClassesTree`
|
|
51
|
+
* @see `ECSql.createHiddenClassesFilter`
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export type HiddenClassesTreeNode = HiddenClassesTreeNodeShown | HiddenClassesTreeNodeHidden;
|
|
55
|
+
/** @public */
|
|
56
|
+
interface HiddenClassesTreeNodeShown {
|
|
57
|
+
/** Full name of the class this node represents. */
|
|
58
|
+
fullName: EC.FullClassNameDotNotation;
|
|
59
|
+
/** Visibility state of the class and its derived classes, unless overridden by `children`. */
|
|
60
|
+
state: "show";
|
|
61
|
+
/** Derived classes whose visibility state differs from this node's `state`. */
|
|
62
|
+
children: HiddenClassesTreeNodeHidden[];
|
|
63
|
+
}
|
|
64
|
+
/** @public */
|
|
65
|
+
interface HiddenClassesTreeNodeHidden {
|
|
66
|
+
/** Full name of the class this node represents. */
|
|
67
|
+
fullName: EC.FullClassNameDotNotation;
|
|
68
|
+
/** Visibility state of the class and its derived classes, unless overridden by `children`. */
|
|
69
|
+
state: "hide";
|
|
70
|
+
/** Derived classes whose visibility state differs from this node's `state`. */
|
|
71
|
+
children: HiddenClassesTreeNodeShown[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* An interface for a class hierarchy inspector that can be used to determine if one class derives from another.
|
|
75
|
+
* @see `createCachingECClassHierarchyInspector`
|
|
76
|
+
* @deprecated in 2.0. Use `ECSchemaProvider` instead - it now exposes `classDerivesFrom` directly.
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export interface ECClassHierarchyInspector {
|
|
80
|
+
classDerivesFrom(derivedClassFullName: EC.FullClassNameDotNotation, candidateBaseClassFullName: EC.FullClassNameDotNotation): Promise<boolean> | boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
* @deprecated in 2.0. Use `createECSchemaProvider` from `@itwin/presentation-core-interop` instead - the created
|
|
87
|
+
* `ECSchemaProvider` exposes `classDerivesFrom` directly, without the need for a separate class hierarchy inspector.
|
|
88
|
+
*/
|
|
89
|
+
export declare function createCachingECClassHierarchyInspector(props: {
|
|
90
|
+
/** Schema provider used to load schemas and their classes. */
|
|
91
|
+
schemaProvider: ECSchemaProvider;
|
|
92
|
+
/** Optional cache size, describing the number of derived/base class combinations to store in cache. Defaults to `0`, which means no caching. */
|
|
93
|
+
cacheSize?: number;
|
|
94
|
+
}): ECClassHierarchyInspector;
|
|
95
|
+
/**
|
|
96
|
+
* A namespace containing various [EC types](https://www.itwinjs.org/bis/ec/).
|
|
97
|
+
* @public
|
|
98
|
+
* @see `ECSchemaProvider`
|
|
99
|
+
*/
|
|
100
|
+
export declare namespace EC {
|
|
101
|
+
type FullClassNameDotNotation = `${string}.${string}`;
|
|
102
|
+
type FullClassNameColonNotation = `${string}:${string}`;
|
|
103
|
+
type FullClassName = FullClassNameColonNotation | FullClassNameDotNotation;
|
|
104
|
+
/**
|
|
105
|
+
* Schema version components.
|
|
106
|
+
* Note: comparison order is write > read > minor (not left-to-right).
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
interface SchemaVersion {
|
|
110
|
+
/** First component in "read.write.minor" string format. */
|
|
111
|
+
read: number;
|
|
112
|
+
/** Second component in "read.write.minor" string format (most significant for compatibility). */
|
|
113
|
+
write: number;
|
|
114
|
+
/** Third component in "read.write.minor" string format. */
|
|
115
|
+
minor: number;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Represents an ECSchema that contains classes, relationships, etc.
|
|
119
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
interface Schema {
|
|
123
|
+
name: string;
|
|
124
|
+
description?: string;
|
|
125
|
+
/** The schema version. Format: `"read.write.minor"`, comparison order: write > read > minor. */
|
|
126
|
+
version: SchemaVersion;
|
|
127
|
+
isHidden: boolean;
|
|
128
|
+
getClass(name: string): Class | undefined;
|
|
129
|
+
getEnumeration(name: string): Enumeration | undefined;
|
|
130
|
+
getKindOfQuantity(name: string): KindOfQuantity | undefined;
|
|
131
|
+
getPropertyCategory(name: string): PropertyCategory | undefined;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Represents an ECSchema item - a class, relationship, etc.
|
|
135
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
interface SchemaItem {
|
|
139
|
+
schema: Schema;
|
|
140
|
+
fullName: FullClassNameDotNotation;
|
|
141
|
+
name: string;
|
|
142
|
+
label?: string;
|
|
143
|
+
description?: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Represents an ECClass.
|
|
147
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
interface Class extends SchemaItem {
|
|
151
|
+
baseClass?: Class;
|
|
152
|
+
isHidden?: boolean;
|
|
153
|
+
is(className: string, schemaName: string): boolean;
|
|
154
|
+
is(other: Class): boolean;
|
|
155
|
+
getProperty(name: string): Property | undefined;
|
|
156
|
+
getProperties(): Array<Property>;
|
|
157
|
+
/** Gets only the properties defined directly on this class, excluding those inherited from base classes. */
|
|
158
|
+
getOwnProperties(): Array<Property>;
|
|
159
|
+
isEntityClass(): this is EntityClass;
|
|
160
|
+
isRelationshipClass(): this is RelationshipClass;
|
|
161
|
+
isStructClass(): this is StructClass;
|
|
162
|
+
isMixin(): this is Mixin;
|
|
163
|
+
getDerivedClassNames(props?: {
|
|
164
|
+
onlyDirect?: boolean;
|
|
165
|
+
}): EC.FullClassNameDotNotation[];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Represents an entity class.
|
|
169
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/entityclass/
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
interface EntityClass extends Class {
|
|
173
|
+
/** Gets the mixins applied directly to this entity class. */
|
|
174
|
+
getMixins(): Mixin[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Represents a struct class.
|
|
178
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structclass/
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
type StructClass = Class;
|
|
182
|
+
/**
|
|
183
|
+
* Represents a mixin.
|
|
184
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/mixin/
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
type Mixin = Class;
|
|
188
|
+
/**
|
|
189
|
+
* Represents a kind of quantity.
|
|
190
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/kindofquantity/
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
interface KindOfQuantity extends SchemaItem {
|
|
194
|
+
relativeError: number;
|
|
195
|
+
persistenceUnit: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Represents a property category used to group related properties.
|
|
199
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/propertycategory/
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
202
|
+
interface PropertyCategory extends SchemaItem {
|
|
203
|
+
/** Determines the display order of the category relative to other categories. Higher priority categories are displayed first. */
|
|
204
|
+
priority: number;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Represents a relationship constraint multiplicity.
|
|
208
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipmultiplicity/
|
|
209
|
+
* @public
|
|
210
|
+
*/
|
|
211
|
+
interface RelationshipConstraintMultiplicity {
|
|
212
|
+
lowerLimit: number;
|
|
213
|
+
/** `"unbounded"` when the constraint declares no upper bound (`*`). */
|
|
214
|
+
upperLimit: number | "unbounded";
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Represents a relationship constraint.
|
|
218
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipconstraint/
|
|
219
|
+
* @public
|
|
220
|
+
*/
|
|
221
|
+
interface RelationshipConstraint {
|
|
222
|
+
multiplicity: RelationshipConstraintMultiplicity;
|
|
223
|
+
polymorphic: boolean;
|
|
224
|
+
constraintClasses: Class[];
|
|
225
|
+
abstractConstraint?: EntityClass | Mixin | RelationshipClass;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Represents a relationship class.
|
|
229
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipclass/
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
232
|
+
interface RelationshipClass extends Class {
|
|
233
|
+
direction: "Forward" | "Backward";
|
|
234
|
+
source: RelationshipConstraint;
|
|
235
|
+
target: RelationshipConstraint;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Represents an enumerator.
|
|
239
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerator/
|
|
240
|
+
* @public
|
|
241
|
+
*/
|
|
242
|
+
interface Enumerator<T> {
|
|
243
|
+
name: string;
|
|
244
|
+
value: T;
|
|
245
|
+
label?: string;
|
|
246
|
+
description?: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Represents an enumeration.
|
|
250
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumeration/
|
|
251
|
+
* @public
|
|
252
|
+
*/
|
|
253
|
+
interface Enumeration extends SchemaItem {
|
|
254
|
+
enumerators: Array<Enumerator<string | number>>;
|
|
255
|
+
type: "String" | "Number";
|
|
256
|
+
isStrict: boolean;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Represents a property.
|
|
260
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/property/
|
|
261
|
+
* @public
|
|
262
|
+
*/
|
|
263
|
+
interface Property {
|
|
264
|
+
name: string;
|
|
265
|
+
description?: string;
|
|
266
|
+
class: Class;
|
|
267
|
+
label?: string;
|
|
268
|
+
isHidden: boolean;
|
|
269
|
+
kindOfQuantity?: KindOfQuantity;
|
|
270
|
+
category?: PropertyCategory;
|
|
271
|
+
isArray(): this is ArrayProperty;
|
|
272
|
+
isStruct(): this is StructProperty;
|
|
273
|
+
isPrimitive(): this is PrimitiveProperty;
|
|
274
|
+
isEnumeration(): this is EnumerationProperty;
|
|
275
|
+
isNavigation(): this is NavigationProperty;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Defines array property attributes.
|
|
279
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/arrayproperty/
|
|
280
|
+
* @public
|
|
281
|
+
*/
|
|
282
|
+
interface ArrayPropertyAttributes {
|
|
283
|
+
minOccurs: number;
|
|
284
|
+
maxOccurs?: number;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Defines a structs array property.
|
|
288
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structarrayproperty/
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
type StructArrayProperty = StructProperty & ArrayPropertyAttributes;
|
|
292
|
+
/**
|
|
293
|
+
* Defines an enumerations array property.
|
|
294
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerationarrayproperty/
|
|
295
|
+
* @public
|
|
296
|
+
*/
|
|
297
|
+
type EnumerationArrayProperty = EnumerationProperty & ArrayPropertyAttributes;
|
|
298
|
+
/**
|
|
299
|
+
* Defines a primitives array property.
|
|
300
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitivearrayproperty/
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
303
|
+
type PrimitiveArrayProperty = PrimitiveProperty & ArrayPropertyAttributes;
|
|
304
|
+
/**
|
|
305
|
+
* Defines an array property.
|
|
306
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/anyarrayproperty/
|
|
307
|
+
* @public
|
|
308
|
+
*/
|
|
309
|
+
type ArrayProperty = StructArrayProperty | EnumerationArrayProperty | PrimitiveArrayProperty;
|
|
310
|
+
/**
|
|
311
|
+
* Defines a struct property.
|
|
312
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structproperty/
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
interface StructProperty extends Property {
|
|
316
|
+
structClass: StructClass;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Defines an enumeration property.
|
|
320
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerationproperty/
|
|
321
|
+
* @public
|
|
322
|
+
*/
|
|
323
|
+
interface EnumerationProperty extends Property {
|
|
324
|
+
enumeration?: Enumeration;
|
|
325
|
+
extendedTypeName?: string;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Defines a navigation property.
|
|
329
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/navigationproperty/
|
|
330
|
+
* @public
|
|
331
|
+
*/
|
|
332
|
+
interface NavigationProperty extends Property {
|
|
333
|
+
relationshipClass: RelationshipClass;
|
|
334
|
+
direction: "Forward" | "Backward";
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Defines a primitive property type.
|
|
338
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitivetype/
|
|
339
|
+
* @public
|
|
340
|
+
*/
|
|
341
|
+
type PrimitiveType = "Binary" | "Boolean" | "DateTime" | "Double" | "Integer" | "Long" | "Point2d" | "Point3d" | "String" | "IGeometry";
|
|
342
|
+
/**
|
|
343
|
+
* Defines a primitive property.
|
|
344
|
+
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitiveproperty/
|
|
345
|
+
* @public
|
|
346
|
+
*/
|
|
347
|
+
interface PrimitiveProperty extends Property {
|
|
348
|
+
primitiveType: PrimitiveType;
|
|
349
|
+
extendedTypeName?: string;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* A union of all primitive value types supported by the Presentation packages.
|
|
354
|
+
*
|
|
355
|
+
* Compared to `EC.PrimitiveType`:
|
|
356
|
+
* - Adds `"Id"` to support id properties such as `ECInstanceId` or `ECClassId`, which have no equivalent in `EC.PrimitiveType`.
|
|
357
|
+
* - Excludes `"Binary"` and `"IGeometry"`, as properties of those types are not supported by the Presentation packages.
|
|
358
|
+
*
|
|
359
|
+
* @public
|
|
360
|
+
*/
|
|
361
|
+
export type PrimitiveValueType = "Id" | Exclude<EC.PrimitiveType, "Binary" | "IGeometry">;
|
|
362
|
+
/**
|
|
363
|
+
* A type descriptor for a value's shape.
|
|
364
|
+
*
|
|
365
|
+
* - `PrimitiveValueDescriptor`: a scalar primitive.
|
|
366
|
+
* - `StructValueDescriptor`: a named struct with typed members.
|
|
367
|
+
* - `ArrayValueDescriptor`: an ordered collection of a single element type.
|
|
368
|
+
* - `NavigationValueDescriptor`: a reference to another EC instance, carrying the reference's target class name.
|
|
369
|
+
*
|
|
370
|
+
* @public
|
|
371
|
+
*/
|
|
372
|
+
export type ValueDescriptor = PrimitiveValueDescriptor | StructValueDescriptor | ArrayValueDescriptor | NavigationValueDescriptor;
|
|
373
|
+
/**
|
|
374
|
+
* Describes a scalar primitive value.
|
|
375
|
+
*
|
|
376
|
+
* When the value is backed by an enumeration (only possible for `String`-, `Integer`- and
|
|
377
|
+
* `Long`-typed values), `enumeration` carries the enumeration's metadata (its declared enumerators
|
|
378
|
+
* and their labels) so consumers can map raw values to display labels without re-reading schema. The
|
|
379
|
+
* `type` discriminates the enumerator value type (`String` → `string`, `Integer | Long` → `number`).
|
|
380
|
+
*
|
|
381
|
+
* `extendedType` carries the property's raw `extendedTypeName` (e.g. `"Json"`, `"BeGuid"`), when set,
|
|
382
|
+
* to let consumers refine how a `type`-typed value should be interpreted without re-reading schema.
|
|
383
|
+
*
|
|
384
|
+
* @public
|
|
385
|
+
*/
|
|
386
|
+
export type PrimitiveValueDescriptor = {
|
|
387
|
+
kind: "primitive";
|
|
388
|
+
extendedType?: string;
|
|
389
|
+
} & ({
|
|
390
|
+
/** The primitive value type. */
|
|
391
|
+
type: Extract<PrimitiveValueType, "String">;
|
|
392
|
+
kindOfQuantity?: undefined;
|
|
393
|
+
/** Metadata of the enumeration backing this value, when it is enumeration-backed. */
|
|
394
|
+
enumeration?: EnumerationInfo<string>;
|
|
395
|
+
} | {
|
|
396
|
+
/** The primitive value type. */
|
|
397
|
+
type: Extract<PrimitiveValueType, "Integer" | "Long">;
|
|
398
|
+
/**
|
|
399
|
+
* Full name of the KindOfQuantity associated with this property (e.g., `"Units.LENGTH"`).
|
|
400
|
+
* Determines how the value should be formatted and which units to display.
|
|
401
|
+
*/
|
|
402
|
+
kindOfQuantity?: string;
|
|
403
|
+
/** Metadata of the enumeration backing this value, when it is enumeration-backed. */
|
|
404
|
+
enumeration?: EnumerationInfo<number>;
|
|
405
|
+
} | {
|
|
406
|
+
/** The primitive value type. */
|
|
407
|
+
type: Extract<PrimitiveValueType, "Double">;
|
|
408
|
+
/**
|
|
409
|
+
* Full name of the KindOfQuantity associated with this property (e.g., `"Units.LENGTH"`).
|
|
410
|
+
* Determines how the value should be formatted and which units to display.
|
|
411
|
+
*/
|
|
412
|
+
kindOfQuantity?: string;
|
|
413
|
+
enumeration?: undefined;
|
|
414
|
+
} | {
|
|
415
|
+
/** The primitive value type. */
|
|
416
|
+
type: Exclude<PrimitiveValueType, "Integer" | "Long" | "Double" | "String">;
|
|
417
|
+
kindOfQuantity?: undefined;
|
|
418
|
+
enumeration?: undefined;
|
|
419
|
+
});
|
|
420
|
+
/**
|
|
421
|
+
* Metadata about the enumeration backing a primitive value. Preserved on a
|
|
422
|
+
* `PrimitiveValueDescriptor` so consumers can map raw enum values to their display labels
|
|
423
|
+
* without re-reading schema.
|
|
424
|
+
* @public
|
|
425
|
+
*/
|
|
426
|
+
interface EnumerationInfo<TValue extends string | number = string | number> {
|
|
427
|
+
/** Name of the enumeration type (e.g., `"MySchema.MyEnum"` for schema-backed enums). */
|
|
428
|
+
name: string;
|
|
429
|
+
/** When `true`, values are restricted to the declared enumerators. */
|
|
430
|
+
isStrict: boolean;
|
|
431
|
+
/** The declared enumerators. */
|
|
432
|
+
enumerators: EnumeratorInfo<TValue>[];
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* A single enumerator of an `EnumerationInfo`.
|
|
436
|
+
* @public
|
|
437
|
+
*/
|
|
438
|
+
interface EnumeratorInfo<TValue extends string | number = string | number> {
|
|
439
|
+
/** Display label for the enumerator. */
|
|
440
|
+
label: string;
|
|
441
|
+
/** The enumerator's raw value (string- or integer-backed, per the owning descriptor's `type`). */
|
|
442
|
+
value: TValue;
|
|
443
|
+
/** Optional description. */
|
|
444
|
+
description?: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Describes a named struct value with typed members.
|
|
448
|
+
* @public
|
|
449
|
+
*/
|
|
450
|
+
export interface StructValueDescriptor {
|
|
451
|
+
kind: "struct";
|
|
452
|
+
/** The list of named, typed members that make up this struct. */
|
|
453
|
+
members: StructMember[];
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Describes a single member of a `StructValueDescriptor`.
|
|
457
|
+
* @public
|
|
458
|
+
*/
|
|
459
|
+
interface StructMember {
|
|
460
|
+
/** The member's property name. */
|
|
461
|
+
name: string;
|
|
462
|
+
/** A human-readable label for display purposes. */
|
|
463
|
+
label: string;
|
|
464
|
+
/** The type descriptor for this member's value. */
|
|
465
|
+
type: ValueDescriptor;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Describes an ordered collection of values of a single element type.
|
|
469
|
+
* @public
|
|
470
|
+
*/
|
|
471
|
+
export interface ArrayValueDescriptor {
|
|
472
|
+
kind: "array";
|
|
473
|
+
/** The type descriptor for each element in the array. */
|
|
474
|
+
elementType: ValueDescriptor;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Describes a navigation property value — a reference to another EC instance.
|
|
478
|
+
* The runtime value is the referenced instance's id (`Id64String`); this descriptor
|
|
479
|
+
* additionally carries the reference's target class name as metadata, so consumers can
|
|
480
|
+
* build selects against the referenced instance (e.g. to resolve its label).
|
|
481
|
+
* @public
|
|
482
|
+
*/
|
|
483
|
+
export interface NavigationValueDescriptor {
|
|
484
|
+
kind: "navigation";
|
|
485
|
+
/**
|
|
486
|
+
* Full name of the relationship's target-constraint class the navigation points at
|
|
487
|
+
* (the referenced instance's class, or its base constraint class).
|
|
488
|
+
*/
|
|
489
|
+
targetClassName: EC.FullClassNameDotNotation;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Describes a single step through an ECRelationship from source ECClass to target ECClass.
|
|
493
|
+
* @public
|
|
494
|
+
*/
|
|
495
|
+
export interface RelationshipPathStep {
|
|
496
|
+
/** Full name of the source ECClass */
|
|
497
|
+
sourceClassName: EC.FullClassNameDotNotation;
|
|
498
|
+
/** Full name of the target ECClass */
|
|
499
|
+
targetClassName: EC.FullClassNameDotNotation;
|
|
500
|
+
/** Full name of the ECRelationshipClass */
|
|
501
|
+
relationshipName: EC.FullClassNameDotNotation;
|
|
502
|
+
/**
|
|
503
|
+
* Indicates that the relationship direction be reversed. This should be set to `true` when step direction
|
|
504
|
+
* doesn't match relationship direction, e.g. relationship is from source `A` to target `B` and the step
|
|
505
|
+
* describes a step from `B` to `A`.
|
|
506
|
+
*/
|
|
507
|
+
relationshipReverse?: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Optional filter applied to instances at this step.
|
|
510
|
+
* Only instances matching the filter will be included when traversing this relationship.
|
|
511
|
+
* The filter expression can reference target class properties and, for non-navigation-property
|
|
512
|
+
* relationships (link table relationships), also relationship class properties.
|
|
513
|
+
* Referencing relationship class properties via `relationshipAlias` is not supported for
|
|
514
|
+
* navigation-property steps because the relationship table is not part of the query in that case.
|
|
515
|
+
*/
|
|
516
|
+
instanceFilter?: {
|
|
517
|
+
/**
|
|
518
|
+
* ECSQL WHERE clause expression (without the WHERE keyword).
|
|
519
|
+
*
|
|
520
|
+
* Use `targetAlias` (defaults to `"this"`) followed by a dot to reference properties
|
|
521
|
+
* of the filtered class, and `relationshipAlias` (defaults to `"rel"`) to reference
|
|
522
|
+
* properties on the relationship class. At query generation time, the pipeline replaces
|
|
523
|
+
* all `{alias}.` occurrences (in both their bare `{alias}.` and bracket-quoted `[{alias}].`
|
|
524
|
+
* forms) with the actual query aliases.
|
|
525
|
+
*
|
|
526
|
+
* @example
|
|
527
|
+
* ```
|
|
528
|
+
* expression: "this.Area > :minArea AND rel.Priority > 0"
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
expression: string;
|
|
532
|
+
/**
|
|
533
|
+
* The placeholder used in `expression` to reference the target class (`targetClassName`).
|
|
534
|
+
* Every occurrence of `{targetAlias}.` in the expression, whether bare (`{targetAlias}.`)
|
|
535
|
+
* or bracket-quoted (`[{targetAlias}].`), will be replaced with the actual query alias at
|
|
536
|
+
* query generation time.
|
|
537
|
+
*
|
|
538
|
+
* @default "this"
|
|
539
|
+
*/
|
|
540
|
+
targetAlias?: string;
|
|
541
|
+
/**
|
|
542
|
+
* The placeholder used in `expression` to reference the relationship class (`relationshipName`).
|
|
543
|
+
* Every occurrence of `{relationshipAlias}.` in the expression, whether bare (`{relationshipAlias}.`)
|
|
544
|
+
* or bracket-quoted (`[{relationshipAlias}].`), will be replaced with the actual relationship alias
|
|
545
|
+
* at query generation time.
|
|
546
|
+
*
|
|
547
|
+
* Only meaningful for non-navigation-property (link table) relationships. When the step uses a
|
|
548
|
+
* navigation property, the relationship table is not part of the query, so any reference via
|
|
549
|
+
* this alias will produce invalid ECSQL.
|
|
550
|
+
*
|
|
551
|
+
* @default "rel"
|
|
552
|
+
*/
|
|
553
|
+
relationshipAlias?: string;
|
|
554
|
+
/**
|
|
555
|
+
* Bind values for the expression, keyed by parameter name.
|
|
556
|
+
*/
|
|
557
|
+
bindings?: Record<string, ECSqlBinding>;
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Describes a path from source ECClass to target ECClass through multiple ECRelationships.
|
|
562
|
+
* @public
|
|
563
|
+
*/
|
|
564
|
+
export type RelationshipPath<TStep extends RelationshipPathStep = RelationshipPathStep> = TStep[];
|
|
565
|
+
/**
|
|
566
|
+
* Finds a class with the specified full class name using the given `ECSchemaProvider`.
|
|
567
|
+
* @throws Error if the schema or class is not found.
|
|
568
|
+
* @public
|
|
569
|
+
*/
|
|
570
|
+
export declare function getClass(schemaProvider: Pick<ECSchemaProvider, "getSchema">, fullClassName: EC.FullClassNameDotNotation): Promise<EC.Class>;
|
|
571
|
+
export {};
|
|
572
|
+
//# sourceMappingURL=Metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Metadata.d.ts","sourceRoot":"","sources":["../../src/shared/Metadata.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE9D;;;;;;OAMG;IACH,gBAAgB,CACd,oBAAoB,EAAE,EAAE,CAAC,wBAAwB,EACjD,0BAA0B,EAAE,EAAE,CAAC,wBAAwB,GACtD,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAE9B;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,eAAe,EAAE,EAAE,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;CACpH;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,2BAA2B,CAAC;AAC7F,cAAc;AACd,UAAU,0BAA0B;IAClC,mDAAmD;IACnD,QAAQ,EAAE,EAAE,CAAC,wBAAwB,CAAC;IACtC,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,QAAQ,EAAE,2BAA2B,EAAE,CAAC;CACzC;AACD,cAAc;AACd,UAAU,2BAA2B;IACnC,mDAAmD;IACnD,QAAQ,EAAE,EAAE,CAAC,wBAAwB,C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EAAE,EAAE,CAAC,wBAAwB,CAAC;IAC7C,sCAAsC;IACtC,eAAe,EAAE,EAAE,CAAC,wBAAwB,CAAC;IAC7C,2CAA2C;IAC3C,gBAAgB,EAAE,EAAE,CAAC,wBAAwB,CAAC;IAC9C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE;QACf;;;;;;;;;;;;;WAaG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;;;;;;WAOG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;;;;;;;;;;WAWG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;KACzC,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,oBAAoB,GAAG,oBAAoB,IAAI,KAAK,EAAE,CAAC;AAElG;;;;GAIG;AACH,wBAAsB,QAAQ,CAC5B,cAAc,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EACnD,aAAa,EAAE,EAAE,CAAC,wBAAwB,GACzC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAWnB"}
|
|
@@ -6,7 +6,10 @@ import { LRUMap } from "@itwin/core-bentley";
|
|
|
6
6
|
import { parseFullClassName } from "./Utils.js";
|
|
7
7
|
/**
|
|
8
8
|
* Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
|
|
9
|
+
*
|
|
9
10
|
* @public
|
|
11
|
+
* @deprecated in 2.0. Use `createECSchemaProvider` from `@itwin/presentation-core-interop` instead - the created
|
|
12
|
+
* `ECSchemaProvider` exposes `classDerivesFrom` directly, without the need for a separate class hierarchy inspector.
|
|
10
13
|
*/
|
|
11
14
|
export function createCachingECClassHierarchyInspector(props) {
|
|
12
15
|
const map = new LRUMap(props.cacheSize ?? 0);
|
|
@@ -18,8 +21,9 @@ export function createCachingECClassHierarchyInspector(props) {
|
|
|
18
21
|
const cacheKey = createCacheKey(derivedClassFullName, candidateBaseClassFullName);
|
|
19
22
|
let result = map.get(cacheKey);
|
|
20
23
|
if (result === undefined) {
|
|
21
|
-
result =
|
|
22
|
-
const
|
|
24
|
+
result = getClass(props.schemaProvider, derivedClassFullName).then((derivedClass) => {
|
|
25
|
+
const { schemaName: candidateBaseClassSchemaName, className: candidateBaseClassName } = parseFullClassName(candidateBaseClassFullName);
|
|
26
|
+
const resolvedResult = derivedClass.is(candidateBaseClassName, candidateBaseClassSchemaName);
|
|
23
27
|
map.set(cacheKey, resolvedResult);
|
|
24
28
|
return resolvedResult;
|
|
25
29
|
});
|
|
@@ -40,7 +44,7 @@ export async function getClass(schemaProvider, fullClassName) {
|
|
|
40
44
|
if (!schema) {
|
|
41
45
|
throw new Error(`Schema "${schemaName}" not found.`);
|
|
42
46
|
}
|
|
43
|
-
const lookupClass =
|
|
47
|
+
const lookupClass = schema.getClass(className);
|
|
44
48
|
if (!lookupClass) {
|
|
45
49
|
throw new Error(`Class "${className}" not found in schema "${schemaName}".`);
|
|
46
50
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../src/shared/Metadata.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA+FhD;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CAAC,KAMtD;IACC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAqC,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC;IACjF,SAAS,cAAc,CAAC,gBAA6C,EAAE,aAA0C;QAC/G,OAAO,GAAG,gBAAgB,IAAI,aAAa,EAAE,CAAC;IAChD,CAAC;IACD,OAAO;QACL,gBAAgB,C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I,KAAK,CAAC,UAAU,SAAS,0BAA0B,UAAU,IAAI,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { EC } from "./Metadata.js";
|
|
1
2
|
/**
|
|
2
3
|
* An utility to parse schema and class names from full class name, where
|
|
3
4
|
* schema and class names are separated by either `:` or `.`.
|
|
5
|
+
*
|
|
6
|
+
* @throws Error if the provided full class name is not valid.
|
|
4
7
|
* @public
|
|
5
8
|
*/
|
|
6
9
|
export declare function parseFullClassName(fullClassName: string): {
|
|
@@ -10,15 +13,11 @@ export declare function parseFullClassName(fullClassName: string): {
|
|
|
10
13
|
/**
|
|
11
14
|
* An utility to normalize full class name from either `SchemaName:ClassName` or
|
|
12
15
|
* `SchemaName.ClassName` to always use the dot format.
|
|
16
|
+
*
|
|
17
|
+
* @throws Error if the provided full class name is not valid.
|
|
13
18
|
* @public
|
|
14
19
|
*/
|
|
15
|
-
export declare function normalizeFullClassName(fullClassName: string):
|
|
16
|
-
/**
|
|
17
|
-
* An utility that compares two full class names in a case insensitive way, ignoring different
|
|
18
|
-
* supported schema-class name separators (`.` or `:`).
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare function compareFullClassNames(lhs: string, rhs: string): number;
|
|
20
|
+
export declare function normalizeFullClassName(fullClassName: string): EC.FullClassNameDotNotation;
|
|
22
21
|
/**
|
|
23
22
|
* An utility to remove all extra whitespace from a given string.
|
|
24
23
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/shared/Utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;IAmB7C,UAAU;IAA+B,SAAS;EAC5D;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,EAAE,CAAC,wBAAwB,CAGzF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACpD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAc5E;;;;;GAKG;AACH,wBAAsB,iBAAiB,kBAEtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0CAA0C,CAAC,mBAAmB,SAAK,SAEtE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGzD"}
|