@itwin/ecschema-metadata 3.5.0-dev.4 → 3.5.0-dev.41

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 (141) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/lib/cjs/Constants.d.ts +23 -23
  3. package/lib/cjs/Constants.js +33 -33
  4. package/lib/cjs/Constants.js.map +1 -1
  5. package/lib/cjs/Context.d.ts +139 -139
  6. package/lib/cjs/Context.js +204 -204
  7. package/lib/cjs/DelayedPromise.d.ts +88 -88
  8. package/lib/cjs/DelayedPromise.js +91 -91
  9. package/lib/cjs/DelayedPromise.js.map +1 -1
  10. package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
  11. package/lib/cjs/Deserialization/AbstractParser.js +11 -11
  12. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  13. package/lib/cjs/Deserialization/Helper.d.ts +251 -251
  14. package/lib/cjs/Deserialization/Helper.js +843 -843
  15. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  16. package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
  17. package/lib/cjs/Deserialization/JsonParser.js +680 -680
  18. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  19. package/lib/cjs/Deserialization/JsonProps.d.ts +282 -282
  20. package/lib/cjs/Deserialization/JsonProps.js +9 -9
  21. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  22. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
  23. package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
  24. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  25. package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
  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.js +27 -27
  51. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  52. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
  53. package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
  54. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  55. package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
  56. package/lib/cjs/Metadata/EntityClass.js +230 -230
  57. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  58. package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
  59. package/lib/cjs/Metadata/Enumeration.js +159 -159
  60. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  61. package/lib/cjs/Metadata/Format.d.ts +98 -98
  62. package/lib/cjs/Metadata/Format.js +242 -242
  63. package/lib/cjs/Metadata/Format.js.map +1 -1
  64. package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
  65. package/lib/cjs/Metadata/InvertedUnit.js +97 -97
  66. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  67. package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
  68. package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
  69. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  70. package/lib/cjs/Metadata/Mixin.d.ts +54 -54
  71. package/lib/cjs/Metadata/Mixin.js +113 -113
  72. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  73. package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
  74. package/lib/cjs/Metadata/OverrideFormat.js +88 -88
  75. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  76. package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
  77. package/lib/cjs/Metadata/Phenomenon.js +59 -59
  78. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  79. package/lib/cjs/Metadata/Property.d.ts +197 -197
  80. package/lib/cjs/Metadata/Property.js +491 -491
  81. package/lib/cjs/Metadata/Property.js.map +1 -1
  82. package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
  83. package/lib/cjs/Metadata/PropertyCategory.js +61 -61
  84. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  85. package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
  86. package/lib/cjs/Metadata/RelationshipClass.js +349 -349
  87. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  88. package/lib/cjs/Metadata/Schema.d.ts +291 -291
  89. package/lib/cjs/Metadata/Schema.js +520 -520
  90. package/lib/cjs/Metadata/Schema.js.map +1 -1
  91. package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
  92. package/lib/cjs/Metadata/SchemaItem.js +136 -136
  93. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  94. package/lib/cjs/Metadata/Unit.d.ts +76 -76
  95. package/lib/cjs/Metadata/Unit.js +162 -162
  96. package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
  97. package/lib/cjs/Metadata/UnitSystem.js +29 -29
  98. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  99. package/lib/cjs/PropertyTypes.d.ts +49 -49
  100. package/lib/cjs/PropertyTypes.js +91 -91
  101. package/lib/cjs/PropertyTypes.js.map +1 -1
  102. package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
  103. package/lib/cjs/SchemaJsonLocater.js +42 -42
  104. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  105. package/lib/cjs/SchemaKey.d.ts +110 -110
  106. package/lib/cjs/SchemaKey.js +219 -219
  107. package/lib/cjs/SchemaKey.js.map +1 -1
  108. package/lib/cjs/SchemaLoader.d.ts +23 -23
  109. package/lib/cjs/SchemaLoader.js +47 -47
  110. package/lib/cjs/SchemaLoader.js.map +1 -1
  111. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
  112. package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
  113. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  114. package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
  115. package/lib/cjs/UnitConversion/Graph.js +83 -83
  116. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  117. package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
  118. package/lib/cjs/UnitConversion/Parser.js +42 -42
  119. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  120. package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
  121. package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
  122. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  123. package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
  124. package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
  125. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  126. package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
  127. package/lib/cjs/UnitConversion/UnitTree.js +169 -169
  128. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  129. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
  130. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +236 -236
  131. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  132. package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
  133. package/lib/cjs/Validation/SchemaWalker.js +53 -53
  134. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  135. package/lib/cjs/ecschema-metadata.d.ts +51 -51
  136. package/lib/cjs/ecschema-metadata.js +96 -96
  137. package/lib/cjs/ecschema-metadata.js.map +1 -1
  138. package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
  139. package/lib/cjs/utils/SchemaGraph.js +65 -65
  140. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  141. package/package.json +8 -8
@@ -1,92 +1,92 @@
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
- /** @packageDocumentation
7
- * @module Utils
8
- */
9
- var _a;
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.DelayedPromiseWithProps = exports.DelayedPromise = void 0;
12
- /**
13
- * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)
14
- * and resulting value of an asynchronous operation ***that has not yet started***.
15
- *
16
- * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:
17
- * - The DelayedPromise is `await`ed.
18
- * - A callback is attached via `.then()` or `.catch(() => { })`.
19
- * - The asynchronous operation is explicitly started via `.start()`
20
- *
21
- * Just as normal Promises will never return to their pending state once fulfilled or rejected,
22
- * a DelayedPromise will never re-execute its asynchronous operation more than **once**.
23
- *
24
- * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to
25
- * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.
26
- * You could also accomplish something similar by defining an async function as a property getter.
27
- * However, since a property defined as a DelayedPromise will not start simply by being accessed,
28
- * additional (non-lazily-loaded) "nested" properties can be added.
29
- *
30
- * [!alert text="*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening." kind="warning"]
31
- * @beta
32
- */
33
- class DelayedPromise {
34
- /**
35
- * Constructs a DelayedPromise object.
36
- * @param startCallback The asynchronous callback to execute when this DelayedPromise should be "started".
37
- */
38
- constructor(startCallback) {
39
- // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts
40
- this[_a] = "Promise";
41
- let pending;
42
- this.start = async () => {
43
- pending = pending || startCallback();
44
- return pending;
45
- };
46
- }
47
- /**
48
- * Attaches callbacks for the resolution and/or rejection of the Promise.
49
- * @param onfulfilled The callback to execute when the Promise is resolved.
50
- * @param onrejected The callback to execute when the Promise is rejected.
51
- * @return A Promise for the completion of which ever callback is executed.
52
- */
53
- async then(onfulfilled, onrejected) {
54
- return this.start().then(onfulfilled, onrejected);
55
- }
56
- /**
57
- * Attaches a callback for only the rejection of the Promise.
58
- * @param onrejected The callback to execute when the Promise is rejected.
59
- * @return A Promise for the completion of the callback.
60
- */
61
- async catch(onrejected) {
62
- return this.start().catch(onrejected);
63
- }
64
- /**
65
- * Attaches a callback for only the finally clause of the Promise.
66
- * @param onrejected The callback to execute when the Promise is finalized.
67
- * @return A Promise for the completion of the callback.
68
- */
69
- async finally(onFinally) {
70
- return this.start().finally(onFinally);
71
- }
72
- }
73
- exports.DelayedPromise = DelayedPromise;
74
- _a = Symbol.toStringTag;
75
- // Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.
76
- // So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>
77
- /**
78
- * @beta
79
- */
80
- // eslint-disable-next-line @typescript-eslint/naming-convention
81
- exports.DelayedPromiseWithProps = (class extends DelayedPromise {
82
- constructor(props, cb) {
83
- super(cb);
84
- const handler = {
85
- get: (target, name) => {
86
- return (name in this) ? this[name] : target[name];
87
- },
88
- };
89
- return new Proxy(props, handler);
90
- }
91
- });
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
+ /** @packageDocumentation
7
+ * @module Utils
8
+ */
9
+ var _a;
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.DelayedPromiseWithProps = exports.DelayedPromise = void 0;
12
+ /**
13
+ * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)
14
+ * and resulting value of an asynchronous operation ***that has not yet started***.
15
+ *
16
+ * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:
17
+ * - The DelayedPromise is `await`ed.
18
+ * - A callback is attached via `.then()` or `.catch(() => { })`.
19
+ * - The asynchronous operation is explicitly started via `.start()`
20
+ *
21
+ * Just as normal Promises will never return to their pending state once fulfilled or rejected,
22
+ * a DelayedPromise will never re-execute its asynchronous operation more than **once**.
23
+ *
24
+ * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to
25
+ * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.
26
+ * You could also accomplish something similar by defining an async function as a property getter.
27
+ * However, since a property defined as a DelayedPromise will not start simply by being accessed,
28
+ * additional (non-lazily-loaded) "nested" properties can be added.
29
+ *
30
+ * [!alert text="*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening." kind="warning"]
31
+ * @beta
32
+ */
33
+ class DelayedPromise {
34
+ /**
35
+ * Constructs a DelayedPromise object.
36
+ * @param startCallback The asynchronous callback to execute when this DelayedPromise should be "started".
37
+ */
38
+ constructor(startCallback) {
39
+ // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts
40
+ this[_a] = "Promise";
41
+ let pending;
42
+ this.start = async () => {
43
+ pending = pending || startCallback();
44
+ return pending;
45
+ };
46
+ }
47
+ /**
48
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
49
+ * @param onfulfilled The callback to execute when the Promise is resolved.
50
+ * @param onrejected The callback to execute when the Promise is rejected.
51
+ * @return A Promise for the completion of which ever callback is executed.
52
+ */
53
+ async then(onfulfilled, onrejected) {
54
+ return this.start().then(onfulfilled, onrejected);
55
+ }
56
+ /**
57
+ * Attaches a callback for only the rejection of the Promise.
58
+ * @param onrejected The callback to execute when the Promise is rejected.
59
+ * @return A Promise for the completion of the callback.
60
+ */
61
+ async catch(onrejected) {
62
+ return this.start().catch(onrejected);
63
+ }
64
+ /**
65
+ * Attaches a callback for only the finally clause of the Promise.
66
+ * @param onrejected The callback to execute when the Promise is finalized.
67
+ * @return A Promise for the completion of the callback.
68
+ */
69
+ async finally(onFinally) {
70
+ return this.start().finally(onFinally);
71
+ }
72
+ }
73
+ exports.DelayedPromise = DelayedPromise;
74
+ _a = Symbol.toStringTag;
75
+ // Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.
76
+ // So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>
77
+ /**
78
+ * @beta
79
+ */
80
+ // eslint-disable-next-line @typescript-eslint/naming-convention
81
+ exports.DelayedPromiseWithProps = (class extends DelayedPromise {
82
+ constructor(props, cb) {
83
+ super(cb);
84
+ const handler = {
85
+ get: (target, name) => {
86
+ return (name in this) ? this[name] : target[name];
87
+ },
88
+ };
89
+ return new Proxy(props, handler);
90
+ }
91
+ });
92
92
  //# sourceMappingURL=DelayedPromise.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,cAAc;IAEzB;;;OAGG;IACH,YAAY,aAA+B;QAQ3C,qGAAqG;QACrF,QAAoB,GAAc,SAAS,CAAC;QAR1D,IAAI,OAA+B,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YACtB,OAAO,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC;YACrC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAUD;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAjDD,wCAiDC;KAlCkB,MAAM,CAAC,WAAW;AAkErC,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AACnD,QAAA,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAgD,CAAC;IAClF,CAAC;CACF,CAAuC,CAAC","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/** @packageDocumentation\n * @module Utils\n */\n\n/**\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\n * and resulting value of an asynchronous operation ***that has not yet started***.\n *\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\n * - The DelayedPromise is `await`ed.\n * - A callback is attached via `.then()` or `.catch(() => { })`.\n * - The asynchronous operation is explicitly started via `.start()`\n *\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\n *\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\n * You could also accomplish something similar by defining an async function as a property getter.\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\n * additional (non-lazily-loaded) \"nested\" properties can be added.\n *\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\n * @beta\n */\nexport class DelayedPromise<T> implements Promise<T> {\n\n /**\n * Constructs a DelayedPromise object.\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\n */\n constructor(startCallback: () => Promise<T>) {\n let pending: Promise<T> | undefined;\n this.start = async () => {\n pending = pending || startCallback();\n return pending;\n };\n }\n\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\n public readonly [Symbol.toStringTag]: \"Promise\" = \"Promise\";\n\n /**\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\n */\n public start: () => Promise<T>;\n\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of which ever callback is executed.\n */\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\n return this.start().then(onfulfilled, onrejected);\n }\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of the callback.\n */\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\n return this.start().catch(onrejected);\n }\n\n /**\n * Attaches a callback for only the finally clause of the Promise.\n * @param onrejected The callback to execute when the Promise is finalized.\n * @return A Promise for the completion of the callback.\n */\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\n return this.start().finally(onFinally);\n }\n}\n\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\n/**\n * @beta\n */\nexport interface NoDelayedPromiseMethods {\n [propName: string]: any;\n start?: never;\n then?: never;\n catch?: never;\n}\n\n// See definition of DelayedPromiseWithProps below\n/**\n * @beta\n */\nexport interface DelayedPromiseWithPropsConstructor {\n\n /**\n * Constructs a DelayedPromiseWithProps object, which is at once both:\n * - A DelayedPromise object representing the eventual completion (or failure)\n * of an asynchronous operation returning a value of type `TPayload`\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\n *\n * @param props An object with properties and methods that will be accessible\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\n */\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\n}\n\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\n/**\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\n constructor(props: TProps, cb: () => Promise<TPayload>) {\n super(cb);\n\n const handler = {\n get: (target: TProps, name: string) => {\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\n },\n };\n\n return new Proxy(props, handler) as Readonly<TProps> & DelayedPromise<TPayload>;\n }\n}) as DelayedPromiseWithPropsConstructor;\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/** Define the type of a DelayedPromiseWithProps instance\n * @beta\n */\nexport type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;\n"]}
1
+ {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,cAAc;IAEzB;;;OAGG;IACH,YAAY,aAA+B;QAQ3C,qGAAqG;QACrF,QAAoB,GAAc,SAAS,CAAC;QAR1D,IAAI,OAA+B,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YACtB,OAAO,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC;YACrC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAUD;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAjDD,wCAiDC;KAlCkB,MAAM,CAAC,WAAW;AAkErC,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AACnD,QAAA,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAgD,CAAC;IAClF,CAAC;CACF,CAAuC,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 Utils\r\n */\r\n\r\n/**\r\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\r\n * and resulting value of an asynchronous operation ***that has not yet started***.\r\n *\r\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\r\n * - The DelayedPromise is `await`ed.\r\n * - A callback is attached via `.then()` or `.catch(() => { })`.\r\n * - The asynchronous operation is explicitly started via `.start()`\r\n *\r\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\r\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\r\n *\r\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\r\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\r\n * You could also accomplish something similar by defining an async function as a property getter.\r\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\r\n * additional (non-lazily-loaded) \"nested\" properties can be added.\r\n *\r\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\r\n * @beta\r\n */\r\nexport class DelayedPromise<T> implements Promise<T> {\r\n\r\n /**\r\n * Constructs a DelayedPromise object.\r\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\r\n */\r\n constructor(startCallback: () => Promise<T>) {\r\n let pending: Promise<T> | undefined;\r\n this.start = async () => {\r\n pending = pending || startCallback();\r\n return pending;\r\n };\r\n }\r\n\r\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\r\n public readonly [Symbol.toStringTag]: \"Promise\" = \"Promise\";\r\n\r\n /**\r\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\r\n */\r\n public start: () => Promise<T>;\r\n\r\n /**\r\n * Attaches callbacks for the resolution and/or rejection of the Promise.\r\n * @param onfulfilled The callback to execute when the Promise is resolved.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @return A Promise for the completion of which ever callback is executed.\r\n */\r\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\r\n return this.start().then(onfulfilled, onrejected);\r\n }\r\n\r\n /**\r\n * Attaches a callback for only the rejection of the Promise.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @return A Promise for the completion of the callback.\r\n */\r\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\r\n return this.start().catch(onrejected);\r\n }\r\n\r\n /**\r\n * Attaches a callback for only the finally clause of the Promise.\r\n * @param onrejected The callback to execute when the Promise is finalized.\r\n * @return A Promise for the completion of the callback.\r\n */\r\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\r\n return this.start().finally(onFinally);\r\n }\r\n}\r\n\r\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\r\n/**\r\n * @beta\r\n */\r\nexport interface NoDelayedPromiseMethods {\r\n [propName: string]: any;\r\n start?: never;\r\n then?: never;\r\n catch?: never;\r\n}\r\n\r\n// See definition of DelayedPromiseWithProps below\r\n/**\r\n * @beta\r\n */\r\nexport interface DelayedPromiseWithPropsConstructor {\r\n\r\n /**\r\n * Constructs a DelayedPromiseWithProps object, which is at once both:\r\n * - A DelayedPromise object representing the eventual completion (or failure)\r\n * of an asynchronous operation returning a value of type `TPayload`\r\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\r\n *\r\n * @param props An object with properties and methods that will be accessible\r\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\r\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\r\n */\r\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\r\n}\r\n\r\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\r\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\r\n/**\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\r\n constructor(props: TProps, cb: () => Promise<TPayload>) {\r\n super(cb);\r\n\r\n const handler = {\r\n get: (target: TProps, name: string) => {\r\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\r\n },\r\n };\r\n\r\n return new Proxy(props, handler) as Readonly<TProps> & DelayedPromise<TPayload>;\r\n }\r\n}) as DelayedPromiseWithPropsConstructor;\r\n\r\n/* eslint-disable @typescript-eslint/no-redeclare */\r\n\r\n/** Define the type of a DelayedPromiseWithProps instance\r\n * @beta\r\n */\r\nexport type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;\r\n"]}
@@ -1,46 +1,46 @@
1
- import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, FormatProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitProps, UnitSystemProps } from "../Deserialization/JsonProps";
2
- import { CustomAttribute } from "../Metadata/CustomAttribute";
3
- import { CustomAttributeClass } from "../Metadata/CustomAttributeClass";
4
- declare type SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;
5
- declare type PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;
6
- /** @internal */
7
- export declare type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;
8
- /** @internal */
9
- export declare type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;
10
- /** @internal */
11
- export declare abstract class AbstractParser<TItem = any, TProperty = TItem> {
12
- abstract parseSchema(): SchemaProps;
13
- abstract getReferences(): Iterable<SchemaReferenceProps>;
14
- abstract getItems(): Iterable<SchemaItemTuple<TItem>>;
15
- abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;
16
- abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;
17
- abstract parseMixin(data: Readonly<TItem>): MixinProps;
18
- abstract parseStructClass(data: Readonly<TItem>): StructClassProps;
19
- abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;
20
- abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;
21
- abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;
22
- abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;
23
- abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;
24
- abstract parseUnit(data: Readonly<TItem>): UnitProps;
25
- abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;
26
- abstract parseConstant(data: Readonly<TItem>): ConstantProps;
27
- abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;
28
- abstract parseFormat(data: Readonly<TItem>): FormatProps;
29
- abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;
30
- abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;
31
- abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;
32
- abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;
33
- abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;
34
- abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;
35
- abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;
36
- abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;
37
- abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;
38
- abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;
39
- abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple>, Iterable<CAProviderTuple>];
40
- }
41
- /** @internal */
42
- export interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> {
43
- new (obj: Readonly<TSchema>): AbstractParser<TItem, TProperty>;
44
- }
45
- export {};
1
+ import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, FormatProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitProps, UnitSystemProps } from "../Deserialization/JsonProps";
2
+ import { CustomAttribute } from "../Metadata/CustomAttribute";
3
+ import { CustomAttributeClass } from "../Metadata/CustomAttributeClass";
4
+ declare type SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;
5
+ declare type PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;
6
+ /** @internal */
7
+ export declare type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;
8
+ /** @internal */
9
+ export declare type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;
10
+ /** @internal */
11
+ export declare abstract class AbstractParser<TItem = any, TProperty = TItem> {
12
+ abstract parseSchema(): SchemaProps;
13
+ abstract getReferences(): Iterable<SchemaReferenceProps>;
14
+ abstract getItems(): Iterable<SchemaItemTuple<TItem>>;
15
+ abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;
16
+ abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;
17
+ abstract parseMixin(data: Readonly<TItem>): MixinProps;
18
+ abstract parseStructClass(data: Readonly<TItem>): StructClassProps;
19
+ abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;
20
+ abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;
21
+ abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;
22
+ abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;
23
+ abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;
24
+ abstract parseUnit(data: Readonly<TItem>): UnitProps;
25
+ abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;
26
+ abstract parseConstant(data: Readonly<TItem>): ConstantProps;
27
+ abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;
28
+ abstract parseFormat(data: Readonly<TItem>): FormatProps;
29
+ abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;
30
+ abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;
31
+ abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;
32
+ abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;
33
+ abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;
34
+ abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;
35
+ abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;
36
+ abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;
37
+ abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;
38
+ abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;
39
+ abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple>, Iterable<CAProviderTuple>];
40
+ }
41
+ /** @internal */
42
+ export interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> {
43
+ new (obj: Readonly<TSchema>): AbstractParser<TItem, TProperty>;
44
+ }
45
+ export {};
46
46
  //# sourceMappingURL=AbstractParser.d.ts.map
@@ -1,12 +1,12 @@
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.AbstractParser = void 0;
8
- /** @internal */
9
- class AbstractParser {
10
- }
11
- exports.AbstractParser = AbstractParser;
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.AbstractParser = void 0;
8
+ /** @internal */
9
+ class AbstractParser {
10
+ }
11
+ exports.AbstractParser = AbstractParser;
12
12
  //# sourceMappingURL=AbstractParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAmB/F,gBAAgB;AAChB,MAAsB,cAAc;CAiCnC;AAjCD,wCAiCC","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 {\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, FormatProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps,\n SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitProps, UnitSystemProps,\n} from \"../Deserialization/JsonProps\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\n\ntype SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;\ntype PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;\n\n/** @internal */\nexport type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;\n\n/** @internal */\nexport type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;\n\n/** @internal */\nexport abstract class AbstractParser<TItem = any, TProperty = TItem> {\n public abstract parseSchema(): SchemaProps;\n public abstract getReferences(): Iterable<SchemaReferenceProps>;\n\n public abstract getItems(): Iterable<SchemaItemTuple<TItem>>;\n public abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;\n\n public abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;\n public abstract parseMixin(data: Readonly<TItem>): MixinProps;\n public abstract parseStructClass(data: Readonly<TItem>): StructClassProps;\n public abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;\n public abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;\n public abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;\n public abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;\n public abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;\n public abstract parseUnit(data: Readonly<TItem>): UnitProps;\n public abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;\n public abstract parseConstant(data: Readonly<TItem>): ConstantProps;\n public abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;\n public abstract parseFormat(data: Readonly<TItem>): FormatProps;\n public abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;\n\n public abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;\n public abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;\n public abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;\n public abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;\n public abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;\n public abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;\n\n public abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;\n public abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;\n public abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;\n public abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */];\n}\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/prefer-function-type\nexport interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> { new(obj: Readonly<TSchema>): AbstractParser<TItem, TProperty> }\n"]}
1
+ {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAmB/F,gBAAgB;AAChB,MAAsB,cAAc;CAiCnC;AAjCD,wCAiCC","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 {\r\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, FormatProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\r\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps,\r\n SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitProps, UnitSystemProps,\r\n} from \"../Deserialization/JsonProps\";\r\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\r\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\r\n\r\ntype SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;\r\ntype PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;\r\n\r\n/** @internal */\r\nexport type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;\r\n\r\n/** @internal */\r\nexport type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;\r\n\r\n/** @internal */\r\nexport abstract class AbstractParser<TItem = any, TProperty = TItem> {\r\n public abstract parseSchema(): SchemaProps;\r\n public abstract getReferences(): Iterable<SchemaReferenceProps>;\r\n\r\n public abstract getItems(): Iterable<SchemaItemTuple<TItem>>;\r\n public abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;\r\n\r\n public abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;\r\n public abstract parseMixin(data: Readonly<TItem>): MixinProps;\r\n public abstract parseStructClass(data: Readonly<TItem>): StructClassProps;\r\n public abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;\r\n public abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;\r\n public abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;\r\n public abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;\r\n public abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;\r\n public abstract parseUnit(data: Readonly<TItem>): UnitProps;\r\n public abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;\r\n public abstract parseConstant(data: Readonly<TItem>): ConstantProps;\r\n public abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;\r\n public abstract parseFormat(data: Readonly<TItem>): FormatProps;\r\n public abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;\r\n\r\n public abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;\r\n public abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;\r\n public abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;\r\n public abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;\r\n public abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;\r\n public abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;\r\n\r\n public abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;\r\n public abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;\r\n public abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;\r\n public abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */];\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/prefer-function-type\r\nexport interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> { new(obj: Readonly<TSchema>): AbstractParser<TItem, TProperty> }\r\n"]}