@itwin/ecschema-metadata 3.5.0-dev.28 → 3.5.0-dev.29

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 (140) hide show
  1. package/lib/cjs/Constants.d.ts +23 -23
  2. package/lib/cjs/Constants.js +33 -33
  3. package/lib/cjs/Constants.js.map +1 -1
  4. package/lib/cjs/Context.d.ts +139 -139
  5. package/lib/cjs/Context.js +204 -204
  6. package/lib/cjs/DelayedPromise.d.ts +88 -88
  7. package/lib/cjs/DelayedPromise.js +91 -91
  8. package/lib/cjs/DelayedPromise.js.map +1 -1
  9. package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
  10. package/lib/cjs/Deserialization/AbstractParser.js +11 -11
  11. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  12. package/lib/cjs/Deserialization/Helper.d.ts +251 -251
  13. package/lib/cjs/Deserialization/Helper.js +843 -843
  14. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  15. package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
  16. package/lib/cjs/Deserialization/JsonParser.js +680 -680
  17. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  18. package/lib/cjs/Deserialization/JsonProps.d.ts +282 -282
  19. package/lib/cjs/Deserialization/JsonProps.js +9 -9
  20. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  21. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
  22. package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
  23. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  24. package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
  25. package/lib/cjs/Deserialization/XmlParser.js +973 -973
  26. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  27. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
  28. package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
  29. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  30. package/lib/cjs/ECName.d.ts +30 -30
  31. package/lib/cjs/ECName.js +85 -85
  32. package/lib/cjs/ECName.js.map +1 -1
  33. package/lib/cjs/ECObjects.d.ts +162 -162
  34. package/lib/cjs/ECObjects.js +453 -453
  35. package/lib/cjs/ECObjects.js.map +1 -1
  36. package/lib/cjs/Exception.d.ts +43 -43
  37. package/lib/cjs/Exception.js +86 -86
  38. package/lib/cjs/Exception.js.map +1 -1
  39. package/lib/cjs/Interfaces.d.ts +66 -66
  40. package/lib/cjs/Interfaces.js +9 -9
  41. package/lib/cjs/Interfaces.js.map +1 -1
  42. package/lib/cjs/Metadata/Class.d.ts +243 -243
  43. package/lib/cjs/Metadata/Class.js +558 -558
  44. package/lib/cjs/Metadata/Class.js.map +1 -1
  45. package/lib/cjs/Metadata/Constant.d.ts +64 -64
  46. package/lib/cjs/Metadata/Constant.js +123 -123
  47. package/lib/cjs/Metadata/Constant.js.map +1 -1
  48. package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
  49. package/lib/cjs/Metadata/CustomAttribute.js +27 -27
  50. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  51. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
  52. package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
  53. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  54. package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
  55. package/lib/cjs/Metadata/EntityClass.js +230 -230
  56. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  57. package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
  58. package/lib/cjs/Metadata/Enumeration.js +159 -159
  59. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  60. package/lib/cjs/Metadata/Format.d.ts +98 -98
  61. package/lib/cjs/Metadata/Format.js +242 -242
  62. package/lib/cjs/Metadata/Format.js.map +1 -1
  63. package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
  64. package/lib/cjs/Metadata/InvertedUnit.js +97 -97
  65. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  66. package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
  67. package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
  68. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  69. package/lib/cjs/Metadata/Mixin.d.ts +54 -54
  70. package/lib/cjs/Metadata/Mixin.js +113 -113
  71. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  72. package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
  73. package/lib/cjs/Metadata/OverrideFormat.js +88 -88
  74. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  75. package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
  76. package/lib/cjs/Metadata/Phenomenon.js +59 -59
  77. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  78. package/lib/cjs/Metadata/Property.d.ts +197 -197
  79. package/lib/cjs/Metadata/Property.js +491 -491
  80. package/lib/cjs/Metadata/Property.js.map +1 -1
  81. package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
  82. package/lib/cjs/Metadata/PropertyCategory.js +61 -61
  83. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  84. package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
  85. package/lib/cjs/Metadata/RelationshipClass.js +349 -349
  86. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  87. package/lib/cjs/Metadata/Schema.d.ts +291 -291
  88. package/lib/cjs/Metadata/Schema.js +520 -520
  89. package/lib/cjs/Metadata/Schema.js.map +1 -1
  90. package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
  91. package/lib/cjs/Metadata/SchemaItem.js +136 -136
  92. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  93. package/lib/cjs/Metadata/Unit.d.ts +76 -76
  94. package/lib/cjs/Metadata/Unit.js +162 -162
  95. package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
  96. package/lib/cjs/Metadata/UnitSystem.js +29 -29
  97. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  98. package/lib/cjs/PropertyTypes.d.ts +49 -49
  99. package/lib/cjs/PropertyTypes.js +91 -91
  100. package/lib/cjs/PropertyTypes.js.map +1 -1
  101. package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
  102. package/lib/cjs/SchemaJsonLocater.js +42 -42
  103. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  104. package/lib/cjs/SchemaKey.d.ts +110 -110
  105. package/lib/cjs/SchemaKey.js +219 -219
  106. package/lib/cjs/SchemaKey.js.map +1 -1
  107. package/lib/cjs/SchemaLoader.d.ts +23 -23
  108. package/lib/cjs/SchemaLoader.js +47 -47
  109. package/lib/cjs/SchemaLoader.js.map +1 -1
  110. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
  111. package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
  112. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  113. package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
  114. package/lib/cjs/UnitConversion/Graph.js +83 -83
  115. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  116. package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
  117. package/lib/cjs/UnitConversion/Parser.js +42 -42
  118. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  119. package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
  120. package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
  121. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  122. package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
  123. package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
  124. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  125. package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
  126. package/lib/cjs/UnitConversion/UnitTree.js +169 -169
  127. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  128. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
  129. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +236 -236
  130. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  131. package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
  132. package/lib/cjs/Validation/SchemaWalker.js +53 -53
  133. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  134. package/lib/cjs/ecschema-metadata.d.ts +51 -51
  135. package/lib/cjs/ecschema-metadata.js +96 -96
  136. package/lib/cjs/ecschema-metadata.js.map +1 -1
  137. package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
  138. package/lib/cjs/utils/SchemaGraph.js +65 -65
  139. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  140. package/package.json +7 -7
@@ -1,292 +1,292 @@
1
- /** @packageDocumentation
2
- * @module Metadata
3
- */
4
- import { SchemaContext } from "../Context";
5
- import { SchemaProps } from "../Deserialization/JsonProps";
6
- import { ECClassModifier, PrimitiveType } from "../ECObjects";
7
- import { AnyClass, AnySchemaItem } from "../Interfaces";
8
- import { SchemaItemKey, SchemaKey } from "../SchemaKey";
9
- import { ECClass, StructClass } from "./Class";
10
- import { Constant } from "./Constant";
11
- import { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet } from "./CustomAttribute";
12
- import { CustomAttributeClass } from "./CustomAttributeClass";
13
- import { EntityClass } from "./EntityClass";
14
- import { Enumeration } from "./Enumeration";
15
- import { Format } from "./Format";
16
- import { InvertedUnit } from "./InvertedUnit";
17
- import { KindOfQuantity } from "./KindOfQuantity";
18
- import { Mixin } from "./Mixin";
19
- import { Phenomenon } from "./Phenomenon";
20
- import { PropertyCategory } from "./PropertyCategory";
21
- import { RelationshipClass } from "./RelationshipClass";
22
- import { SchemaItem } from "./SchemaItem";
23
- import { Unit } from "./Unit";
24
- import { UnitSystem } from "./UnitSystem";
25
- /**
26
- * @beta
27
- */
28
- export declare class Schema implements CustomAttributeContainerProps {
29
- private _context;
30
- protected _schemaKey?: SchemaKey;
31
- protected _alias?: string;
32
- protected _label?: string;
33
- protected _description?: string;
34
- readonly references: Schema[];
35
- private readonly _items;
36
- private _customAttributes?;
37
- /**
38
- * Constructs an empty Schema with the given name and version in the provided context.
39
- * @param context The SchemaContext that will control the lifetime of the schema
40
- * @param name The schema's name
41
- * @param readVersion The integer read (major) version of the schema
42
- * @param writeVersion The integer write version of the schema
43
- * @param minorVersion The integer minor version of the schema
44
- */
45
- constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);
46
- /**
47
- * Constructs an empty Schema with the given key in the provided context.
48
- * @param context The SchemaContext that will control the lifetime of the schema
49
- * @param key A SchemaKey that uniquely identifies the schema
50
- */
51
- constructor(context: SchemaContext, key: SchemaKey, alias: string);
52
- /**
53
- * Constructs an empty Schema (without a SchemaKey) in the provided context.
54
- * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.
55
- * @param context The SchemaContext that will control the lifetime of the schema
56
- * @internal
57
- */
58
- constructor(context: SchemaContext);
59
- get schemaKey(): SchemaKey;
60
- get name(): string;
61
- get readVersion(): number;
62
- get writeVersion(): number;
63
- get minorVersion(): number;
64
- get alias(): string;
65
- get label(): string | undefined;
66
- get description(): string | undefined;
67
- get customAttributes(): CustomAttributeSet | undefined;
68
- /** Returns the schema name. */
69
- get fullName(): string;
70
- /** Returns the schema. */
71
- get schema(): Schema;
72
- /** Returns the schema context this schema is within. */
73
- get context(): SchemaContext;
74
- /**
75
- * Returns a SchemaItemKey given the item name and the schema it belongs to
76
- * @param fullName fully qualified name {Schema name}.{Item Name}
77
- */
78
- getSchemaItemKey(fullName: string): SchemaItemKey;
79
- protected addItem<T extends SchemaItem>(item: T): void;
80
- /**
81
- * @alpha
82
- */
83
- protected createClass<T extends AnyClass>(type: (new (schema: Schema, name: string, modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T;
84
- /**
85
- * Deletes a class from within this schema.
86
- * @param name the local (unqualified) class name, lookup is case-insensitive
87
- * @alpha
88
- */
89
- protected deleteClass(name: string): Promise<void>;
90
- /**
91
- * Deletes a class from within this schema.
92
- * @param name the local (unqualified) class name, lookup is case-insensitive
93
- * @alpha
94
- */
95
- protected deleteClassSync(name: string): void;
96
- /**
97
- * @alpha
98
- */
99
- protected createItem<T extends AnySchemaItem>(type: (new (schema: Schema, name: string) => T), name: string): T;
100
- protected addCustomAttribute(customAttribute: CustomAttribute): void;
101
- /**
102
- * Creates a EntityClass with the provided name in this schema.
103
- * @param name
104
- * @param modifier
105
- */
106
- protected createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;
107
- protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;
108
- /**
109
- * Creates a Mixin with the provided name in this schema.
110
- * @param name
111
- */
112
- protected createMixinClass(name: string): Promise<Mixin>;
113
- protected createMixinClassSync(name: string): Mixin;
114
- /**
115
- * Creates a StructClass with the provided name in this schema.
116
- * @param name
117
- * @param modifier
118
- */
119
- protected createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;
120
- protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;
121
- /**
122
- * Creates a CustomAttributeClass with the provided name in this schema.
123
- * @param name
124
- * @param modifier
125
- */
126
- protected createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;
127
- protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;
128
- /**
129
- * Creates a RelationshipClass with the provided name in this schema.
130
- * @param name
131
- * @param modifier
132
- */
133
- protected createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;
134
- protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;
135
- /**
136
- * Creates an Enumeration with the provided name in this schema.
137
- * @param name
138
- */
139
- protected createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;
140
- protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;
141
- /**
142
- * Creates an KindOfQuantity with the provided name in this schema.
143
- * @param name
144
- */
145
- protected createKindOfQuantity(name: string): Promise<KindOfQuantity>;
146
- protected createKindOfQuantitySync(name: string): KindOfQuantity;
147
- /**
148
- * Creates a Constant with the provided name in this schema.
149
- * @param name
150
- */
151
- protected createConstant(name: string): Promise<Constant>;
152
- protected createConstantSync(name: string): Constant;
153
- /**
154
- * Creates a Inverted Unit with the provided name in this schema.
155
- * @param name
156
- */
157
- protected createInvertedUnit(name: string): Promise<InvertedUnit>;
158
- protected createInvertedUnitSync(name: string): InvertedUnit;
159
- /**
160
- * Creates an Format with the provided name in this schema.
161
- * @param name
162
- */
163
- protected createFormat(name: string): Promise<Format>;
164
- protected createFormatSync(name: string): Format;
165
- /**
166
- * Creates a UnitSystem with the provided name in this schema.
167
- * @param name
168
- */
169
- protected createUnitSystem(name: string): Promise<UnitSystem>;
170
- protected createUnitSystemSync(name: string): UnitSystem;
171
- /**
172
- * Creates a Phenomenon with the provided name in this schema.
173
- * @param name
174
- */
175
- protected createPhenomenon(name: string): Promise<Phenomenon>;
176
- protected createPhenomenonSync(name: string): Phenomenon;
177
- /**
178
- * Creates a Unit with the provided name in this schema.
179
- * @param name
180
- */
181
- protected createUnit(name: string): Promise<Unit>;
182
- protected createUnitSync(name: string): Unit;
183
- /**
184
- * Creates an PropertyCategory with the provided name in this schema.
185
- * @param name
186
- */
187
- protected createPropertyCategory(name: string): Promise<PropertyCategory>;
188
- protected createPropertyCategorySync(name: string): PropertyCategory;
189
- /**
190
- *
191
- * @param refSchema
192
- */
193
- protected addReference(refSchema: Schema): Promise<void>;
194
- protected addReferenceSync(refSchema: Schema): void;
195
- /**
196
- * @alpha Used for schema editing.
197
- */
198
- protected setContext(context: SchemaContext): void;
199
- /**
200
- * Sets the version of the SchemaKey identifying the schema.
201
- * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.
202
- * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.
203
- * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.
204
- */
205
- setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void;
206
- /**
207
- * Gets an item from within this schema. To get by full name use lookupItem instead.
208
- * @param key the local (unqualified) name, lookup is case-insensitive
209
- */
210
- getItem<T extends SchemaItem>(name: string): Promise<T | undefined>;
211
- /**
212
- * Gets an item from within this schema. To get by full name use lookupItem instead.
213
- * @param key the local (unqualified) name, lookup is case-insensitive
214
- */
215
- getItemSync<T extends SchemaItem>(name: string): T | undefined;
216
- /**
217
- * Attempts to find a schema item within this schema or a (directly) referenced schema
218
- * @param key The full name or a SchemaItemKey identifying the desired item.
219
- */
220
- lookupItem<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): Promise<T | undefined>;
221
- /**
222
- * Attempts to find a schema item within this schema or a (directly) referenced schema
223
- * @param key The full name or a SchemaItemKey identifying the desired item.
224
- */
225
- lookupItemSync<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): T | undefined;
226
- getItems<T extends AnySchemaItem>(): IterableIterator<T>;
227
- getClasses(): IterableIterator<ECClass>;
228
- getReference<T extends Schema>(refSchemaName: string): Promise<T | undefined>;
229
- getReferenceNameByAlias(alias: string): string | undefined;
230
- getReferenceSync<T extends Schema>(refSchemaName: string): T | undefined;
231
- /**
232
- * Save this Schema's properties to an object for serializing to JSON.
233
- */
234
- toJSON(): SchemaProps;
235
- /**
236
- * Converts the schema to a DOM XML Document.
237
- * @param schemaXml An empty DOM document to which the schema will be written
238
- */
239
- toXml(schemaXml: Document): Promise<Document>;
240
- fromJSONSync(schemaProps: SchemaProps): void;
241
- fromJSON(schemaProps: SchemaProps): Promise<void>;
242
- static fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema>;
243
- static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema;
244
- /**
245
- * @internal
246
- */
247
- static isSchema(object: any): object is Schema;
248
- }
249
- /**
250
- * Hackish approach that works like a "friend class" so we can access protected members without making them public.
251
- * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import
252
- * would prevent this class from extending Schema.
253
- * @internal
254
- */
255
- export declare abstract class MutableSchema extends Schema {
256
- abstract addCustomAttribute(customAttribute: CustomAttribute): void;
257
- abstract createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;
258
- abstract createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;
259
- abstract createMixinClass(name: string): Promise<Mixin>;
260
- abstract createMixinClassSync(name: string): Mixin;
261
- abstract createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;
262
- abstract createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;
263
- abstract createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;
264
- abstract createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;
265
- abstract createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;
266
- abstract createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;
267
- abstract createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;
268
- abstract createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;
269
- abstract createKindOfQuantity(name: string): Promise<KindOfQuantity>;
270
- abstract createKindOfQuantitySync(name: string): KindOfQuantity;
271
- abstract createUnit(name: string): Promise<Unit>;
272
- abstract createUnitSync(name: string): Unit;
273
- abstract createConstant(name: string): Promise<Constant>;
274
- abstract createConstantSync(name: string): Constant;
275
- abstract createInvertedUnit(name: string): Promise<InvertedUnit>;
276
- abstract createInvertedUnitSync(name: string): InvertedUnit;
277
- abstract createPhenomenon(name: string): Promise<Phenomenon>;
278
- abstract createPhenomenonSync(name: string): Phenomenon;
279
- abstract createFormat(name: string): Promise<Format>;
280
- abstract createFormatSync(name: string): Format;
281
- abstract createUnitSystem(name: string): Promise<UnitSystem>;
282
- abstract createUnitSystemSync(name: string): UnitSystem;
283
- abstract createPropertyCategory(name: string): Promise<PropertyCategory>;
284
- abstract createPropertyCategorySync(name: string): PropertyCategory;
285
- abstract addItem<T extends SchemaItem>(item: T): void;
286
- abstract addReference(refSchema: Schema): Promise<void>;
287
- abstract addReferenceSync(refSchema: Schema): void;
288
- abstract setContext(schemaContext: SchemaContext): void;
289
- abstract deleteClass(name: string): Promise<void>;
290
- abstract deleteClassSync(name: string): void;
291
- }
1
+ /** @packageDocumentation
2
+ * @module Metadata
3
+ */
4
+ import { SchemaContext } from "../Context";
5
+ import { SchemaProps } from "../Deserialization/JsonProps";
6
+ import { ECClassModifier, PrimitiveType } from "../ECObjects";
7
+ import { AnyClass, AnySchemaItem } from "../Interfaces";
8
+ import { SchemaItemKey, SchemaKey } from "../SchemaKey";
9
+ import { ECClass, StructClass } from "./Class";
10
+ import { Constant } from "./Constant";
11
+ import { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet } from "./CustomAttribute";
12
+ import { CustomAttributeClass } from "./CustomAttributeClass";
13
+ import { EntityClass } from "./EntityClass";
14
+ import { Enumeration } from "./Enumeration";
15
+ import { Format } from "./Format";
16
+ import { InvertedUnit } from "./InvertedUnit";
17
+ import { KindOfQuantity } from "./KindOfQuantity";
18
+ import { Mixin } from "./Mixin";
19
+ import { Phenomenon } from "./Phenomenon";
20
+ import { PropertyCategory } from "./PropertyCategory";
21
+ import { RelationshipClass } from "./RelationshipClass";
22
+ import { SchemaItem } from "./SchemaItem";
23
+ import { Unit } from "./Unit";
24
+ import { UnitSystem } from "./UnitSystem";
25
+ /**
26
+ * @beta
27
+ */
28
+ export declare class Schema implements CustomAttributeContainerProps {
29
+ private _context;
30
+ protected _schemaKey?: SchemaKey;
31
+ protected _alias?: string;
32
+ protected _label?: string;
33
+ protected _description?: string;
34
+ readonly references: Schema[];
35
+ private readonly _items;
36
+ private _customAttributes?;
37
+ /**
38
+ * Constructs an empty Schema with the given name and version in the provided context.
39
+ * @param context The SchemaContext that will control the lifetime of the schema
40
+ * @param name The schema's name
41
+ * @param readVersion The integer read (major) version of the schema
42
+ * @param writeVersion The integer write version of the schema
43
+ * @param minorVersion The integer minor version of the schema
44
+ */
45
+ constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);
46
+ /**
47
+ * Constructs an empty Schema with the given key in the provided context.
48
+ * @param context The SchemaContext that will control the lifetime of the schema
49
+ * @param key A SchemaKey that uniquely identifies the schema
50
+ */
51
+ constructor(context: SchemaContext, key: SchemaKey, alias: string);
52
+ /**
53
+ * Constructs an empty Schema (without a SchemaKey) in the provided context.
54
+ * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.
55
+ * @param context The SchemaContext that will control the lifetime of the schema
56
+ * @internal
57
+ */
58
+ constructor(context: SchemaContext);
59
+ get schemaKey(): SchemaKey;
60
+ get name(): string;
61
+ get readVersion(): number;
62
+ get writeVersion(): number;
63
+ get minorVersion(): number;
64
+ get alias(): string;
65
+ get label(): string | undefined;
66
+ get description(): string | undefined;
67
+ get customAttributes(): CustomAttributeSet | undefined;
68
+ /** Returns the schema name. */
69
+ get fullName(): string;
70
+ /** Returns the schema. */
71
+ get schema(): Schema;
72
+ /** Returns the schema context this schema is within. */
73
+ get context(): SchemaContext;
74
+ /**
75
+ * Returns a SchemaItemKey given the item name and the schema it belongs to
76
+ * @param fullName fully qualified name {Schema name}.{Item Name}
77
+ */
78
+ getSchemaItemKey(fullName: string): SchemaItemKey;
79
+ protected addItem<T extends SchemaItem>(item: T): void;
80
+ /**
81
+ * @alpha
82
+ */
83
+ protected createClass<T extends AnyClass>(type: (new (schema: Schema, name: string, modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T;
84
+ /**
85
+ * Deletes a class from within this schema.
86
+ * @param name the local (unqualified) class name, lookup is case-insensitive
87
+ * @alpha
88
+ */
89
+ protected deleteClass(name: string): Promise<void>;
90
+ /**
91
+ * Deletes a class from within this schema.
92
+ * @param name the local (unqualified) class name, lookup is case-insensitive
93
+ * @alpha
94
+ */
95
+ protected deleteClassSync(name: string): void;
96
+ /**
97
+ * @alpha
98
+ */
99
+ protected createItem<T extends AnySchemaItem>(type: (new (schema: Schema, name: string) => T), name: string): T;
100
+ protected addCustomAttribute(customAttribute: CustomAttribute): void;
101
+ /**
102
+ * Creates a EntityClass with the provided name in this schema.
103
+ * @param name
104
+ * @param modifier
105
+ */
106
+ protected createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;
107
+ protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;
108
+ /**
109
+ * Creates a Mixin with the provided name in this schema.
110
+ * @param name
111
+ */
112
+ protected createMixinClass(name: string): Promise<Mixin>;
113
+ protected createMixinClassSync(name: string): Mixin;
114
+ /**
115
+ * Creates a StructClass with the provided name in this schema.
116
+ * @param name
117
+ * @param modifier
118
+ */
119
+ protected createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;
120
+ protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;
121
+ /**
122
+ * Creates a CustomAttributeClass with the provided name in this schema.
123
+ * @param name
124
+ * @param modifier
125
+ */
126
+ protected createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;
127
+ protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;
128
+ /**
129
+ * Creates a RelationshipClass with the provided name in this schema.
130
+ * @param name
131
+ * @param modifier
132
+ */
133
+ protected createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;
134
+ protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;
135
+ /**
136
+ * Creates an Enumeration with the provided name in this schema.
137
+ * @param name
138
+ */
139
+ protected createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;
140
+ protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;
141
+ /**
142
+ * Creates an KindOfQuantity with the provided name in this schema.
143
+ * @param name
144
+ */
145
+ protected createKindOfQuantity(name: string): Promise<KindOfQuantity>;
146
+ protected createKindOfQuantitySync(name: string): KindOfQuantity;
147
+ /**
148
+ * Creates a Constant with the provided name in this schema.
149
+ * @param name
150
+ */
151
+ protected createConstant(name: string): Promise<Constant>;
152
+ protected createConstantSync(name: string): Constant;
153
+ /**
154
+ * Creates a Inverted Unit with the provided name in this schema.
155
+ * @param name
156
+ */
157
+ protected createInvertedUnit(name: string): Promise<InvertedUnit>;
158
+ protected createInvertedUnitSync(name: string): InvertedUnit;
159
+ /**
160
+ * Creates an Format with the provided name in this schema.
161
+ * @param name
162
+ */
163
+ protected createFormat(name: string): Promise<Format>;
164
+ protected createFormatSync(name: string): Format;
165
+ /**
166
+ * Creates a UnitSystem with the provided name in this schema.
167
+ * @param name
168
+ */
169
+ protected createUnitSystem(name: string): Promise<UnitSystem>;
170
+ protected createUnitSystemSync(name: string): UnitSystem;
171
+ /**
172
+ * Creates a Phenomenon with the provided name in this schema.
173
+ * @param name
174
+ */
175
+ protected createPhenomenon(name: string): Promise<Phenomenon>;
176
+ protected createPhenomenonSync(name: string): Phenomenon;
177
+ /**
178
+ * Creates a Unit with the provided name in this schema.
179
+ * @param name
180
+ */
181
+ protected createUnit(name: string): Promise<Unit>;
182
+ protected createUnitSync(name: string): Unit;
183
+ /**
184
+ * Creates an PropertyCategory with the provided name in this schema.
185
+ * @param name
186
+ */
187
+ protected createPropertyCategory(name: string): Promise<PropertyCategory>;
188
+ protected createPropertyCategorySync(name: string): PropertyCategory;
189
+ /**
190
+ *
191
+ * @param refSchema
192
+ */
193
+ protected addReference(refSchema: Schema): Promise<void>;
194
+ protected addReferenceSync(refSchema: Schema): void;
195
+ /**
196
+ * @alpha Used for schema editing.
197
+ */
198
+ protected setContext(context: SchemaContext): void;
199
+ /**
200
+ * Sets the version of the SchemaKey identifying the schema.
201
+ * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.
202
+ * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.
203
+ * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.
204
+ */
205
+ setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void;
206
+ /**
207
+ * Gets an item from within this schema. To get by full name use lookupItem instead.
208
+ * @param key the local (unqualified) name, lookup is case-insensitive
209
+ */
210
+ getItem<T extends SchemaItem>(name: string): Promise<T | undefined>;
211
+ /**
212
+ * Gets an item from within this schema. To get by full name use lookupItem instead.
213
+ * @param key the local (unqualified) name, lookup is case-insensitive
214
+ */
215
+ getItemSync<T extends SchemaItem>(name: string): T | undefined;
216
+ /**
217
+ * Attempts to find a schema item within this schema or a (directly) referenced schema
218
+ * @param key The full name or a SchemaItemKey identifying the desired item.
219
+ */
220
+ lookupItem<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): Promise<T | undefined>;
221
+ /**
222
+ * Attempts to find a schema item within this schema or a (directly) referenced schema
223
+ * @param key The full name or a SchemaItemKey identifying the desired item.
224
+ */
225
+ lookupItemSync<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): T | undefined;
226
+ getItems<T extends AnySchemaItem>(): IterableIterator<T>;
227
+ getClasses(): IterableIterator<ECClass>;
228
+ getReference<T extends Schema>(refSchemaName: string): Promise<T | undefined>;
229
+ getReferenceNameByAlias(alias: string): string | undefined;
230
+ getReferenceSync<T extends Schema>(refSchemaName: string): T | undefined;
231
+ /**
232
+ * Save this Schema's properties to an object for serializing to JSON.
233
+ */
234
+ toJSON(): SchemaProps;
235
+ /**
236
+ * Converts the schema to a DOM XML Document.
237
+ * @param schemaXml An empty DOM document to which the schema will be written
238
+ */
239
+ toXml(schemaXml: Document): Promise<Document>;
240
+ fromJSONSync(schemaProps: SchemaProps): void;
241
+ fromJSON(schemaProps: SchemaProps): Promise<void>;
242
+ static fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema>;
243
+ static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema;
244
+ /**
245
+ * @internal
246
+ */
247
+ static isSchema(object: any): object is Schema;
248
+ }
249
+ /**
250
+ * Hackish approach that works like a "friend class" so we can access protected members without making them public.
251
+ * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import
252
+ * would prevent this class from extending Schema.
253
+ * @internal
254
+ */
255
+ export declare abstract class MutableSchema extends Schema {
256
+ abstract addCustomAttribute(customAttribute: CustomAttribute): void;
257
+ abstract createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;
258
+ abstract createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;
259
+ abstract createMixinClass(name: string): Promise<Mixin>;
260
+ abstract createMixinClassSync(name: string): Mixin;
261
+ abstract createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;
262
+ abstract createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;
263
+ abstract createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;
264
+ abstract createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;
265
+ abstract createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;
266
+ abstract createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;
267
+ abstract createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;
268
+ abstract createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;
269
+ abstract createKindOfQuantity(name: string): Promise<KindOfQuantity>;
270
+ abstract createKindOfQuantitySync(name: string): KindOfQuantity;
271
+ abstract createUnit(name: string): Promise<Unit>;
272
+ abstract createUnitSync(name: string): Unit;
273
+ abstract createConstant(name: string): Promise<Constant>;
274
+ abstract createConstantSync(name: string): Constant;
275
+ abstract createInvertedUnit(name: string): Promise<InvertedUnit>;
276
+ abstract createInvertedUnitSync(name: string): InvertedUnit;
277
+ abstract createPhenomenon(name: string): Promise<Phenomenon>;
278
+ abstract createPhenomenonSync(name: string): Phenomenon;
279
+ abstract createFormat(name: string): Promise<Format>;
280
+ abstract createFormatSync(name: string): Format;
281
+ abstract createUnitSystem(name: string): Promise<UnitSystem>;
282
+ abstract createUnitSystemSync(name: string): UnitSystem;
283
+ abstract createPropertyCategory(name: string): Promise<PropertyCategory>;
284
+ abstract createPropertyCategorySync(name: string): PropertyCategory;
285
+ abstract addItem<T extends SchemaItem>(item: T): void;
286
+ abstract addReference(refSchema: Schema): Promise<void>;
287
+ abstract addReferenceSync(refSchema: Schema): void;
288
+ abstract setContext(schemaContext: SchemaContext): void;
289
+ abstract deleteClass(name: string): Promise<void>;
290
+ abstract deleteClassSync(name: string): void;
291
+ }
292
292
  //# sourceMappingURL=Schema.d.ts.map