@itwin/ecschema-metadata 4.0.0-dev.1 → 4.0.0-dev.100

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 (135) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/lib/cjs/Constants.d.ts +23 -23
  3. package/lib/cjs/Constants.js +33 -33
  4. package/lib/cjs/Constants.js.map +1 -1
  5. package/lib/cjs/Context.d.ts +139 -139
  6. package/lib/cjs/Context.js +204 -204
  7. package/lib/cjs/DelayedPromise.d.ts +88 -88
  8. package/lib/cjs/DelayedPromise.d.ts.map +1 -1
  9. package/lib/cjs/DelayedPromise.js +91 -91
  10. package/lib/cjs/DelayedPromise.js.map +1 -1
  11. package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
  12. package/lib/cjs/Deserialization/AbstractParser.d.ts.map +1 -1
  13. package/lib/cjs/Deserialization/AbstractParser.js +11 -11
  14. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  15. package/lib/cjs/Deserialization/Helper.d.ts +251 -251
  16. package/lib/cjs/Deserialization/Helper.js +843 -843
  17. package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
  18. package/lib/cjs/Deserialization/JsonParser.d.ts.map +1 -1
  19. package/lib/cjs/Deserialization/JsonParser.js +680 -680
  20. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  21. package/lib/cjs/Deserialization/JsonProps.d.ts +268 -282
  22. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  23. package/lib/cjs/Deserialization/JsonProps.js +9 -9
  24. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  25. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
  26. package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
  27. package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
  28. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  29. package/lib/cjs/Deserialization/XmlParser.js +973 -973
  30. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  31. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
  32. package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
  33. package/lib/cjs/ECName.d.ts +30 -30
  34. package/lib/cjs/ECName.js +85 -85
  35. package/lib/cjs/ECObjects.d.ts +162 -162
  36. package/lib/cjs/ECObjects.js +453 -453
  37. package/lib/cjs/Exception.d.ts +43 -43
  38. package/lib/cjs/Exception.d.ts.map +1 -1
  39. package/lib/cjs/Exception.js +84 -86
  40. package/lib/cjs/Exception.js.map +1 -1
  41. package/lib/cjs/Interfaces.d.ts +66 -66
  42. package/lib/cjs/Interfaces.d.ts.map +1 -1
  43. package/lib/cjs/Interfaces.js +9 -9
  44. package/lib/cjs/Metadata/Class.d.ts +243 -243
  45. package/lib/cjs/Metadata/Class.js +558 -558
  46. package/lib/cjs/Metadata/Class.js.map +1 -1
  47. package/lib/cjs/Metadata/Constant.d.ts +64 -64
  48. package/lib/cjs/Metadata/Constant.js +123 -123
  49. package/lib/cjs/Metadata/Constant.js.map +1 -1
  50. package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
  51. package/lib/cjs/Metadata/CustomAttribute.js +27 -27
  52. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
  53. package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
  54. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  55. package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
  56. package/lib/cjs/Metadata/EntityClass.js +230 -230
  57. package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
  58. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  59. package/lib/cjs/Metadata/Enumeration.js +159 -159
  60. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  61. package/lib/cjs/Metadata/Format.d.ts +98 -98
  62. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  63. package/lib/cjs/Metadata/Format.js +242 -242
  64. package/lib/cjs/Metadata/Format.js.map +1 -1
  65. package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
  66. package/lib/cjs/Metadata/InvertedUnit.js +97 -97
  67. package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
  68. package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
  69. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  70. package/lib/cjs/Metadata/Mixin.d.ts +54 -54
  71. package/lib/cjs/Metadata/Mixin.js +113 -113
  72. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  73. package/lib/cjs/Metadata/OverrideFormat.d.ts +67 -55
  74. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  75. package/lib/cjs/Metadata/OverrideFormat.js +126 -88
  76. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  77. package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
  78. package/lib/cjs/Metadata/Phenomenon.js +59 -59
  79. package/lib/cjs/Metadata/Property.d.ts +197 -197
  80. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  81. package/lib/cjs/Metadata/Property.js +491 -491
  82. package/lib/cjs/Metadata/Property.js.map +1 -1
  83. package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
  84. package/lib/cjs/Metadata/PropertyCategory.js +61 -61
  85. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  86. package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
  87. package/lib/cjs/Metadata/RelationshipClass.js +349 -349
  88. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  89. package/lib/cjs/Metadata/Schema.d.ts +291 -291
  90. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  91. package/lib/cjs/Metadata/Schema.js +520 -520
  92. package/lib/cjs/Metadata/Schema.js.map +1 -1
  93. package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
  94. package/lib/cjs/Metadata/SchemaItem.js +136 -136
  95. package/lib/cjs/Metadata/Unit.d.ts +76 -76
  96. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  97. package/lib/cjs/Metadata/Unit.js +162 -162
  98. package/lib/cjs/Metadata/Unit.js.map +1 -1
  99. package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
  100. package/lib/cjs/Metadata/UnitSystem.js +29 -29
  101. package/lib/cjs/PropertyTypes.d.ts +49 -49
  102. package/lib/cjs/PropertyTypes.js +91 -91
  103. package/lib/cjs/PropertyTypes.js.map +1 -1
  104. package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
  105. package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
  106. package/lib/cjs/SchemaJsonLocater.js +42 -42
  107. package/lib/cjs/SchemaKey.d.ts +110 -110
  108. package/lib/cjs/SchemaKey.js +219 -219
  109. package/lib/cjs/SchemaLoader.d.ts +23 -23
  110. package/lib/cjs/SchemaLoader.js +47 -47
  111. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
  112. package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
  113. package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
  114. package/lib/cjs/UnitConversion/Graph.js +83 -83
  115. package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
  116. package/lib/cjs/UnitConversion/Parser.js +42 -42
  117. package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
  118. package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
  119. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  120. package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
  121. package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
  122. package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
  123. package/lib/cjs/UnitConversion/UnitTree.js +169 -169
  124. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
  125. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  126. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +234 -236
  127. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  128. package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
  129. package/lib/cjs/Validation/SchemaWalker.js +53 -53
  130. package/lib/cjs/ecschema-metadata.d.ts +51 -51
  131. package/lib/cjs/ecschema-metadata.js +100 -96
  132. package/lib/cjs/ecschema-metadata.js.map +1 -1
  133. package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
  134. package/lib/cjs/utils/SchemaGraph.js +65 -65
  135. package/package.json +13 -14
@@ -1,244 +1,244 @@
1
- /** @packageDocumentation
2
- * @module Metadata
3
- */
4
- import { ClassProps } from "../Deserialization/JsonProps";
5
- import { ECClassModifier, PrimitiveType, SchemaItemType } from "../ECObjects";
6
- import { AnyClass, LazyLoadedECClass } from "../Interfaces";
7
- import { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet } from "./CustomAttribute";
8
- import { Enumeration } from "./Enumeration";
9
- import { EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty } from "./Property";
10
- import { Schema } from "./Schema";
11
- import { SchemaItem } from "./SchemaItem";
12
- /**
13
- * A common abstract class for all of the ECClass types.
14
- * @beta
15
- */
16
- export declare abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {
17
- protected _modifier: ECClassModifier;
18
- protected _baseClass?: LazyLoadedECClass;
19
- protected _properties?: Map<string, Property>;
20
- private _customAttributes?;
21
- private _mergedPropertyCache?;
22
- get modifier(): ECClassModifier;
23
- get baseClass(): LazyLoadedECClass | undefined;
24
- set baseClass(baseClass: LazyLoadedECClass | undefined);
25
- get properties(): IterableIterator<Property> | undefined;
26
- get customAttributes(): CustomAttributeSet | undefined;
27
- constructor(schema: Schema, name: string, modifier?: ECClassModifier);
28
- /**
29
- * Convenience method for adding an already loaded ECProperty used by create*Property methods.
30
- * @param prop The property to add.
31
- * @return The property that was added.
32
- */
33
- protected addProperty<T extends Property>(prop: T): T;
34
- /**
35
- * Deletes a property from within this class.
36
- * @param name The property name to delete, lookup is case-insensitive
37
- * @alpha
38
- */
39
- protected deleteProperty(name: string): Promise<void>;
40
- /**
41
- * Deletes a property from within this class.
42
- * @param name The property name to delete, lookup is case-insensitive
43
- * @alpha
44
- */
45
- protected deletePropertySync(name: string): void;
46
- getBaseClassSync(): ECClass | undefined;
47
- /**
48
- * Searches, case-insensitive, for a local ECProperty with the name provided.
49
- * @param name
50
- */
51
- getProperty(name: string, includeInherited?: boolean): Promise<Property | undefined>;
52
- /**
53
- * Searches, case-insensitive, for a local ECProperty with the name provided.
54
- * @param name
55
- */
56
- getPropertySync(name: string, includeInherited?: boolean): Property | undefined;
57
- /**
58
- * Searches the base class, if one exists, for the property with the name provided.
59
- * @param name The name of the inherited property to find.
60
- */
61
- getInheritedProperty(name: string): Promise<Property | undefined>;
62
- /**
63
- * Searches the base class, if one exists, for the property with the name provided.
64
- * @param name The name of the inherited property to find.
65
- */
66
- getInheritedPropertySync(name: string): Property | undefined;
67
- /**
68
- * Creates a PrimitiveECProperty.
69
- * @param name The name of property to create.
70
- * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
71
- * @throws ECObjectsStatus DuplicateProperty: thrown if a property with the same name already exists in the class.
72
- */
73
- protected createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;
74
- protected createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;
75
- /**
76
- * Creates a PrimitiveECProperty.
77
- * @param name The name of property to create.
78
- * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
79
- * @throws ECObjectsStatus DuplicateProperty: thrown if a property with the same name already exists in the class.
80
- */
81
- protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;
82
- protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;
83
- /**
84
- * Creates a PrimitiveArrayECProperty.
85
- * @param name The name of property to create.
86
- * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
87
- */
88
- protected createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;
89
- protected createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;
90
- /**
91
- * Creates a PrimitiveArrayECProperty.
92
- * @param name The name of property to create.
93
- * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
94
- */
95
- protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;
96
- protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;
97
- /**
98
- *
99
- * @param name The name of property to create.
100
- * @param structType The struct type of property to create.
101
- */
102
- protected createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;
103
- /**
104
- *
105
- * @param name The name of property to create.
106
- * @param structType The struct type of property to create.
107
- */
108
- protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty;
109
- /**
110
- *
111
- * @param name
112
- * @param type
113
- */
114
- protected createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;
115
- /**
116
- *
117
- * @param name
118
- * @param type
119
- */
120
- protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;
121
- protected loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass>;
122
- protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass;
123
- protected loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration>;
124
- protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration;
125
- /**
126
- * Save this Classes properties to an object for serializing to JSON.
127
- * @param standalone Serialization includes only this object (as opposed to the full schema).
128
- * @param includeSchemaVersion Include the Schema's version information in the serialized object.
129
- */
130
- toJSON(standalone?: boolean, includeSchemaVersion?: boolean): ClassProps;
131
- /** @internal */
132
- toXml(schemaXml: Document): Promise<Element>;
133
- fromJSONSync(classProps: ClassProps): void;
134
- fromJSON(classProps: ClassProps): Promise<void>;
135
- protected addCustomAttribute(customAttribute: CustomAttribute): void;
136
- /**
137
- * Iterates (recursively) over all base classes and mixins, in "property override" order.
138
- * This is essentially a depth-first traversal through the inheritance tree.
139
- */
140
- getAllBaseClasses(): AsyncIterableIterator<ECClass>;
141
- getAllBaseClassesSync(): Iterable<AnyClass>;
142
- protected static mergeProperties(target: Property[], existingValues: Map<string, number>, propertiesToMerge: Property[], overwriteExisting: boolean): void;
143
- protected buildPropertyCache(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): Promise<void>;
144
- protected buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): void;
145
- /**
146
- * Iterates all properties, including the ones merged from base classes and mixins. To obtain only local properties, use the 'properties' field.
147
- * Since this is an expensive operation, results will be cached after first call.
148
- * @param resetCache if true, any previously cached results will be dropped and cache will be rebuilt
149
- */
150
- getPropertiesSync(resetCache?: boolean): Property[];
151
- /**
152
- * Iterates all properties, including the ones merged from base classes and mixins. To obtain only local properties, use the 'properties' field.
153
- * Since this is an expensive operation, results will be cached after first call.
154
- * @param resetCache if true, any previously cached results will be dropped and cache will be rebuilt
155
- */
156
- getProperties(resetCache?: boolean): Promise<Property[]>;
157
- /**
158
- * Retrieve all custom attributes in the current class and its bases
159
- * This is the async version of getCustomAttributesSync()
160
- */
161
- getCustomAttributes(): Promise<CustomAttributeSet>;
162
- /**
163
- * Retrieve all custom attributes in the current class and its bases.
164
- */
165
- getCustomAttributesSync(): CustomAttributeSet;
166
- /**
167
- * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback
168
- * function for each base class encountered.
169
- * @param callback The function to call for each base class in the hierarchy.
170
- * @param arg An argument that will be passed as the second parameter to the callback function.
171
- */
172
- traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean>;
173
- /**
174
- * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback
175
- * function for each base class encountered.
176
- * @param callback The function to call for each base class in the hierarchy.
177
- * @param arg An argument that will be passed as the second parameter to the callback function.
178
- */
179
- traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean;
180
- /**
181
- * Indicates if the targetClass is of this type.
182
- * @param targetClass The ECClass or ECClass name to check.
183
- * @param schemaName The schema name. Required if targetClass is the ECClass name.
184
- */
185
- is(targetClass: string, schemaName: string): Promise<boolean>;
186
- is(targetClass: ECClass): Promise<boolean>;
187
- /**
188
- * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.
189
- * @param targetClass The class to check.
190
- */
191
- isSync(targetClass: ECClass): boolean;
192
- /**
193
- * @internal
194
- */
195
- static isECClass(object: any): object is ECClass;
196
- /**
197
- * @alpha
198
- * A setter method used specifically for schema editing.
199
- * @param modifier
200
- */
201
- protected setModifier(modifier: ECClassModifier): void;
202
- }
203
- /**
204
- * A Typescript class representation of an ECStructClass.
205
- * @beta
206
- */
207
- export declare class StructClass extends ECClass {
208
- readonly schemaItemType: SchemaItemType.StructClass;
209
- constructor(schema: Schema, name: string, modifier?: ECClassModifier);
210
- }
211
- /**
212
- * @internal
213
- * An abstract class used for schema editing.
214
- */
215
- export declare abstract class MutableStructClass extends StructClass {
216
- abstract setDisplayLabel(displayLabel: string): void;
217
- }
218
- /**
219
- * Hackish approach that works like a "friend class" so we can access protected members without making them public.
220
- * @internal
221
- */
222
- export declare abstract class MutableClass extends ECClass {
223
- abstract addCustomAttribute(customAttribute: CustomAttribute): void;
224
- abstract setModifier(modifier: ECClassModifier): void;
225
- abstract createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;
226
- abstract createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;
227
- abstract createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
228
- abstract createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;
229
- abstract createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;
230
- abstract createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
231
- abstract createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;
232
- abstract createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;
233
- abstract createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
234
- abstract createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;
235
- abstract createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;
236
- abstract createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
237
- abstract createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;
238
- abstract createStructPropertySync(name: string, structType: string | StructClass): StructProperty;
239
- abstract createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;
240
- abstract createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;
241
- abstract deleteProperty(name: string): Promise<void>;
242
- abstract deletePropertySync(name: string): void;
243
- }
1
+ /** @packageDocumentation
2
+ * @module Metadata
3
+ */
4
+ import { ClassProps } from "../Deserialization/JsonProps";
5
+ import { ECClassModifier, PrimitiveType, SchemaItemType } from "../ECObjects";
6
+ import { AnyClass, LazyLoadedECClass } from "../Interfaces";
7
+ import { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet } from "./CustomAttribute";
8
+ import { Enumeration } from "./Enumeration";
9
+ import { EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty } from "./Property";
10
+ import { Schema } from "./Schema";
11
+ import { SchemaItem } from "./SchemaItem";
12
+ /**
13
+ * A common abstract class for all of the ECClass types.
14
+ * @beta
15
+ */
16
+ export declare abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {
17
+ protected _modifier: ECClassModifier;
18
+ protected _baseClass?: LazyLoadedECClass;
19
+ protected _properties?: Map<string, Property>;
20
+ private _customAttributes?;
21
+ private _mergedPropertyCache?;
22
+ get modifier(): ECClassModifier;
23
+ get baseClass(): LazyLoadedECClass | undefined;
24
+ set baseClass(baseClass: LazyLoadedECClass | undefined);
25
+ get properties(): IterableIterator<Property> | undefined;
26
+ get customAttributes(): CustomAttributeSet | undefined;
27
+ constructor(schema: Schema, name: string, modifier?: ECClassModifier);
28
+ /**
29
+ * Convenience method for adding an already loaded ECProperty used by create*Property methods.
30
+ * @param prop The property to add.
31
+ * @return The property that was added.
32
+ */
33
+ protected addProperty<T extends Property>(prop: T): T;
34
+ /**
35
+ * Deletes a property from within this class.
36
+ * @param name The property name to delete, lookup is case-insensitive
37
+ * @alpha
38
+ */
39
+ protected deleteProperty(name: string): Promise<void>;
40
+ /**
41
+ * Deletes a property from within this class.
42
+ * @param name The property name to delete, lookup is case-insensitive
43
+ * @alpha
44
+ */
45
+ protected deletePropertySync(name: string): void;
46
+ getBaseClassSync(): ECClass | undefined;
47
+ /**
48
+ * Searches, case-insensitive, for a local ECProperty with the name provided.
49
+ * @param name
50
+ */
51
+ getProperty(name: string, includeInherited?: boolean): Promise<Property | undefined>;
52
+ /**
53
+ * Searches, case-insensitive, for a local ECProperty with the name provided.
54
+ * @param name
55
+ */
56
+ getPropertySync(name: string, includeInherited?: boolean): Property | undefined;
57
+ /**
58
+ * Searches the base class, if one exists, for the property with the name provided.
59
+ * @param name The name of the inherited property to find.
60
+ */
61
+ getInheritedProperty(name: string): Promise<Property | undefined>;
62
+ /**
63
+ * Searches the base class, if one exists, for the property with the name provided.
64
+ * @param name The name of the inherited property to find.
65
+ */
66
+ getInheritedPropertySync(name: string): Property | undefined;
67
+ /**
68
+ * Creates a PrimitiveECProperty.
69
+ * @param name The name of property to create.
70
+ * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
71
+ * @throws ECObjectsStatus DuplicateProperty: thrown if a property with the same name already exists in the class.
72
+ */
73
+ protected createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;
74
+ protected createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;
75
+ /**
76
+ * Creates a PrimitiveECProperty.
77
+ * @param name The name of property to create.
78
+ * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
79
+ * @throws ECObjectsStatus DuplicateProperty: thrown if a property with the same name already exists in the class.
80
+ */
81
+ protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;
82
+ protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;
83
+ /**
84
+ * Creates a PrimitiveArrayECProperty.
85
+ * @param name The name of property to create.
86
+ * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
87
+ */
88
+ protected createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;
89
+ protected createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;
90
+ /**
91
+ * Creates a PrimitiveArrayECProperty.
92
+ * @param name The name of property to create.
93
+ * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer
94
+ */
95
+ protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;
96
+ protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;
97
+ /**
98
+ *
99
+ * @param name The name of property to create.
100
+ * @param structType The struct type of property to create.
101
+ */
102
+ protected createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;
103
+ /**
104
+ *
105
+ * @param name The name of property to create.
106
+ * @param structType The struct type of property to create.
107
+ */
108
+ protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty;
109
+ /**
110
+ *
111
+ * @param name
112
+ * @param type
113
+ */
114
+ protected createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;
115
+ /**
116
+ *
117
+ * @param name
118
+ * @param type
119
+ */
120
+ protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;
121
+ protected loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass>;
122
+ protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass;
123
+ protected loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration>;
124
+ protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration;
125
+ /**
126
+ * Save this Classes properties to an object for serializing to JSON.
127
+ * @param standalone Serialization includes only this object (as opposed to the full schema).
128
+ * @param includeSchemaVersion Include the Schema's version information in the serialized object.
129
+ */
130
+ toJSON(standalone?: boolean, includeSchemaVersion?: boolean): ClassProps;
131
+ /** @internal */
132
+ toXml(schemaXml: Document): Promise<Element>;
133
+ fromJSONSync(classProps: ClassProps): void;
134
+ fromJSON(classProps: ClassProps): Promise<void>;
135
+ protected addCustomAttribute(customAttribute: CustomAttribute): void;
136
+ /**
137
+ * Iterates (recursively) over all base classes and mixins, in "property override" order.
138
+ * This is essentially a depth-first traversal through the inheritance tree.
139
+ */
140
+ getAllBaseClasses(): AsyncIterableIterator<ECClass>;
141
+ getAllBaseClassesSync(): Iterable<AnyClass>;
142
+ protected static mergeProperties(target: Property[], existingValues: Map<string, number>, propertiesToMerge: Property[], overwriteExisting: boolean): void;
143
+ protected buildPropertyCache(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): Promise<void>;
144
+ protected buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): void;
145
+ /**
146
+ * Iterates all properties, including the ones merged from base classes and mixins. To obtain only local properties, use the 'properties' field.
147
+ * Since this is an expensive operation, results will be cached after first call.
148
+ * @param resetCache if true, any previously cached results will be dropped and cache will be rebuilt
149
+ */
150
+ getPropertiesSync(resetCache?: boolean): Property[];
151
+ /**
152
+ * Iterates all properties, including the ones merged from base classes and mixins. To obtain only local properties, use the 'properties' field.
153
+ * Since this is an expensive operation, results will be cached after first call.
154
+ * @param resetCache if true, any previously cached results will be dropped and cache will be rebuilt
155
+ */
156
+ getProperties(resetCache?: boolean): Promise<Property[]>;
157
+ /**
158
+ * Retrieve all custom attributes in the current class and its bases
159
+ * This is the async version of getCustomAttributesSync()
160
+ */
161
+ getCustomAttributes(): Promise<CustomAttributeSet>;
162
+ /**
163
+ * Retrieve all custom attributes in the current class and its bases.
164
+ */
165
+ getCustomAttributesSync(): CustomAttributeSet;
166
+ /**
167
+ * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback
168
+ * function for each base class encountered.
169
+ * @param callback The function to call for each base class in the hierarchy.
170
+ * @param arg An argument that will be passed as the second parameter to the callback function.
171
+ */
172
+ traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean>;
173
+ /**
174
+ * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback
175
+ * function for each base class encountered.
176
+ * @param callback The function to call for each base class in the hierarchy.
177
+ * @param arg An argument that will be passed as the second parameter to the callback function.
178
+ */
179
+ traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean;
180
+ /**
181
+ * Indicates if the targetClass is of this type.
182
+ * @param targetClass The ECClass or ECClass name to check.
183
+ * @param schemaName The schema name. Required if targetClass is the ECClass name.
184
+ */
185
+ is(targetClass: string, schemaName: string): Promise<boolean>;
186
+ is(targetClass: ECClass): Promise<boolean>;
187
+ /**
188
+ * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.
189
+ * @param targetClass The class to check.
190
+ */
191
+ isSync(targetClass: ECClass): boolean;
192
+ /**
193
+ * @internal
194
+ */
195
+ static isECClass(object: any): object is ECClass;
196
+ /**
197
+ * @alpha
198
+ * A setter method used specifically for schema editing.
199
+ * @param modifier
200
+ */
201
+ protected setModifier(modifier: ECClassModifier): void;
202
+ }
203
+ /**
204
+ * A Typescript class representation of an ECStructClass.
205
+ * @beta
206
+ */
207
+ export declare class StructClass extends ECClass {
208
+ readonly schemaItemType: SchemaItemType.StructClass;
209
+ constructor(schema: Schema, name: string, modifier?: ECClassModifier);
210
+ }
211
+ /**
212
+ * @internal
213
+ * An abstract class used for schema editing.
214
+ */
215
+ export declare abstract class MutableStructClass extends StructClass {
216
+ abstract setDisplayLabel(displayLabel: string): void;
217
+ }
218
+ /**
219
+ * Hackish approach that works like a "friend class" so we can access protected members without making them public.
220
+ * @internal
221
+ */
222
+ export declare abstract class MutableClass extends ECClass {
223
+ abstract addCustomAttribute(customAttribute: CustomAttribute): void;
224
+ abstract setModifier(modifier: ECClassModifier): void;
225
+ abstract createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;
226
+ abstract createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;
227
+ abstract createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
228
+ abstract createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;
229
+ abstract createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;
230
+ abstract createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
231
+ abstract createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;
232
+ abstract createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;
233
+ abstract createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
234
+ abstract createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;
235
+ abstract createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;
236
+ abstract createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
237
+ abstract createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;
238
+ abstract createStructPropertySync(name: string, structType: string | StructClass): StructProperty;
239
+ abstract createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;
240
+ abstract createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;
241
+ abstract deleteProperty(name: string): Promise<void>;
242
+ abstract deletePropertySync(name: string): void;
243
+ }
244
244
  //# sourceMappingURL=Class.d.ts.map