@itwin/ecschema-metadata 4.8.0-dev.9 → 4.9.0-dev.1
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 +36 -1
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +4 -0
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +0 -6
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +0 -8
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +7 -3
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +16 -10
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.js +3 -1
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +14 -0
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +21 -0
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +5 -0
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +7 -0
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/Graph.js.map +1 -1
- package/lib/cjs/UnitConversion/Parser.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Constants.d.ts +24 -0
- package/lib/esm/Constants.d.ts.map +1 -0
- package/lib/esm/Constants.js +30 -0
- package/lib/esm/Constants.js.map +1 -0
- package/lib/esm/Context.d.ts +219 -0
- package/lib/esm/Context.d.ts.map +1 -0
- package/lib/esm/Context.js +321 -0
- package/lib/esm/Context.js.map +1 -0
- package/lib/esm/DelayedPromise.d.ts +89 -0
- package/lib/esm/DelayedPromise.d.ts.map +1 -0
- package/lib/esm/DelayedPromise.js +88 -0
- package/lib/esm/DelayedPromise.js.map +1 -0
- package/lib/esm/Deserialization/AbstractParser.d.ts +46 -0
- package/lib/esm/Deserialization/AbstractParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/AbstractParser.js +8 -0
- package/lib/esm/Deserialization/AbstractParser.js.map +1 -0
- package/lib/esm/Deserialization/Helper.d.ts +263 -0
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -0
- package/lib/esm/Deserialization/Helper.js +871 -0
- package/lib/esm/Deserialization/Helper.js.map +1 -0
- package/lib/esm/Deserialization/JsonParser.d.ts +166 -0
- package/lib/esm/Deserialization/JsonParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/JsonParser.js +677 -0
- package/lib/esm/Deserialization/JsonParser.js.map +1 -0
- package/lib/esm/Deserialization/JsonProps.d.ts +273 -0
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -0
- package/lib/esm/Deserialization/JsonProps.js +9 -0
- package/lib/esm/Deserialization/JsonProps.js.map +1 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts +35 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts.map +1 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.js +74 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -0
- package/lib/esm/Deserialization/XmlParser.d.ts +86 -0
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/XmlParser.js +970 -0
- package/lib/esm/Deserialization/XmlParser.js.map +1 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +55 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.js +172 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -0
- package/lib/esm/ECName.d.ts +31 -0
- package/lib/esm/ECName.d.ts.map +1 -0
- package/lib/esm/ECName.js +82 -0
- package/lib/esm/ECName.js.map +1 -0
- package/lib/esm/ECObjects.d.ts +166 -0
- package/lib/esm/ECObjects.d.ts.map +1 -0
- package/lib/esm/ECObjects.js +422 -0
- package/lib/esm/ECObjects.js.map +1 -0
- package/lib/esm/Exception.d.ts +45 -0
- package/lib/esm/Exception.d.ts.map +1 -0
- package/lib/esm/Exception.js +82 -0
- package/lib/esm/Exception.js.map +1 -0
- package/lib/esm/Interfaces.d.ts +79 -0
- package/lib/esm/Interfaces.d.ts.map +1 -0
- package/lib/esm/Interfaces.js +9 -0
- package/lib/esm/Interfaces.js.map +1 -0
- package/lib/esm/Metadata/Class.d.ts +245 -0
- package/lib/esm/Metadata/Class.d.ts.map +1 -0
- package/lib/esm/Metadata/Class.js +552 -0
- package/lib/esm/Metadata/Class.js.map +1 -0
- package/lib/esm/Metadata/Constant.d.ts +65 -0
- package/lib/esm/Metadata/Constant.d.ts.map +1 -0
- package/lib/esm/Metadata/Constant.js +119 -0
- package/lib/esm/Metadata/Constant.js.map +1 -0
- package/lib/esm/Metadata/CustomAttribute.d.ts +24 -0
- package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -0
- package/lib/esm/Metadata/CustomAttribute.js +24 -0
- package/lib/esm/Metadata/CustomAttribute.js.map +1 -0
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +44 -0
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -0
- package/lib/esm/Metadata/CustomAttributeClass.js +70 -0
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -0
- package/lib/esm/Metadata/EntityClass.d.ts +78 -0
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -0
- package/lib/esm/Metadata/EntityClass.js +224 -0
- package/lib/esm/Metadata/EntityClass.js.map +1 -0
- package/lib/esm/Metadata/Enumeration.d.ts +87 -0
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -0
- package/lib/esm/Metadata/Enumeration.js +155 -0
- package/lib/esm/Metadata/Enumeration.js.map +1 -0
- package/lib/esm/Metadata/Format.d.ts +99 -0
- package/lib/esm/Metadata/Format.d.ts.map +1 -0
- package/lib/esm/Metadata/Format.js +238 -0
- package/lib/esm/Metadata/Format.js.map +1 -0
- package/lib/esm/Metadata/InvertedUnit.d.ts +50 -0
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -0
- package/lib/esm/Metadata/InvertedUnit.js +93 -0
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -0
- package/lib/esm/Metadata/KindOfQuantity.d.ts +72 -0
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -0
- package/lib/esm/Metadata/KindOfQuantity.js +229 -0
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -0
- package/lib/esm/Metadata/Mixin.d.ts +55 -0
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -0
- package/lib/esm/Metadata/Mixin.js +109 -0
- package/lib/esm/Metadata/Mixin.js.map +1 -0
- package/lib/esm/Metadata/OverrideFormat.d.ts +68 -0
- package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -0
- package/lib/esm/Metadata/OverrideFormat.js +124 -0
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -0
- package/lib/esm/Metadata/Phenomenon.d.ts +34 -0
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -0
- package/lib/esm/Metadata/Phenomenon.js +55 -0
- package/lib/esm/Metadata/Phenomenon.js.map +1 -0
- package/lib/esm/Metadata/Property.d.ts +247 -0
- package/lib/esm/Metadata/Property.d.ts.map +1 -0
- package/lib/esm/Metadata/Property.js +565 -0
- package/lib/esm/Metadata/Property.js.map +1 -0
- package/lib/esm/Metadata/PropertyCategory.d.ts +40 -0
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -0
- package/lib/esm/Metadata/PropertyCategory.js +57 -0
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -0
- package/lib/esm/Metadata/RelationshipClass.d.ts +170 -0
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -0
- package/lib/esm/Metadata/RelationshipClass.js +380 -0
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -0
- package/lib/esm/Metadata/Schema.d.ts +330 -0
- package/lib/esm/Metadata/Schema.d.ts.map +1 -0
- package/lib/esm/Metadata/Schema.js +570 -0
- package/lib/esm/Metadata/Schema.js.map +1 -0
- package/lib/esm/Metadata/SchemaItem.d.ts +67 -0
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -0
- package/lib/esm/Metadata/SchemaItem.js +140 -0
- package/lib/esm/Metadata/SchemaItem.js.map +1 -0
- package/lib/esm/Metadata/Unit.d.ts +77 -0
- package/lib/esm/Metadata/Unit.d.ts.map +1 -0
- package/lib/esm/Metadata/Unit.js +158 -0
- package/lib/esm/Metadata/Unit.js.map +1 -0
- package/lib/esm/Metadata/UnitSystem.d.ts +21 -0
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -0
- package/lib/esm/Metadata/UnitSystem.js +25 -0
- package/lib/esm/Metadata/UnitSystem.js.map +1 -0
- package/lib/esm/PropertyTypes.d.ts +50 -0
- package/lib/esm/PropertyTypes.d.ts.map +1 -0
- package/lib/esm/PropertyTypes.js +88 -0
- package/lib/esm/PropertyTypes.js.map +1 -0
- package/lib/esm/SchemaJsonLocater.d.ts +42 -0
- package/lib/esm/SchemaJsonLocater.d.ts.map +1 -0
- package/lib/esm/SchemaJsonLocater.js +54 -0
- package/lib/esm/SchemaJsonLocater.js.map +1 -0
- package/lib/esm/SchemaKey.d.ts +111 -0
- package/lib/esm/SchemaKey.d.ts.map +1 -0
- package/lib/esm/SchemaKey.js +214 -0
- package/lib/esm/SchemaKey.js.map +1 -0
- package/lib/esm/SchemaLoader.d.ts +32 -0
- package/lib/esm/SchemaLoader.d.ts.map +1 -0
- package/lib/esm/SchemaLoader.js +53 -0
- package/lib/esm/SchemaLoader.js.map +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.d.ts +275 -0
- package/lib/esm/SchemaPartVisitorDelegate.d.ts.map +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.js +209 -0
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -0
- package/lib/esm/UnitConversion/Graph.d.ts +35 -0
- package/lib/esm/UnitConversion/Graph.d.ts.map +1 -0
- package/lib/esm/UnitConversion/Graph.js +80 -0
- package/lib/esm/UnitConversion/Graph.js.map +1 -0
- package/lib/esm/UnitConversion/Parser.d.ts +9 -0
- package/lib/esm/UnitConversion/Parser.d.ts.map +1 -0
- package/lib/esm/UnitConversion/Parser.js +39 -0
- package/lib/esm/UnitConversion/Parser.js.map +1 -0
- package/lib/esm/UnitConversion/UnitConversion.d.ts +46 -0
- package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitConversion.js +74 -0
- package/lib/esm/UnitConversion/UnitConversion.js.map +1 -0
- package/lib/esm/UnitConversion/UnitConverter.d.ts +40 -0
- package/lib/esm/UnitConversion/UnitConverter.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitConverter.js +113 -0
- package/lib/esm/UnitConversion/UnitConverter.js.map +1 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts +44 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitTree.js +165 -0
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +78 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js +231 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -0
- package/lib/esm/Validation/SchemaWalker.d.ts +24 -0
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaWalker.js +50 -0
- package/lib/esm/Validation/SchemaWalker.js.map +1 -0
- package/lib/esm/ecschema-metadata.d.ts +52 -0
- package/lib/esm/ecschema-metadata.d.ts.map +1 -0
- package/lib/esm/ecschema-metadata.js +55 -0
- package/lib/esm/ecschema-metadata.js.map +1 -0
- package/lib/esm/utils/SchemaGraph.d.ts +44 -0
- package/lib/esm/utils/SchemaGraph.d.ts.map +1 -0
- package/lib/esm/utils/SchemaGraph.js +111 -0
- package/lib/esm/utils/SchemaGraph.js.map +1 -0
- package/package.json +9 -7
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { ConstantProps } from "../Deserialization/JsonProps";
|
|
5
|
+
import { SchemaItemType } from "../ECObjects";
|
|
6
|
+
import { LazyLoadedPhenomenon } from "../Interfaces";
|
|
7
|
+
import { Schema } from "./Schema";
|
|
8
|
+
import { SchemaItem } from "./SchemaItem";
|
|
9
|
+
/**
|
|
10
|
+
* A Constant is a specific type of Unit that represents a number.
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export declare class Constant extends SchemaItem {
|
|
14
|
+
readonly schemaItemType: SchemaItemType.Constant;
|
|
15
|
+
protected _phenomenon?: LazyLoadedPhenomenon;
|
|
16
|
+
protected _definition: string;
|
|
17
|
+
protected _numerator?: number;
|
|
18
|
+
protected _denominator?: number;
|
|
19
|
+
constructor(schema: Schema, name: string);
|
|
20
|
+
get phenomenon(): LazyLoadedPhenomenon | undefined;
|
|
21
|
+
get definition(): string;
|
|
22
|
+
get numerator(): number;
|
|
23
|
+
get denominator(): number;
|
|
24
|
+
get hasNumerator(): boolean;
|
|
25
|
+
get hasDenominator(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Save this Constants properties to an object for serializing to JSON.
|
|
28
|
+
* @param standalone Serialization includes only this object (as opposed to the full schema).
|
|
29
|
+
* @param includeSchemaVersion Include the Schema's version information in the serialized object.
|
|
30
|
+
*/
|
|
31
|
+
toJSON(standalone?: boolean, includeSchemaVersion?: boolean): ConstantProps;
|
|
32
|
+
/** @internal */
|
|
33
|
+
toXml(schemaXml: Document): Promise<Element>;
|
|
34
|
+
fromJSONSync(constantProps: ConstantProps): void;
|
|
35
|
+
fromJSON(constantProps: ConstantProps): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* @alpha Used in schema editing.
|
|
38
|
+
* @param phenomenon A LazyLoadedPhenomenon.
|
|
39
|
+
*/
|
|
40
|
+
protected setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;
|
|
41
|
+
/**
|
|
42
|
+
* @alpha Used in schema editing.
|
|
43
|
+
*/
|
|
44
|
+
protected setDefinition(definition: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* @alpha Used in schema editing.
|
|
47
|
+
*/
|
|
48
|
+
protected setNumerator(numerator: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* @alpha Used in schema editing.
|
|
51
|
+
*/
|
|
52
|
+
protected setDenominator(denominator: number): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* An abstract class used for schema editing.
|
|
57
|
+
*/
|
|
58
|
+
export declare abstract class MutableConstant extends Constant {
|
|
59
|
+
abstract setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;
|
|
60
|
+
abstract setDefinition(definition: string): void;
|
|
61
|
+
abstract setNumerator(numerator: number): void;
|
|
62
|
+
abstract setDenominator(denominator: number): void;
|
|
63
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=Constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constant.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Constant.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,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AC,cAAc,CAAC,WAAW,EAAE,MAAM;CAG7C;AACD;;;GAGG;AACH,8BAAsB,eAAgB,SAAQ,QAAQ;aAC3B,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;aACrD,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;aACvC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aACrC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;aACzC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Metadata
|
|
7
|
+
*/
|
|
8
|
+
import { DelayedPromiseWithProps } from "../DelayedPromise";
|
|
9
|
+
import { XmlSerializationUtils } from "../Deserialization/XmlSerializationUtils";
|
|
10
|
+
import { SchemaItemType } from "../ECObjects";
|
|
11
|
+
import { ECObjectsError, ECObjectsStatus } from "../Exception";
|
|
12
|
+
import { SchemaItem } from "./SchemaItem";
|
|
13
|
+
/**
|
|
14
|
+
* A Constant is a specific type of Unit that represents a number.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
export class Constant extends SchemaItem {
|
|
18
|
+
constructor(schema, name) {
|
|
19
|
+
super(schema, name);
|
|
20
|
+
this.schemaItemType = SchemaItemType.Constant;
|
|
21
|
+
this._definition = "";
|
|
22
|
+
}
|
|
23
|
+
get phenomenon() { return this._phenomenon; }
|
|
24
|
+
get definition() { return this._definition; }
|
|
25
|
+
get numerator() { return this._numerator ?? 1.0; }
|
|
26
|
+
get denominator() { return this._denominator ?? 1.0; }
|
|
27
|
+
get hasNumerator() { return (this._numerator !== undefined); }
|
|
28
|
+
get hasDenominator() { return (this._denominator !== undefined); }
|
|
29
|
+
/**
|
|
30
|
+
* Save this Constants properties to an object for serializing to JSON.
|
|
31
|
+
* @param standalone Serialization includes only this object (as opposed to the full schema).
|
|
32
|
+
* @param includeSchemaVersion Include the Schema's version information in the serialized object.
|
|
33
|
+
*/
|
|
34
|
+
toJSON(standalone = false, includeSchemaVersion = false) {
|
|
35
|
+
const schemaJson = super.toJSON(standalone, includeSchemaVersion);
|
|
36
|
+
if (this.phenomenon !== undefined)
|
|
37
|
+
schemaJson.phenomenon = this.phenomenon.fullName;
|
|
38
|
+
schemaJson.definition = this.definition;
|
|
39
|
+
if (this.hasNumerator)
|
|
40
|
+
schemaJson.numerator = this.numerator;
|
|
41
|
+
if (this.hasDenominator)
|
|
42
|
+
schemaJson.denominator = this.denominator;
|
|
43
|
+
return schemaJson;
|
|
44
|
+
}
|
|
45
|
+
/** @internal */
|
|
46
|
+
async toXml(schemaXml) {
|
|
47
|
+
const itemElement = await super.toXml(schemaXml);
|
|
48
|
+
itemElement.setAttribute("definition", this.definition);
|
|
49
|
+
if (this.hasNumerator)
|
|
50
|
+
itemElement.setAttribute("numerator", this.numerator.toString());
|
|
51
|
+
if (this.hasDenominator)
|
|
52
|
+
itemElement.setAttribute("denominator", this.denominator.toString());
|
|
53
|
+
const phenomenon = await this.phenomenon;
|
|
54
|
+
if (undefined !== phenomenon) {
|
|
55
|
+
const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);
|
|
56
|
+
itemElement.setAttribute("phenomenon", phenomenonName);
|
|
57
|
+
}
|
|
58
|
+
return itemElement;
|
|
59
|
+
}
|
|
60
|
+
fromJSONSync(constantProps) {
|
|
61
|
+
super.fromJSONSync(constantProps);
|
|
62
|
+
const schemaItemKey = this.schema.getSchemaItemKey(constantProps.phenomenon);
|
|
63
|
+
if (!schemaItemKey)
|
|
64
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);
|
|
65
|
+
this._phenomenon = new DelayedPromiseWithProps(schemaItemKey, async () => {
|
|
66
|
+
const phenom = await this.schema.lookupItem(schemaItemKey);
|
|
67
|
+
if (undefined === phenom)
|
|
68
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);
|
|
69
|
+
return phenom;
|
|
70
|
+
});
|
|
71
|
+
if (this._definition !== "" && constantProps.definition.toLowerCase() !== this._definition.toLowerCase())
|
|
72
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this.name} has an invalid 'definition' attribute.`);
|
|
73
|
+
else if (this._definition === "")
|
|
74
|
+
this._definition = constantProps.definition;
|
|
75
|
+
if (undefined !== constantProps.numerator) {
|
|
76
|
+
if (constantProps.numerator !== this._numerator)
|
|
77
|
+
this._numerator = constantProps.numerator;
|
|
78
|
+
}
|
|
79
|
+
if (undefined !== constantProps.denominator) {
|
|
80
|
+
if (constantProps.denominator !== this._denominator)
|
|
81
|
+
this._denominator = constantProps.denominator;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async fromJSON(constantProps) {
|
|
85
|
+
this.fromJSONSync(constantProps);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @alpha Used in schema editing.
|
|
89
|
+
* @param phenomenon A LazyLoadedPhenomenon.
|
|
90
|
+
*/
|
|
91
|
+
setPhenomenon(phenomenon) {
|
|
92
|
+
this._phenomenon = phenomenon;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @alpha Used in schema editing.
|
|
96
|
+
*/
|
|
97
|
+
setDefinition(definition) {
|
|
98
|
+
this._definition = definition;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @alpha Used in schema editing.
|
|
102
|
+
*/
|
|
103
|
+
setNumerator(numerator) {
|
|
104
|
+
this._numerator = numerator;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @alpha Used in schema editing.
|
|
108
|
+
*/
|
|
109
|
+
setDenominator(denominator) {
|
|
110
|
+
this._denominator = denominator;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
* An abstract class used for schema editing.
|
|
116
|
+
*/
|
|
117
|
+
export class MutableConstant extends Constant {
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=Constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constant.js","sourceRoot":"","sources":["../../../src/Metadata/Constant.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,UAAU;IAOtC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,IAAW,UAAU,KAAuC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACtF,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,SAAS,KAAa,OAAO,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;IACjE,IAAW,WAAW,KAAa,OAAO,IAAI,CAAC,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC;IACrE,IAAW,YAAY,KAAc,OAAO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AC1C,IAAI,aAAa,CAAC,SAAS,KAAK,IAAI,CAAC,UAAU;gBAC7C,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;QAC9C,CAAC;QAED,IAAI,SAAS,KAAK,aAAa,CAAC,WAAW,EAAE,CAAC;YAC5C,IAAI,aAAa,CAAC,WAAW,KAAK,IAAI,CAAC,YAAY;gBACjD,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;QAClD,CAAC;IACH,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,aAA4B;QACzD,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,UAAgC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAAkB;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,YAAY,CAAC,SAAiB;QACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,WAAmB;QAC1C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAMrD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ConstantProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { LazyLoadedPhenomenon } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { Phenomenon } from \"./Phenomenon\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * A Constant is a specific type of Unit that represents a number.\r\n * @beta\r\n */\r\nexport class Constant extends SchemaItem {\r\n public override readonly schemaItemType!: SchemaItemType.Constant; // eslint-disable-line\r\n protected _phenomenon?: LazyLoadedPhenomenon;\r\n protected _definition: string;\r\n protected _numerator?: number;\r\n protected _denominator?: number;\r\n\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this.schemaItemType = SchemaItemType.Constant;\r\n this._definition = \"\";\r\n }\r\n\r\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\r\n public get definition(): string { return this._definition; }\r\n public get numerator(): number { return this._numerator ?? 1.0; }\r\n public get denominator(): number { return this._denominator ?? 1.0; }\r\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\r\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\r\n\r\n /**\r\n * Save this Constants properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ConstantProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n if (this.phenomenon !== undefined)\r\n schemaJson.phenomenon = this.phenomenon.fullName;\r\n schemaJson.definition = this.definition;\r\n if (this.hasNumerator)\r\n schemaJson.numerator = this.numerator;\r\n if (this.hasDenominator)\r\n schemaJson.denominator = this.denominator;\r\n return schemaJson as ConstantProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"definition\", this.definition);\r\n if (this.hasNumerator)\r\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\r\n if (this.hasDenominator)\r\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\r\n\r\n const phenomenon = await this.phenomenon;\r\n if (undefined !== phenomenon) {\r\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\r\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(constantProps: ConstantProps) {\r\n super.fromJSONSync(constantProps);\r\n\r\n const schemaItemKey = this.schema.getSchemaItemKey(constantProps.phenomenon);\r\n if (!schemaItemKey)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\r\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(schemaItemKey,\r\n async () => {\r\n const phenom = await this.schema.lookupItem<Phenomenon>(schemaItemKey);\r\n if (undefined === phenom)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\r\n return phenom;\r\n });\r\n\r\n if (this._definition !== \"\" && constantProps.definition.toLowerCase() !== this._definition.toLowerCase())\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this.name} has an invalid 'definition' attribute.`);\r\n else if (this._definition === \"\")\r\n this._definition = constantProps.definition;\r\n\r\n if (undefined !== constantProps.numerator) {\r\n if (constantProps.numerator !== this._numerator)\r\n this._numerator = constantProps.numerator;\r\n }\r\n\r\n if (undefined !== constantProps.denominator) {\r\n if (constantProps.denominator !== this._denominator)\r\n this._denominator = constantProps.denominator;\r\n }\r\n }\r\n\r\n public override async fromJSON(constantProps: ConstantProps) {\r\n this.fromJSONSync(constantProps);\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n * @param phenomenon A LazyLoadedPhenomenon.\r\n */\r\n protected setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\r\n this._phenomenon = phenomenon;\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setDefinition(definition: string) {\r\n this._definition = definition;\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setNumerator(numerator: number) {\r\n this._numerator = numerator;\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setDenominator(denominator: number) {\r\n this._denominator = denominator;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableConstant extends Constant {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\r\n public abstract override setDefinition(definition: string): void;\r\n public abstract override setNumerator(numerator: number): void;\r\n public abstract override setDenominator(denominator: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { Schema } from "./Schema";
|
|
5
|
+
/** @beta */
|
|
6
|
+
export interface CustomAttribute {
|
|
7
|
+
className: string;
|
|
8
|
+
[propName: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/** @internal */
|
|
11
|
+
export interface CustomAttributeSet {
|
|
12
|
+
[Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;
|
|
13
|
+
has(className: string): boolean;
|
|
14
|
+
get(className: string): CustomAttribute | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** @beta */
|
|
17
|
+
export interface CustomAttributeContainerProps {
|
|
18
|
+
customAttributes?: CustomAttributeSet;
|
|
19
|
+
fullName: string;
|
|
20
|
+
schema: Schema;
|
|
21
|
+
}
|
|
22
|
+
/** @internal */
|
|
23
|
+
export declare function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined;
|
|
24
|
+
//# sourceMappingURL=CustomAttribute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomAttribute.d.ts","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,YAAY;AACZ,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,gBAAgB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;IACrE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;CACrD;AAED,YAAY;AACZ,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,SAAS,GAAG,GAAG,EAAE,GAAG,SAAS,CAc7G"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Metadata
|
|
7
|
+
*/
|
|
8
|
+
/** @internal */
|
|
9
|
+
export function serializeCustomAttributes(customAttributes) {
|
|
10
|
+
if (undefined !== customAttributes) { // custom attributes is optional
|
|
11
|
+
const attributes = [];
|
|
12
|
+
for (const [, customAttribute] of customAttributes) {
|
|
13
|
+
const attribute = {};
|
|
14
|
+
Object.keys(customAttribute).map((property) => {
|
|
15
|
+
const propertyName = property.toString();
|
|
16
|
+
attribute[propertyName] = customAttribute[property];
|
|
17
|
+
});
|
|
18
|
+
attributes.push(attribute);
|
|
19
|
+
}
|
|
20
|
+
return (attributes.length > 0) ? attributes : undefined;
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=CustomAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomAttribute.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAwBH,gBAAgB;AAChB,MAAM,UAAU,yBAAyB,CAAC,gBAAgD;IACxF,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC,CAAC,gCAAgC;QACpE,MAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,gBAAgB,EAAE,CAAC;YACnD,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,QAAa,EAAE,EAAE;gBACjD,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACzC,SAAS,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC,CAAC,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { Schema } from \"./Schema\";\r\n\r\n/** @beta */\r\nexport interface CustomAttribute {\r\n className: string;\r\n [propName: string]: any;\r\n}\r\n\r\n/** @internal */\r\nexport interface CustomAttributeSet {\r\n [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;\r\n has(className: string): boolean;\r\n get(className: string): CustomAttribute | undefined;\r\n}\r\n\r\n/** @beta */\r\nexport interface CustomAttributeContainerProps {\r\n customAttributes?: CustomAttributeSet;\r\n fullName: string;\r\n schema: Schema;\r\n}\r\n\r\n/** @internal */\r\nexport function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined {\r\n if (undefined !== customAttributes) { // custom attributes is optional\r\n const attributes: any[] = [];\r\n for (const [, customAttribute] of customAttributes) {\r\n const attribute: { [value: string]: any } = {};\r\n Object.keys(customAttribute).map((property: any) => {\r\n const propertyName = property.toString();\r\n attribute[propertyName] = customAttribute[property];\r\n });\r\n attributes.push(attribute);\r\n }\r\n return (attributes.length > 0) ? attributes : undefined;\r\n }\r\n return undefined;\r\n}\r\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { CustomAttributeClassProps } from "../Deserialization/JsonProps";
|
|
5
|
+
import { CustomAttributeContainerType, ECClassModifier, SchemaItemType } from "../ECObjects";
|
|
6
|
+
import { ECClass } from "./Class";
|
|
7
|
+
import { Schema } from "./Schema";
|
|
8
|
+
/**
|
|
9
|
+
* A Typescript class representation of an ECCustomAttributeClass.
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export declare class CustomAttributeClass extends ECClass {
|
|
13
|
+
readonly schemaItemType: SchemaItemType.CustomAttributeClass;
|
|
14
|
+
protected _appliesTo?: CustomAttributeContainerType;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated in 4.8 use [[appliesTo]]
|
|
17
|
+
* */
|
|
18
|
+
get containerType(): CustomAttributeContainerType;
|
|
19
|
+
get appliesTo(): CustomAttributeContainerType;
|
|
20
|
+
constructor(schema: Schema, name: string, modifier?: ECClassModifier);
|
|
21
|
+
/**
|
|
22
|
+
* Save this CustomAttributeClasses properties to an object for serializing to JSON.
|
|
23
|
+
* @param standalone Serialization includes only this object (as opposed to the full schema).
|
|
24
|
+
* @param includeSchemaVersion Include the Schema's version information in the serialized object.
|
|
25
|
+
*/
|
|
26
|
+
toJSON(standalone?: boolean, includeSchemaVersion?: boolean): CustomAttributeClassProps;
|
|
27
|
+
/** @internal */
|
|
28
|
+
toXml(schemaXml: Document): Promise<Element>;
|
|
29
|
+
fromJSONSync(customAttributeProps: CustomAttributeClassProps): void;
|
|
30
|
+
fromJSON(customAttributeProps: CustomAttributeClassProps): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* @alpha Used in schema editing.
|
|
33
|
+
*/
|
|
34
|
+
protected setAppliesTo(containerType: CustomAttributeContainerType): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
* An abstract class used for Schema editing.
|
|
39
|
+
*/
|
|
40
|
+
export declare abstract class MutableCAClass extends CustomAttributeClass {
|
|
41
|
+
abstract setAppliesTo(containerType: CustomAttributeContainerType): void;
|
|
42
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=CustomAttributeClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomAttributeClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/CustomAttributeClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EACkB,4BAA4B,EAAE,eAAe,EAAqC,cAAc,EACxH,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,OAAO;IAC/C,SAAyB,cAAc,EAAG,cAAc,CAAC,oBAAoB,CAAC;IAC9E,SAAS,CAAC,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAEpD;;SAEK;IACL,IAAW,aAAa,IAAI,4BAA4B,CAEvD;IAED,IAAW,SAAS,IAAI,4BAA4B,CAInD;gBAEW,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,eAAe;IAKpE;;;;OAIG;IACa,MAAM,CAAC,UAAU,GAAE,OAAe,EAAE,oBAAoB,GAAE,OAAe,GAAG,yBAAyB;IAMrH,gBAAgB;IACM,KAAK,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAMlD,YAAY,CAAC,oBAAoB,EAAE,yBAAyB;IAQtD,QAAQ,CAAC,oBAAoB,EAAE,yBAAyB;IAI9E;;OAEG;IACH,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,4BAA4B;CAGnE;AACD;;;GAGG;AACH,8BAAsB,cAAe,SAAQ,oBAAoB;aACtC,YAAY,CAAC,aAAa,EAAE,4BAA4B,GAAG,IAAI;aAC/D,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Metadata
|
|
7
|
+
*/
|
|
8
|
+
import { containerTypeToString, parseCustomAttributeContainerType, SchemaItemType, } from "../ECObjects";
|
|
9
|
+
import { ECObjectsError, ECObjectsStatus } from "../Exception";
|
|
10
|
+
import { ECClass } from "./Class";
|
|
11
|
+
/**
|
|
12
|
+
* A Typescript class representation of an ECCustomAttributeClass.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
export class CustomAttributeClass extends ECClass {
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated in 4.8 use [[appliesTo]]
|
|
18
|
+
* */
|
|
19
|
+
get containerType() {
|
|
20
|
+
return this.appliesTo;
|
|
21
|
+
}
|
|
22
|
+
get appliesTo() {
|
|
23
|
+
if (undefined === this._appliesTo)
|
|
24
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);
|
|
25
|
+
return this._appliesTo;
|
|
26
|
+
}
|
|
27
|
+
constructor(schema, name, modifier) {
|
|
28
|
+
super(schema, name, modifier);
|
|
29
|
+
this.schemaItemType = SchemaItemType.CustomAttributeClass;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Save this CustomAttributeClasses properties to an object for serializing to JSON.
|
|
33
|
+
* @param standalone Serialization includes only this object (as opposed to the full schema).
|
|
34
|
+
* @param includeSchemaVersion Include the Schema's version information in the serialized object.
|
|
35
|
+
*/
|
|
36
|
+
toJSON(standalone = false, includeSchemaVersion = false) {
|
|
37
|
+
const schemaJson = super.toJSON(standalone, includeSchemaVersion);
|
|
38
|
+
schemaJson.appliesTo = containerTypeToString(this.appliesTo);
|
|
39
|
+
return schemaJson;
|
|
40
|
+
}
|
|
41
|
+
/** @internal */
|
|
42
|
+
async toXml(schemaXml) {
|
|
43
|
+
const itemElement = await super.toXml(schemaXml);
|
|
44
|
+
itemElement.setAttribute("appliesTo", containerTypeToString(this.appliesTo));
|
|
45
|
+
return itemElement;
|
|
46
|
+
}
|
|
47
|
+
fromJSONSync(customAttributeProps) {
|
|
48
|
+
super.fromJSONSync(customAttributeProps);
|
|
49
|
+
const appliesTo = parseCustomAttributeContainerType(customAttributeProps.appliesTo);
|
|
50
|
+
if (undefined === appliesTo)
|
|
51
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `${appliesTo} is not a valid CustomAttributeContainerType.`);
|
|
52
|
+
this._appliesTo = appliesTo;
|
|
53
|
+
}
|
|
54
|
+
async fromJSON(customAttributeProps) {
|
|
55
|
+
this.fromJSONSync(customAttributeProps);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @alpha Used in schema editing.
|
|
59
|
+
*/
|
|
60
|
+
setAppliesTo(containerType) {
|
|
61
|
+
this._appliesTo = containerType;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
* An abstract class used for Schema editing.
|
|
67
|
+
*/
|
|
68
|
+
export class MutableCAClass extends CustomAttributeClass {
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=CustomAttributeClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomAttributeClass.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttributeClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EACL,qBAAqB,EAAiD,iCAAiC,EAAE,cAAc,GACxH,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAO;IAI/C;;SAEK;IACL,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAW,SAAS;QAClB,IAAI,SAAS,KAAK,IAAI,CAAC,UAAU;YAC/B,MAAM,IAAI,cAAc,CAAC,eAAe,CAAC,oBAAoB,EAAE,4BAA4B,IAAI,CAAC,IAAI,gDAAgD,CAAC,CAAC;QACxJ,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,YAAY,MA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Ae,SAAQ,oBAAoB;CAGhE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { CustomAttributeClassProps } from \"../Deserialization/JsonProps\";\r\nimport {\r\n containerTypeToString, CustomAttributeContainerType, ECClassModifier, parseCustomAttributeContainerType, SchemaItemType,\r\n} from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { ECClass } from \"./Class\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * A Typescript class representation of an ECCustomAttributeClass.\r\n * @beta\r\n */\r\nexport class CustomAttributeClass extends ECClass {\r\n public override readonly schemaItemType!: SchemaItemType.CustomAttributeClass; // eslint-disable-line\r\n protected _appliesTo?: CustomAttributeContainerType;\r\n\r\n /**\r\n * @deprecated in 4.8 use [[appliesTo]]\r\n * */\r\n public get containerType(): CustomAttributeContainerType {\r\n return this.appliesTo;\r\n }\r\n\r\n public get appliesTo(): CustomAttributeContainerType {\r\n if (undefined === this._appliesTo)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);\r\n return this._appliesTo;\r\n }\r\n\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name, modifier);\r\n this.schemaItemType = SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * Save this CustomAttributeClasses properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): CustomAttributeClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.appliesTo = containerTypeToString(this.appliesTo);\r\n return schemaJson as CustomAttributeClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"appliesTo\", containerTypeToString(this.appliesTo));\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(customAttributeProps: CustomAttributeClassProps) {\r\n super.fromJSONSync(customAttributeProps);\r\n const appliesTo = parseCustomAttributeContainerType(customAttributeProps.appliesTo);\r\n if (undefined === appliesTo)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `${appliesTo} is not a valid CustomAttributeContainerType.`);\r\n this._appliesTo = appliesTo;\r\n }\r\n\r\n public override async fromJSON(customAttributeProps: CustomAttributeClassProps) {\r\n this.fromJSONSync(customAttributeProps);\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setAppliesTo(containerType: CustomAttributeContainerType) {\r\n this._appliesTo = containerType;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for Schema editing.\r\n */\r\nexport abstract class MutableCAClass extends CustomAttributeClass {\r\n public abstract override setAppliesTo(containerType: CustomAttributeContainerType): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { EntityClassProps } from "../Deserialization/JsonProps";
|
|
5
|
+
import { ECClassModifier, SchemaItemType, StrengthDirection } from "../ECObjects";
|
|
6
|
+
import { LazyLoadedMixin } from "../Interfaces";
|
|
7
|
+
import { ECClass } from "./Class";
|
|
8
|
+
import { Mixin } from "./Mixin";
|
|
9
|
+
import { AnyProperty, NavigationProperty, Property } from "./Property";
|
|
10
|
+
import { RelationshipClass } from "./RelationshipClass";
|
|
11
|
+
import { Schema } from "./Schema";
|
|
12
|
+
/**
|
|
13
|
+
* A Typescript class representation of an ECEntityClass.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export declare class EntityClass extends ECClass {
|
|
17
|
+
readonly schemaItemType: SchemaItemType.EntityClass;
|
|
18
|
+
protected _mixins?: LazyLoadedMixin[];
|
|
19
|
+
constructor(schema: Schema, name: string, modifier?: ECClassModifier);
|
|
20
|
+
get mixins(): LazyLoadedMixin[];
|
|
21
|
+
getMixinsSync(): Iterable<Mixin>;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param mixin
|
|
25
|
+
*/
|
|
26
|
+
protected addMixin(mixin: Mixin): void;
|
|
27
|
+
/**
|
|
28
|
+
* Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.
|
|
29
|
+
* @param name The name of the property to find.
|
|
30
|
+
*/
|
|
31
|
+
getInheritedProperty(name: string): Promise<AnyProperty | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.
|
|
34
|
+
* @param name The name of the property to find.
|
|
35
|
+
*/
|
|
36
|
+
getInheritedPropertySync(name: string): Property | undefined;
|
|
37
|
+
protected buildPropertyCache(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): Promise<void>;
|
|
38
|
+
protected buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param name
|
|
42
|
+
* @param relationship
|
|
43
|
+
* @param direction
|
|
44
|
+
*/
|
|
45
|
+
protected createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param name
|
|
49
|
+
* @param relationship
|
|
50
|
+
* @param direction
|
|
51
|
+
*/
|
|
52
|
+
protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
53
|
+
/**
|
|
54
|
+
* Save this EntityClass' properties to an object for serializing to JSON.
|
|
55
|
+
* @param standalone Serialization includes only this object (as opposed to the full schema).
|
|
56
|
+
* @param includeSchemaVersion Include the Schema's version information in the serialized object.
|
|
57
|
+
*/
|
|
58
|
+
toJSON(standalone?: boolean, includeSchemaVersion?: boolean): EntityClassProps;
|
|
59
|
+
/** @internal */
|
|
60
|
+
toXml(schemaXml: Document): Promise<Element>;
|
|
61
|
+
fromJSON(entityClassProps: EntityClassProps): Promise<void>;
|
|
62
|
+
fromJSONSync(entityClassProps: EntityClassProps): void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare abstract class MutableEntityClass extends EntityClass {
|
|
69
|
+
abstract addMixin(mixin: Mixin): any;
|
|
70
|
+
abstract createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
71
|
+
abstract createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
72
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
73
|
+
}
|
|
74
|
+
/** @internal */
|
|
75
|
+
export declare function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
78
|
+
//# sourceMappingURL=EntityClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAA0B,cAAc,EAAE,iBAAiB,EAAE,MAAM,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