@itwin/ecschema-metadata 3.4.0-dev.50 → 3.4.0-dev.56

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 (149) 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.d.ts.map +1 -1
  26. package/lib/cjs/Deserialization/XmlParser.js +973 -973
  27. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  28. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
  29. package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
  30. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  31. package/lib/cjs/ECName.d.ts +30 -30
  32. package/lib/cjs/ECName.js +85 -85
  33. package/lib/cjs/ECName.js.map +1 -1
  34. package/lib/cjs/ECObjects.d.ts +162 -162
  35. package/lib/cjs/ECObjects.js +453 -453
  36. package/lib/cjs/ECObjects.js.map +1 -1
  37. package/lib/cjs/Exception.d.ts +43 -43
  38. package/lib/cjs/Exception.js +86 -86
  39. package/lib/cjs/Exception.js.map +1 -1
  40. package/lib/cjs/Interfaces.d.ts +66 -66
  41. package/lib/cjs/Interfaces.js +9 -9
  42. package/lib/cjs/Interfaces.js.map +1 -1
  43. package/lib/cjs/Metadata/Class.d.ts +243 -243
  44. package/lib/cjs/Metadata/Class.js +558 -558
  45. package/lib/cjs/Metadata/Class.js.map +1 -1
  46. package/lib/cjs/Metadata/Constant.d.ts +64 -64
  47. package/lib/cjs/Metadata/Constant.js +123 -123
  48. package/lib/cjs/Metadata/Constant.js.map +1 -1
  49. package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
  50. package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
  51. package/lib/cjs/Metadata/CustomAttribute.js +27 -27
  52. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  53. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
  54. package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
  55. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  56. package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
  57. package/lib/cjs/Metadata/EntityClass.js +230 -230
  58. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  59. package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
  60. package/lib/cjs/Metadata/Enumeration.js +159 -159
  61. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  62. package/lib/cjs/Metadata/Format.d.ts +98 -98
  63. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  64. package/lib/cjs/Metadata/Format.js +242 -242
  65. package/lib/cjs/Metadata/Format.js.map +1 -1
  66. package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
  67. package/lib/cjs/Metadata/InvertedUnit.js +97 -97
  68. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  69. package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
  70. package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
  71. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  72. package/lib/cjs/Metadata/Mixin.d.ts +54 -54
  73. package/lib/cjs/Metadata/Mixin.js +113 -113
  74. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  75. package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
  76. package/lib/cjs/Metadata/OverrideFormat.js +88 -88
  77. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  78. package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
  79. package/lib/cjs/Metadata/Phenomenon.js +59 -59
  80. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  81. package/lib/cjs/Metadata/Property.d.ts +197 -197
  82. package/lib/cjs/Metadata/Property.js +491 -491
  83. package/lib/cjs/Metadata/Property.js.map +1 -1
  84. package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
  85. package/lib/cjs/Metadata/PropertyCategory.js +61 -61
  86. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  87. package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
  88. package/lib/cjs/Metadata/RelationshipClass.js +349 -349
  89. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  90. package/lib/cjs/Metadata/Schema.d.ts +291 -291
  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/SchemaItem.js.map +1 -1
  96. package/lib/cjs/Metadata/Unit.d.ts +76 -76
  97. package/lib/cjs/Metadata/Unit.js +162 -162
  98. package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
  99. package/lib/cjs/Metadata/UnitSystem.js +29 -29
  100. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  101. package/lib/cjs/PropertyTypes.d.ts +49 -49
  102. package/lib/cjs/PropertyTypes.d.ts.map +1 -1
  103. package/lib/cjs/PropertyTypes.js +91 -75
  104. package/lib/cjs/PropertyTypes.js.map +1 -1
  105. package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
  106. package/lib/cjs/SchemaJsonLocater.js +42 -42
  107. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  108. package/lib/cjs/SchemaKey.d.ts +110 -110
  109. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  110. package/lib/cjs/SchemaKey.js +219 -220
  111. package/lib/cjs/SchemaKey.js.map +1 -1
  112. package/lib/cjs/SchemaLoader.d.ts +23 -23
  113. package/lib/cjs/SchemaLoader.js +47 -47
  114. package/lib/cjs/SchemaLoader.js.map +1 -1
  115. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
  116. package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
  117. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  118. package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
  119. package/lib/cjs/UnitConversion/Graph.js +83 -83
  120. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  121. package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
  122. package/lib/cjs/UnitConversion/Parser.d.ts.map +1 -1
  123. package/lib/cjs/UnitConversion/Parser.js +42 -41
  124. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  125. package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
  126. package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
  127. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  128. package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
  129. package/lib/cjs/UnitConversion/UnitConverter.d.ts.map +1 -1
  130. package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
  131. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  132. package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
  133. package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
  134. package/lib/cjs/UnitConversion/UnitTree.js +169 -169
  135. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  136. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
  137. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +236 -236
  138. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  139. package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
  140. package/lib/cjs/Validation/SchemaWalker.js +53 -53
  141. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  142. package/lib/cjs/ecschema-metadata.d.ts +51 -51
  143. package/lib/cjs/ecschema-metadata.js +96 -96
  144. package/lib/cjs/ecschema-metadata.js.map +1 -1
  145. package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
  146. package/lib/cjs/utils/SchemaGraph.d.ts.map +1 -1
  147. package/lib/cjs/utils/SchemaGraph.js +65 -65
  148. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  149. package/package.json +7 -7
@@ -1,48 +1,48 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SchemaLoader = void 0;
8
- const Context_1 = require("./Context");
9
- const ECObjects_1 = require("./ECObjects");
10
- const Exception_1 = require("./Exception");
11
- const SchemaJsonLocater_1 = require("./SchemaJsonLocater");
12
- const SchemaKey_1 = require("./SchemaKey");
13
- /**
14
- * A utility class for loading EC Schema objects using a function that returns schema json for a given schema name.
15
- * Loaded schemas are held in memory within a schema context managed by SchemaLoader.
16
- * The SchemaLoader object should be held in memory if multiple calls to [[getSchema]] or [[tryGetSchema]]
17
- * is a possibility, thereby avoiding unnecessary schema retrievals from the function.
18
- * @alpha
19
- */
20
- class SchemaLoader {
21
- constructor(getSchema) {
22
- this._context = new Context_1.SchemaContext();
23
- const locater = new SchemaJsonLocater_1.SchemaJsonLocater(getSchema);
24
- this._context.addLocater(locater);
25
- }
26
- /** Get a schema by name
27
- * @param schemaName a string with the name of the schema to load.
28
- * @throws [ECObjectsError]($ecschema-metadata) if the schema is not found or cannot be loaded.
29
- */
30
- getSchema(schemaName) {
31
- const schema = this.tryGetSchema(schemaName);
32
- if (!schema)
33
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.UnableToLocateSchema, `reading schema=${schemaName}`);
34
- return schema;
35
- }
36
- /** Attempts to get a schema by name
37
- * @param schemaName a string with the name of the schema to load.
38
- * @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
39
- */
40
- tryGetSchema(schemaName) {
41
- // SchemaKey version is not used when locating schema in an iModel, so the version is arbitrary.
42
- const key = new SchemaKey_1.SchemaKey(schemaName, new SchemaKey_1.ECVersion(1, 0, 0));
43
- const schema = this._context.getSchemaSync(key, ECObjects_1.SchemaMatchType.Latest);
44
- return schema;
45
- }
46
- }
47
- exports.SchemaLoader = SchemaLoader;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.SchemaLoader = void 0;
8
+ const Context_1 = require("./Context");
9
+ const ECObjects_1 = require("./ECObjects");
10
+ const Exception_1 = require("./Exception");
11
+ const SchemaJsonLocater_1 = require("./SchemaJsonLocater");
12
+ const SchemaKey_1 = require("./SchemaKey");
13
+ /**
14
+ * A utility class for loading EC Schema objects using a function that returns schema json for a given schema name.
15
+ * Loaded schemas are held in memory within a schema context managed by SchemaLoader.
16
+ * The SchemaLoader object should be held in memory if multiple calls to [[getSchema]] or [[tryGetSchema]]
17
+ * is a possibility, thereby avoiding unnecessary schema retrievals from the function.
18
+ * @alpha
19
+ */
20
+ class SchemaLoader {
21
+ constructor(getSchema) {
22
+ this._context = new Context_1.SchemaContext();
23
+ const locater = new SchemaJsonLocater_1.SchemaJsonLocater(getSchema);
24
+ this._context.addLocater(locater);
25
+ }
26
+ /** Get a schema by name
27
+ * @param schemaName a string with the name of the schema to load.
28
+ * @throws [ECObjectsError]($ecschema-metadata) if the schema is not found or cannot be loaded.
29
+ */
30
+ getSchema(schemaName) {
31
+ const schema = this.tryGetSchema(schemaName);
32
+ if (!schema)
33
+ throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.UnableToLocateSchema, `reading schema=${schemaName}`);
34
+ return schema;
35
+ }
36
+ /** Attempts to get a schema by name
37
+ * @param schemaName a string with the name of the schema to load.
38
+ * @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
39
+ */
40
+ tryGetSchema(schemaName) {
41
+ // SchemaKey version is not used when locating schema in an iModel, so the version is arbitrary.
42
+ const key = new SchemaKey_1.SchemaKey(schemaName, new SchemaKey_1.ECVersion(1, 0, 0));
43
+ const schema = this._context.getSchemaSync(key, ECObjects_1.SchemaMatchType.Latest);
44
+ return schema;
45
+ }
46
+ }
47
+ exports.SchemaLoader = SchemaLoader;
48
48
  //# sourceMappingURL=SchemaLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaLoader.js","sourceRoot":"","sources":["../../src/SchemaLoader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,uCAA0C;AAC1C,2CAA8C;AAC9C,2CAA8D;AAE9D,2DAA2E;AAC3E,2CAAmD;AAEnD;;;;;;GAMG;AACH,MAAa,YAAY;IAGvB,YAAmB,SAA4B;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAa,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,qCAAiB,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,SAAS,CAAmB,UAAkB;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM;YACT,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAAE,kBAAkB,UAAU,EAAE,CAAC,CAAC;QAEjG,OAAO,MAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,YAAY,CAAmB,UAAkB;QACtD,gGAAgG;QAChG,MAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,UAAU,EAAE,IAAI,qBAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC;QACxE,OAAO,MAAW,CAAC;IACrB,CAAC;CACF;AA/BD,oCA+BC","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\r\nimport { SchemaContext } from \"./Context\";\r\nimport { SchemaMatchType } from \"./ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\r\nimport { Schema } from \"./Metadata/Schema\";\r\nimport { SchemaJsonLocater, SchemaPropsGetter } from \"./SchemaJsonLocater\";\r\nimport { ECVersion, SchemaKey } from \"./SchemaKey\";\r\n\r\n/**\r\n * A utility class for loading EC Schema objects using a function that returns schema json for a given schema name.\r\n * Loaded schemas are held in memory within a schema context managed by SchemaLoader.\r\n * The SchemaLoader object should be held in memory if multiple calls to [[getSchema]] or [[tryGetSchema]]\r\n * is a possibility, thereby avoiding unnecessary schema retrievals from the function.\r\n * @alpha\r\n */\r\nexport class SchemaLoader {\r\n private _context: SchemaContext;\r\n\r\n public constructor(getSchema: SchemaPropsGetter) {\r\n this._context = new SchemaContext();\r\n const locater = new SchemaJsonLocater(getSchema);\r\n this._context.addLocater(locater);\r\n }\r\n\r\n /** Get a schema by name\r\n * @param schemaName a string with the name of the schema to load.\r\n * @throws [ECObjectsError]($ecschema-metadata) if the schema is not found or cannot be loaded.\r\n */\r\n public getSchema<T extends Schema>(schemaName: string): T {\r\n const schema = this.tryGetSchema(schemaName);\r\n if (!schema)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `reading schema=${schemaName}`);\r\n\r\n return schema as T;\r\n }\r\n\r\n /** Attempts to get a schema by name\r\n * @param schemaName a string with the name of the schema to load.\r\n * @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.\r\n */\r\n public tryGetSchema<T extends Schema>(schemaName: string): T | undefined {\r\n // SchemaKey version is not used when locating schema in an iModel, so the version is arbitrary.\r\n const key = new SchemaKey(schemaName, new ECVersion(1, 0, 0));\r\n const schema = this._context.getSchemaSync(key, SchemaMatchType.Latest);\r\n return schema as T;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SchemaLoader.js","sourceRoot":"","sources":["../../src/SchemaLoader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,uCAA0C;AAC1C,2CAA8C;AAC9C,2CAA8D;AAE9D,2DAA2E;AAC3E,2CAAmD;AAEnD;;;;;;GAMG;AACH,MAAa,YAAY;IAGvB,YAAmB,SAA4B;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAa,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,qCAAiB,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,SAAS,CAAmB,UAAkB;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM;YACT,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAAE,kBAAkB,UAAU,EAAE,CAAC,CAAC;QAEjG,OAAO,MAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,YAAY,CAAmB,UAAkB;QACtD,gGAAgG;QAChG,MAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,UAAU,EAAE,IAAI,qBAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC;QACxE,OAAO,MAAW,CAAC;IACrB,CAAC;CACF;AA/BD,oCA+BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { SchemaContext } from \"./Context\";\nimport { SchemaMatchType } from \"./ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaJsonLocater, SchemaPropsGetter } from \"./SchemaJsonLocater\";\nimport { ECVersion, SchemaKey } from \"./SchemaKey\";\n\n/**\n * A utility class for loading EC Schema objects using a function that returns schema json for a given schema name.\n * Loaded schemas are held in memory within a schema context managed by SchemaLoader.\n * The SchemaLoader object should be held in memory if multiple calls to [[getSchema]] or [[tryGetSchema]]\n * is a possibility, thereby avoiding unnecessary schema retrievals from the function.\n * @alpha\n */\nexport class SchemaLoader {\n private _context: SchemaContext;\n\n public constructor(getSchema: SchemaPropsGetter) {\n this._context = new SchemaContext();\n const locater = new SchemaJsonLocater(getSchema);\n this._context.addLocater(locater);\n }\n\n /** Get a schema by name\n * @param schemaName a string with the name of the schema to load.\n * @throws [ECObjectsError]($ecschema-metadata) if the schema is not found or cannot be loaded.\n */\n public getSchema<T extends Schema>(schemaName: string): T {\n const schema = this.tryGetSchema(schemaName);\n if (!schema)\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `reading schema=${schemaName}`);\n\n return schema as T;\n }\n\n /** Attempts to get a schema by name\n * @param schemaName a string with the name of the schema to load.\n * @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.\n */\n public tryGetSchema<T extends Schema>(schemaName: string): T | undefined {\n // SchemaKey version is not used when locating schema in an iModel, so the version is arbitrary.\n const key = new SchemaKey(schemaName, new ECVersion(1, 0, 0));\n const schema = this._context.getSchemaSync(key, SchemaMatchType.Latest);\n return schema as T;\n }\n}\n"]}