@itwin/ecschema-editing 3.7.0-dev.1 → 3.7.0-dev.3

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 (147) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/lib/cjs/Editing/Constants.d.ts +20 -20
  3. package/lib/cjs/Editing/Constants.js +60 -60
  4. package/lib/cjs/Editing/Constants.js.map +1 -1
  5. package/lib/cjs/Editing/CustomAttributes.d.ts +20 -20
  6. package/lib/cjs/Editing/CustomAttributes.js +59 -59
  7. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  8. package/lib/cjs/Editing/ECClasses.d.ts +54 -54
  9. package/lib/cjs/Editing/ECClasses.js +269 -269
  10. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  11. package/lib/cjs/Editing/Editor.d.ts +112 -112
  12. package/lib/cjs/Editing/Editor.js +166 -166
  13. package/lib/cjs/Editing/Editor.js.map +1 -1
  14. package/lib/cjs/Editing/Entities.d.ts +25 -25
  15. package/lib/cjs/Editing/Entities.js +116 -116
  16. package/lib/cjs/Editing/Entities.js.map +1 -1
  17. package/lib/cjs/Editing/Enumerations.d.ts +21 -21
  18. package/lib/cjs/Editing/Enumerations.js +66 -66
  19. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  20. package/lib/cjs/Editing/Formats.d.ts +21 -21
  21. package/lib/cjs/Editing/Formats.js +61 -61
  22. package/lib/cjs/Editing/Formats.js.map +1 -1
  23. package/lib/cjs/Editing/InvertedUnits.d.ts +17 -17
  24. package/lib/cjs/Editing/InvertedUnits.js +82 -82
  25. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  26. package/lib/cjs/Editing/KindOfQuantities.d.ts +28 -28
  27. package/lib/cjs/Editing/KindOfQuantities.js +78 -78
  28. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  29. package/lib/cjs/Editing/Mixins.d.ts +22 -22
  30. package/lib/cjs/Editing/Mixins.js +84 -84
  31. package/lib/cjs/Editing/Mixins.js.map +1 -1
  32. package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts +9 -9
  33. package/lib/cjs/Editing/Mutable/MutableCAClass.js +15 -15
  34. package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
  35. package/lib/cjs/Editing/Mutable/MutableClass.d.ts +34 -34
  36. package/lib/cjs/Editing/Mutable/MutableClass.js +22 -22
  37. package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
  38. package/lib/cjs/Editing/Mutable/MutableConstant.d.ts +12 -12
  39. package/lib/cjs/Editing/Mutable/MutableConstant.js +15 -15
  40. package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
  41. package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts +15 -15
  42. package/lib/cjs/Editing/Mutable/MutableEntityClass.js +59 -59
  43. package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
  44. package/lib/cjs/Editing/Mutable/MutableEnumeration.d.ts +9 -9
  45. package/lib/cjs/Editing/Mutable/MutableEnumeration.js +14 -14
  46. package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
  47. package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +18 -18
  48. package/lib/cjs/Editing/Mutable/MutableFormat.js +15 -15
  49. package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
  50. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.d.ts +10 -10
  51. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js +15 -15
  52. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
  53. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts +10 -10
  54. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js +15 -15
  55. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  56. package/lib/cjs/Editing/Mutable/MutableMixin.d.ts +11 -11
  57. package/lib/cjs/Editing/Mutable/MutableMixin.js +15 -15
  58. package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
  59. package/lib/cjs/Editing/Mutable/MutablePhenomenon.d.ts +9 -9
  60. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js +15 -15
  61. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
  62. package/lib/cjs/Editing/Mutable/MutableProperty.d.ts +8 -8
  63. package/lib/cjs/Editing/Mutable/MutableProperty.js +15 -15
  64. package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
  65. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.d.ts +9 -9
  66. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js +15 -15
  67. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
  68. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts +21 -21
  69. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js +24 -24
  70. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
  71. package/lib/cjs/Editing/Mutable/MutableSchema.d.ts +45 -45
  72. package/lib/cjs/Editing/Mutable/MutableSchema.js +17 -17
  73. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  74. package/lib/cjs/Editing/Mutable/MutableUnit.d.ts +11 -11
  75. package/lib/cjs/Editing/Mutable/MutableUnit.js +15 -15
  76. package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
  77. package/lib/cjs/Editing/Mutable/MutableUnitSystem.d.ts +8 -8
  78. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js +15 -15
  79. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
  80. package/lib/cjs/Editing/Phenomena.d.ts +15 -15
  81. package/lib/cjs/Editing/Phenomena.js +44 -44
  82. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  83. package/lib/cjs/Editing/PropertyCategories.d.ts +16 -16
  84. package/lib/cjs/Editing/PropertyCategories.js +51 -51
  85. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  86. package/lib/cjs/Editing/RelationshipClasses.d.ts +21 -21
  87. package/lib/cjs/Editing/RelationshipClasses.js +68 -68
  88. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  89. package/lib/cjs/Editing/Structs.d.ts +19 -19
  90. package/lib/cjs/Editing/Structs.js +57 -57
  91. package/lib/cjs/Editing/Structs.js.map +1 -1
  92. package/lib/cjs/Editing/UnitSystems.d.ts +15 -15
  93. package/lib/cjs/Editing/UnitSystems.js +41 -41
  94. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  95. package/lib/cjs/Editing/Units.d.ts +15 -15
  96. package/lib/cjs/Editing/Units.js +58 -58
  97. package/lib/cjs/Editing/Units.js.map +1 -1
  98. package/lib/cjs/Validation/Diagnostic.d.ts +321 -321
  99. package/lib/cjs/Validation/Diagnostic.js +310 -310
  100. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  101. package/lib/cjs/Validation/DiagnosticReporter.d.ts +96 -96
  102. package/lib/cjs/Validation/DiagnosticReporter.js +106 -106
  103. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  104. package/lib/cjs/Validation/ECRules.d.ts +448 -448
  105. package/lib/cjs/Validation/ECRules.js +593 -593
  106. package/lib/cjs/Validation/ECRules.js.map +1 -1
  107. package/lib/cjs/Validation/LoggingDiagnosticReporter.d.ts +13 -13
  108. package/lib/cjs/Validation/LoggingDiagnosticReporter.js +40 -40
  109. package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
  110. package/lib/cjs/Validation/RuleSuppressionSet.d.ts +59 -59
  111. package/lib/cjs/Validation/RuleSuppressionSet.js +9 -9
  112. package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
  113. package/lib/cjs/Validation/Rules.d.ts +64 -64
  114. package/lib/cjs/Validation/Rules.js +9 -9
  115. package/lib/cjs/Validation/Rules.js.map +1 -1
  116. package/lib/cjs/Validation/SchemaChanges.d.ts +607 -607
  117. package/lib/cjs/Validation/SchemaChanges.js +1135 -1135
  118. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  119. package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +422 -422
  120. package/lib/cjs/Validation/SchemaCompareDiagnostics.js +111 -111
  121. package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
  122. package/lib/cjs/Validation/SchemaCompareReporter.d.ts +11 -11
  123. package/lib/cjs/Validation/SchemaCompareReporter.js +9 -9
  124. package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
  125. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +236 -236
  126. package/lib/cjs/Validation/SchemaCompareResultDelegate.js +348 -348
  127. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  128. package/lib/cjs/Validation/SchemaCompareVisitor.d.ts +119 -119
  129. package/lib/cjs/Validation/SchemaCompareVisitor.js +206 -206
  130. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  131. package/lib/cjs/Validation/SchemaComparer.d.ts +171 -171
  132. package/lib/cjs/Validation/SchemaComparer.js +666 -666
  133. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  134. package/lib/cjs/Validation/SchemaValidater.d.ts +19 -19
  135. package/lib/cjs/Validation/SchemaValidater.js +61 -61
  136. package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
  137. package/lib/cjs/Validation/SchemaValidationVisitor.d.ts +170 -170
  138. package/lib/cjs/Validation/SchemaValidationVisitor.js +492 -492
  139. package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
  140. package/lib/cjs/Validation/SchemaWalker.d.ts +22 -22
  141. package/lib/cjs/Validation/SchemaWalker.js +51 -51
  142. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  143. package/lib/cjs/ecschema-editing.d.ts +33 -33
  144. package/lib/cjs/ecschema-editing.js +54 -54
  145. package/lib/cjs/ecschema-editing.js.map +1 -1
  146. package/package.json +10 -10
  147. package/public/locales/en/ECSchemaEditing.json +26 -26
@@ -1,322 +1,322 @@
1
- /** @packageDocumentation
2
- * @module Diagnostic
3
- */
4
- import { AnyClass, AnyECType, AnyProperty, CustomAttributeContainerProps, RelationshipConstraint, Schema, SchemaItem } from "@itwin/ecschema-metadata";
5
- /**
6
- * Defines the possible diagnostic types.
7
- * @beta
8
- */
9
- export declare enum DiagnosticType {
10
- None = 0,
11
- Schema = 1,
12
- SchemaItem = 2,
13
- Property = 3,
14
- CustomAttributeContainer = 4,
15
- RelationshipConstraint = 5
16
- }
17
- /**
18
- * Defines the possible diagnostic categories.
19
- * @beta
20
- */
21
- export declare enum DiagnosticCategory {
22
- Warning = 0,
23
- Error = 1,
24
- Suggestion = 2,
25
- Message = 3
26
- }
27
- /**
28
- * The interface implemented by all diagnostics used during schema validation.
29
- * @beta
30
- */
31
- export interface IDiagnostic<TYPE extends AnyECType, ARGS extends any[]> {
32
- /** The diagnostic category (error, warning, etc...). Value is static across all instances. */
33
- category: DiagnosticCategory;
34
- /** The unique string identifier of the diagnostic in the format '<ruleSetName>:<number>. Value is static across all instances. */
35
- code: string;
36
- /** The context type of diagnostic (schema, schema item, property, etc...). Value is static across all instances. */
37
- diagnosticType: DiagnosticType;
38
- /** The unformatted message text associated with the diagnostic. Value is static across all instances. */
39
- messageText: string;
40
- /** The arguments used when formatted the diagnostic instance's message. */
41
- messageArgs?: ARGS;
42
- /** The EC object associated with the diagnostic instance. */
43
- ecDefinition: TYPE;
44
- /** The schema where the diagnostic originated. */
45
- schema: Schema;
46
- }
47
- /**
48
- * Type which encapsulates all possible diagnostics.
49
- * @beta
50
- */
51
- export declare type AnyDiagnostic = IDiagnostic<AnyECType, any[]>;
52
- /**
53
- * The abstract base class for all [[IDiagnostic]] implementations.
54
- * @beta
55
- */
56
- export declare abstract class BaseDiagnostic<TYPE extends AnyECType, ARGS extends any[]> implements IDiagnostic<TYPE, ARGS> {
57
- /**
58
- * Initializes a new BaseDiagnostic.
59
- * @param ecDefinition The EC object to associate with the diagnostic.
60
- * @param messageArgs The arguments used when formatting the diagnostic message.
61
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
62
- */
63
- constructor(ecDefinition: TYPE, messageArgs?: ARGS, category?: DiagnosticCategory);
64
- /** Gets the unique string identifier for the diagnostic in the format '<ruleSetName>:<number>'. */
65
- abstract get code(): string;
66
- /** Gets the context type of the diagnostic (schema, schema item, property, etc...) */
67
- abstract get diagnosticType(): DiagnosticType;
68
- /** Gets the message associated with the diagnostic. */
69
- abstract get messageText(): string;
70
- /** Gets the schema where the diagnostic originated. */
71
- abstract get schema(): Schema;
72
- /** The EC object to associate with the diagnostic. */
73
- ecDefinition: TYPE;
74
- /** The arguments used when formatting the diagnostic message. */
75
- messageArgs?: ARGS;
76
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
77
- category: DiagnosticCategory;
78
- }
79
- /**
80
- * An [[IDiagnostic]] implementation used for [[Schema]] diagnostics.
81
- * @beta
82
- */
83
- export declare abstract class SchemaDiagnostic<ARGS extends any[]> extends BaseDiagnostic<Schema, ARGS> {
84
- static diagnosticType: DiagnosticType;
85
- /**
86
- * Initializes a new SchemaDiagnostic.
87
- * @param ecDefinition The EC object to associate with the diagnostic.
88
- * @param messageArgs The arguments used when formatting the diagnostic message.
89
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
90
- */
91
- constructor(schema: Schema, messageArgs: ARGS, category?: DiagnosticCategory);
92
- /** Gets the schema where the diagnostic originated. */
93
- get schema(): Schema;
94
- /** Gets the DiagnosticType. */
95
- get diagnosticType(): DiagnosticType;
96
- }
97
- /**
98
- * An [[IDiagnostic]] implementation used for [[SchemaItem]] diagnostics.
99
- * @beta
100
- */
101
- export declare abstract class SchemaItemDiagnostic<TYPE extends SchemaItem, ARGS extends any[]> extends BaseDiagnostic<TYPE, ARGS> {
102
- static diagnosticType: DiagnosticType;
103
- /**
104
- * Initializes a new SchemaItemDiagnostic.
105
- * @param ecDefinition The EC object to associate with the diagnostic.
106
- * @param messageArgs The arguments used when formatting the diagnostic message.
107
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
108
- */
109
- constructor(ecDefinition: SchemaItem, messageArgs: ARGS, category?: DiagnosticCategory);
110
- /** Gets the schema where the diagnostic originated. */
111
- get schema(): Schema;
112
- /** Gets the DiagnosticType. */
113
- get diagnosticType(): DiagnosticType;
114
- }
115
- /**
116
- * An [[IDiagnostic]] implementation used for [[ECClass]] diagnostics.
117
- * @beta
118
- */
119
- export declare abstract class ClassDiagnostic<ARGS extends any[]> extends SchemaItemDiagnostic<AnyClass, ARGS> {
120
- /**
121
- * Initializes a new ClassDiagnostic.
122
- * @param ecClass The class to associate with the diagnostic.
123
- * @param messageArgs The arguments used when formatting the diagnostic message.
124
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
125
- */
126
- constructor(ecClass: AnyClass, messageArgs: ARGS, category?: DiagnosticCategory);
127
- /** Gets the schema where the diagnostic originated. */
128
- get schema(): Schema;
129
- }
130
- /**
131
- * An [[IDiagnostic]] implementation used for [[Property]] diagnostics.
132
- * @beta
133
- */
134
- export declare abstract class PropertyDiagnostic<ARGS extends any[]> extends BaseDiagnostic<AnyProperty, ARGS> {
135
- /**
136
- * Initializes a new PropertyDiagnostic.
137
- * @param property The property to associate with the diagnostic.
138
- * @param messageArgs The arguments used when formatting the diagnostic message.
139
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
140
- */
141
- constructor(property: AnyProperty, messageArgs?: ARGS, category?: DiagnosticCategory);
142
- /** Gets the schema where the diagnostic originated. */
143
- get schema(): Schema;
144
- /** Gets the DiagnosticType. */
145
- get diagnosticType(): DiagnosticType;
146
- }
147
- /**
148
- * An [[IDiagnostic]] implementation used for [[RelationshipConstraint]] diagnostics.
149
- * @beta
150
- */
151
- export declare abstract class RelationshipConstraintDiagnostic<ARGS extends any[]> extends BaseDiagnostic<RelationshipConstraint, ARGS> {
152
- /**
153
- * Initializes a new RelationshipConstraintDiagnostic.
154
- * @param constraint The Relationship Constraint to associate with the diagnostic.
155
- * @param messageArgs The arguments used when formatting the diagnostic message.
156
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
157
- */
158
- constructor(constraint: RelationshipConstraint, messageArgs: ARGS, category?: DiagnosticCategory);
159
- /** Gets the schema where the diagnostic originated. */
160
- get schema(): Schema;
161
- /** Gets the DiagnosticType. */
162
- get diagnosticType(): DiagnosticType;
163
- }
164
- /**
165
- * An [[IDiagnostic]] implementation used for [[CustomAttributeContainerProps]] diagnostics.
166
- * @beta
167
- */
168
- export declare abstract class CustomAttributeContainerDiagnostic<ARGS extends any[]> extends BaseDiagnostic<CustomAttributeContainerProps, ARGS> {
169
- /**
170
- * Initializes a new CustomAttributeContainerDiagnostic.
171
- * @param constraint The Custom Attribute Container to associate with the diagnostic.
172
- * @param messageArgs The arguments used when formatting the diagnostic message.
173
- * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
174
- */
175
- constructor(container: CustomAttributeContainerProps, messageArgs: ARGS, category?: DiagnosticCategory);
176
- /** Gets the schema where the diagnostic originated. */
177
- get schema(): Schema;
178
- /** Gets the DiagnosticType. */
179
- get diagnosticType(): DiagnosticType;
180
- }
181
- /**
182
- * Helper method for creating [[SchemaDiagnostic]] child classes.
183
- * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
184
- * @param messageText The message to associate with the diagnostic class.
185
- * @beta
186
- */
187
- export declare function createSchemaDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
188
- new (schema: Schema, messageArgs: ARGS, category?: DiagnosticCategory): {
189
- readonly code: string;
190
- readonly messageText: string;
191
- /** Gets the schema where the diagnostic originated. */
192
- readonly schema: Schema;
193
- /** Gets the DiagnosticType. */
194
- readonly diagnosticType: DiagnosticType;
195
- /** The EC object to associate with the diagnostic. */
196
- ecDefinition: Schema;
197
- /** The arguments used when formatting the diagnostic message. */
198
- messageArgs?: ARGS | undefined;
199
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
200
- category: DiagnosticCategory;
201
- };
202
- code: string;
203
- diagnosticType: DiagnosticType;
204
- };
205
- /**
206
- * Helper method for creating [[SchemaItemDiagnostic]] child classes.
207
- * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
208
- * @param messageText The message to associate with the diagnostic class.
209
- * @beta
210
- */
211
- export declare function createSchemaItemDiagnosticClass<ITEM extends SchemaItem, ARGS extends any[]>(code: string, messageText: string): {
212
- new (ecDefinition: SchemaItem, messageArgs: ARGS, category?: DiagnosticCategory): {
213
- readonly code: string;
214
- readonly messageText: string;
215
- /** Gets the schema where the diagnostic originated. */
216
- readonly schema: Schema;
217
- /** Gets the DiagnosticType. */
218
- readonly diagnosticType: DiagnosticType;
219
- /** The EC object to associate with the diagnostic. */
220
- ecDefinition: ITEM;
221
- /** The arguments used when formatting the diagnostic message. */
222
- messageArgs?: ARGS | undefined;
223
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
224
- category: DiagnosticCategory;
225
- };
226
- diagnosticType: DiagnosticType;
227
- };
228
- /**
229
- * Helper method for creating [[ClassDiagnostic]] child classes.
230
- * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
231
- * @param messageText The message to associate with the diagnostic class.
232
- * @beta
233
- */
234
- export declare function createClassDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
235
- new (ecClass: AnyClass, messageArgs: ARGS, category?: DiagnosticCategory): {
236
- readonly code: string;
237
- readonly messageText: string;
238
- /** Gets the schema where the diagnostic originated. */
239
- readonly schema: Schema;
240
- /** Gets the DiagnosticType. */
241
- readonly diagnosticType: DiagnosticType;
242
- /** The EC object to associate with the diagnostic. */
243
- ecDefinition: AnyClass;
244
- /** The arguments used when formatting the diagnostic message. */
245
- messageArgs?: ARGS | undefined;
246
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
247
- category: DiagnosticCategory;
248
- };
249
- diagnosticType: DiagnosticType;
250
- };
251
- /**
252
- * Helper method for creating [[PropertyDiagnostic]] child classes.
253
- * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
254
- * @param messageText The message to associate with the diagnostic class.
255
- * @beta
256
- */
257
- export declare function createPropertyDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
258
- new (property: AnyProperty, messageArgs?: ARGS | undefined, category?: DiagnosticCategory): {
259
- readonly code: string;
260
- readonly messageText: string;
261
- /** Gets the schema where the diagnostic originated. */
262
- readonly schema: Schema;
263
- /** Gets the DiagnosticType. */
264
- readonly diagnosticType: DiagnosticType;
265
- /** The EC object to associate with the diagnostic. */
266
- ecDefinition: AnyProperty;
267
- /** The arguments used when formatting the diagnostic message. */
268
- messageArgs?: ARGS | undefined;
269
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
270
- category: DiagnosticCategory;
271
- };
272
- code: string;
273
- };
274
- /**
275
- * Helper method for creating [[RelationshipConstraintDiagnostic]] child classes.
276
- * @param code The string that uniquely identifies the type of diagnostic in the format '<ruleSetName>:<number>'.
277
- * @param messageText The message to associate with the diagnostic class.
278
- * @beta
279
- */
280
- export declare function createRelationshipConstraintDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
281
- new (constraint: RelationshipConstraint, messageArgs: ARGS, category?: DiagnosticCategory): {
282
- readonly code: string;
283
- readonly messageText: string;
284
- /** Gets the schema where the diagnostic originated. */
285
- readonly schema: Schema;
286
- /** Gets the DiagnosticType. */
287
- readonly diagnosticType: DiagnosticType;
288
- /** The EC object to associate with the diagnostic. */
289
- ecDefinition: RelationshipConstraint;
290
- /** The arguments used when formatting the diagnostic message. */
291
- messageArgs?: ARGS | undefined;
292
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
293
- category: DiagnosticCategory;
294
- };
295
- };
296
- /**
297
- * Helper method for creating [[CustomAttributeContainerDiagnostic]] child classes.
298
- * @param code The that uniquely identifies the type of diagnostic in the format '<ruleSetName>:<number>'.
299
- * @param messageText The message to associate with the diagnostic class.
300
- * @beta
301
- */
302
- export declare function createCustomAttributeContainerDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
303
- new (container: CustomAttributeContainerProps, messageArgs: ARGS, category?: DiagnosticCategory): {
304
- readonly code: string;
305
- readonly messageText: string;
306
- /** Gets the schema where the diagnostic originated. */
307
- readonly schema: Schema;
308
- /** Gets the DiagnosticType. */
309
- readonly diagnosticType: DiagnosticType;
310
- /** The EC object to associate with the diagnostic. */
311
- ecDefinition: CustomAttributeContainerProps;
312
- /** The arguments used when formatting the diagnostic message. */
313
- messageArgs?: ARGS | undefined;
314
- /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
315
- category: DiagnosticCategory;
316
- };
317
- };
318
- /** @beta */
319
- export declare function diagnosticCategoryToString(category: DiagnosticCategory): "Error" | "Warning" | "Message" | "Suggestion";
320
- /** @beta */
321
- export declare function diagnosticTypeToString(type: DiagnosticType): "CustomAttributeContainer" | "None" | "Property" | "RelationshipConstraint" | "Schema" | "SchemaItem";
1
+ /** @packageDocumentation
2
+ * @module Diagnostic
3
+ */
4
+ import { AnyClass, AnyECType, AnyProperty, CustomAttributeContainerProps, RelationshipConstraint, Schema, SchemaItem } from "@itwin/ecschema-metadata";
5
+ /**
6
+ * Defines the possible diagnostic types.
7
+ * @beta
8
+ */
9
+ export declare enum DiagnosticType {
10
+ None = 0,
11
+ Schema = 1,
12
+ SchemaItem = 2,
13
+ Property = 3,
14
+ CustomAttributeContainer = 4,
15
+ RelationshipConstraint = 5
16
+ }
17
+ /**
18
+ * Defines the possible diagnostic categories.
19
+ * @beta
20
+ */
21
+ export declare enum DiagnosticCategory {
22
+ Warning = 0,
23
+ Error = 1,
24
+ Suggestion = 2,
25
+ Message = 3
26
+ }
27
+ /**
28
+ * The interface implemented by all diagnostics used during schema validation.
29
+ * @beta
30
+ */
31
+ export interface IDiagnostic<TYPE extends AnyECType, ARGS extends any[]> {
32
+ /** The diagnostic category (error, warning, etc...). Value is static across all instances. */
33
+ category: DiagnosticCategory;
34
+ /** The unique string identifier of the diagnostic in the format '<ruleSetName>:<number>. Value is static across all instances. */
35
+ code: string;
36
+ /** The context type of diagnostic (schema, schema item, property, etc...). Value is static across all instances. */
37
+ diagnosticType: DiagnosticType;
38
+ /** The unformatted message text associated with the diagnostic. Value is static across all instances. */
39
+ messageText: string;
40
+ /** The arguments used when formatted the diagnostic instance's message. */
41
+ messageArgs?: ARGS;
42
+ /** The EC object associated with the diagnostic instance. */
43
+ ecDefinition: TYPE;
44
+ /** The schema where the diagnostic originated. */
45
+ schema: Schema;
46
+ }
47
+ /**
48
+ * Type which encapsulates all possible diagnostics.
49
+ * @beta
50
+ */
51
+ export declare type AnyDiagnostic = IDiagnostic<AnyECType, any[]>;
52
+ /**
53
+ * The abstract base class for all [[IDiagnostic]] implementations.
54
+ * @beta
55
+ */
56
+ export declare abstract class BaseDiagnostic<TYPE extends AnyECType, ARGS extends any[]> implements IDiagnostic<TYPE, ARGS> {
57
+ /**
58
+ * Initializes a new BaseDiagnostic.
59
+ * @param ecDefinition The EC object to associate with the diagnostic.
60
+ * @param messageArgs The arguments used when formatting the diagnostic message.
61
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
62
+ */
63
+ constructor(ecDefinition: TYPE, messageArgs?: ARGS, category?: DiagnosticCategory);
64
+ /** Gets the unique string identifier for the diagnostic in the format '<ruleSetName>:<number>'. */
65
+ abstract get code(): string;
66
+ /** Gets the context type of the diagnostic (schema, schema item, property, etc...) */
67
+ abstract get diagnosticType(): DiagnosticType;
68
+ /** Gets the message associated with the diagnostic. */
69
+ abstract get messageText(): string;
70
+ /** Gets the schema where the diagnostic originated. */
71
+ abstract get schema(): Schema;
72
+ /** The EC object to associate with the diagnostic. */
73
+ ecDefinition: TYPE;
74
+ /** The arguments used when formatting the diagnostic message. */
75
+ messageArgs?: ARGS;
76
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
77
+ category: DiagnosticCategory;
78
+ }
79
+ /**
80
+ * An [[IDiagnostic]] implementation used for [[Schema]] diagnostics.
81
+ * @beta
82
+ */
83
+ export declare abstract class SchemaDiagnostic<ARGS extends any[]> extends BaseDiagnostic<Schema, ARGS> {
84
+ static diagnosticType: DiagnosticType;
85
+ /**
86
+ * Initializes a new SchemaDiagnostic.
87
+ * @param ecDefinition The EC object to associate with the diagnostic.
88
+ * @param messageArgs The arguments used when formatting the diagnostic message.
89
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
90
+ */
91
+ constructor(schema: Schema, messageArgs: ARGS, category?: DiagnosticCategory);
92
+ /** Gets the schema where the diagnostic originated. */
93
+ get schema(): Schema;
94
+ /** Gets the DiagnosticType. */
95
+ get diagnosticType(): DiagnosticType;
96
+ }
97
+ /**
98
+ * An [[IDiagnostic]] implementation used for [[SchemaItem]] diagnostics.
99
+ * @beta
100
+ */
101
+ export declare abstract class SchemaItemDiagnostic<TYPE extends SchemaItem, ARGS extends any[]> extends BaseDiagnostic<TYPE, ARGS> {
102
+ static diagnosticType: DiagnosticType;
103
+ /**
104
+ * Initializes a new SchemaItemDiagnostic.
105
+ * @param ecDefinition The EC object to associate with the diagnostic.
106
+ * @param messageArgs The arguments used when formatting the diagnostic message.
107
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
108
+ */
109
+ constructor(ecDefinition: SchemaItem, messageArgs: ARGS, category?: DiagnosticCategory);
110
+ /** Gets the schema where the diagnostic originated. */
111
+ get schema(): Schema;
112
+ /** Gets the DiagnosticType. */
113
+ get diagnosticType(): DiagnosticType;
114
+ }
115
+ /**
116
+ * An [[IDiagnostic]] implementation used for [[ECClass]] diagnostics.
117
+ * @beta
118
+ */
119
+ export declare abstract class ClassDiagnostic<ARGS extends any[]> extends SchemaItemDiagnostic<AnyClass, ARGS> {
120
+ /**
121
+ * Initializes a new ClassDiagnostic.
122
+ * @param ecClass The class to associate with the diagnostic.
123
+ * @param messageArgs The arguments used when formatting the diagnostic message.
124
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
125
+ */
126
+ constructor(ecClass: AnyClass, messageArgs: ARGS, category?: DiagnosticCategory);
127
+ /** Gets the schema where the diagnostic originated. */
128
+ get schema(): Schema;
129
+ }
130
+ /**
131
+ * An [[IDiagnostic]] implementation used for [[Property]] diagnostics.
132
+ * @beta
133
+ */
134
+ export declare abstract class PropertyDiagnostic<ARGS extends any[]> extends BaseDiagnostic<AnyProperty, ARGS> {
135
+ /**
136
+ * Initializes a new PropertyDiagnostic.
137
+ * @param property The property to associate with the diagnostic.
138
+ * @param messageArgs The arguments used when formatting the diagnostic message.
139
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
140
+ */
141
+ constructor(property: AnyProperty, messageArgs?: ARGS, category?: DiagnosticCategory);
142
+ /** Gets the schema where the diagnostic originated. */
143
+ get schema(): Schema;
144
+ /** Gets the DiagnosticType. */
145
+ get diagnosticType(): DiagnosticType;
146
+ }
147
+ /**
148
+ * An [[IDiagnostic]] implementation used for [[RelationshipConstraint]] diagnostics.
149
+ * @beta
150
+ */
151
+ export declare abstract class RelationshipConstraintDiagnostic<ARGS extends any[]> extends BaseDiagnostic<RelationshipConstraint, ARGS> {
152
+ /**
153
+ * Initializes a new RelationshipConstraintDiagnostic.
154
+ * @param constraint The Relationship Constraint to associate with the diagnostic.
155
+ * @param messageArgs The arguments used when formatting the diagnostic message.
156
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
157
+ */
158
+ constructor(constraint: RelationshipConstraint, messageArgs: ARGS, category?: DiagnosticCategory);
159
+ /** Gets the schema where the diagnostic originated. */
160
+ get schema(): Schema;
161
+ /** Gets the DiagnosticType. */
162
+ get diagnosticType(): DiagnosticType;
163
+ }
164
+ /**
165
+ * An [[IDiagnostic]] implementation used for [[CustomAttributeContainerProps]] diagnostics.
166
+ * @beta
167
+ */
168
+ export declare abstract class CustomAttributeContainerDiagnostic<ARGS extends any[]> extends BaseDiagnostic<CustomAttributeContainerProps, ARGS> {
169
+ /**
170
+ * Initializes a new CustomAttributeContainerDiagnostic.
171
+ * @param constraint The Custom Attribute Container to associate with the diagnostic.
172
+ * @param messageArgs The arguments used when formatting the diagnostic message.
173
+ * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.
174
+ */
175
+ constructor(container: CustomAttributeContainerProps, messageArgs: ARGS, category?: DiagnosticCategory);
176
+ /** Gets the schema where the diagnostic originated. */
177
+ get schema(): Schema;
178
+ /** Gets the DiagnosticType. */
179
+ get diagnosticType(): DiagnosticType;
180
+ }
181
+ /**
182
+ * Helper method for creating [[SchemaDiagnostic]] child classes.
183
+ * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
184
+ * @param messageText The message to associate with the diagnostic class.
185
+ * @beta
186
+ */
187
+ export declare function createSchemaDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
188
+ new (schema: Schema, messageArgs: ARGS, category?: DiagnosticCategory): {
189
+ readonly code: string;
190
+ readonly messageText: string;
191
+ /** Gets the schema where the diagnostic originated. */
192
+ readonly schema: Schema;
193
+ /** Gets the DiagnosticType. */
194
+ readonly diagnosticType: DiagnosticType;
195
+ /** The EC object to associate with the diagnostic. */
196
+ ecDefinition: Schema;
197
+ /** The arguments used when formatting the diagnostic message. */
198
+ messageArgs?: ARGS | undefined;
199
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
200
+ category: DiagnosticCategory;
201
+ };
202
+ code: string;
203
+ diagnosticType: DiagnosticType;
204
+ };
205
+ /**
206
+ * Helper method for creating [[SchemaItemDiagnostic]] child classes.
207
+ * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
208
+ * @param messageText The message to associate with the diagnostic class.
209
+ * @beta
210
+ */
211
+ export declare function createSchemaItemDiagnosticClass<ITEM extends SchemaItem, ARGS extends any[]>(code: string, messageText: string): {
212
+ new (ecDefinition: SchemaItem, messageArgs: ARGS, category?: DiagnosticCategory): {
213
+ readonly code: string;
214
+ readonly messageText: string;
215
+ /** Gets the schema where the diagnostic originated. */
216
+ readonly schema: Schema;
217
+ /** Gets the DiagnosticType. */
218
+ readonly diagnosticType: DiagnosticType;
219
+ /** The EC object to associate with the diagnostic. */
220
+ ecDefinition: ITEM;
221
+ /** The arguments used when formatting the diagnostic message. */
222
+ messageArgs?: ARGS | undefined;
223
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
224
+ category: DiagnosticCategory;
225
+ };
226
+ diagnosticType: DiagnosticType;
227
+ };
228
+ /**
229
+ * Helper method for creating [[ClassDiagnostic]] child classes.
230
+ * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
231
+ * @param messageText The message to associate with the diagnostic class.
232
+ * @beta
233
+ */
234
+ export declare function createClassDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
235
+ new (ecClass: AnyClass, messageArgs: ARGS, category?: DiagnosticCategory): {
236
+ readonly code: string;
237
+ readonly messageText: string;
238
+ /** Gets the schema where the diagnostic originated. */
239
+ readonly schema: Schema;
240
+ /** Gets the DiagnosticType. */
241
+ readonly diagnosticType: DiagnosticType;
242
+ /** The EC object to associate with the diagnostic. */
243
+ ecDefinition: AnyClass;
244
+ /** The arguments used when formatting the diagnostic message. */
245
+ messageArgs?: ARGS | undefined;
246
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
247
+ category: DiagnosticCategory;
248
+ };
249
+ diagnosticType: DiagnosticType;
250
+ };
251
+ /**
252
+ * Helper method for creating [[PropertyDiagnostic]] child classes.
253
+ * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.
254
+ * @param messageText The message to associate with the diagnostic class.
255
+ * @beta
256
+ */
257
+ export declare function createPropertyDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
258
+ new (property: AnyProperty, messageArgs?: ARGS | undefined, category?: DiagnosticCategory): {
259
+ readonly code: string;
260
+ readonly messageText: string;
261
+ /** Gets the schema where the diagnostic originated. */
262
+ readonly schema: Schema;
263
+ /** Gets the DiagnosticType. */
264
+ readonly diagnosticType: DiagnosticType;
265
+ /** The EC object to associate with the diagnostic. */
266
+ ecDefinition: AnyProperty;
267
+ /** The arguments used when formatting the diagnostic message. */
268
+ messageArgs?: ARGS | undefined;
269
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
270
+ category: DiagnosticCategory;
271
+ };
272
+ code: string;
273
+ };
274
+ /**
275
+ * Helper method for creating [[RelationshipConstraintDiagnostic]] child classes.
276
+ * @param code The string that uniquely identifies the type of diagnostic in the format '<ruleSetName>:<number>'.
277
+ * @param messageText The message to associate with the diagnostic class.
278
+ * @beta
279
+ */
280
+ export declare function createRelationshipConstraintDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
281
+ new (constraint: RelationshipConstraint, messageArgs: ARGS, category?: DiagnosticCategory): {
282
+ readonly code: string;
283
+ readonly messageText: string;
284
+ /** Gets the schema where the diagnostic originated. */
285
+ readonly schema: Schema;
286
+ /** Gets the DiagnosticType. */
287
+ readonly diagnosticType: DiagnosticType;
288
+ /** The EC object to associate with the diagnostic. */
289
+ ecDefinition: RelationshipConstraint;
290
+ /** The arguments used when formatting the diagnostic message. */
291
+ messageArgs?: ARGS | undefined;
292
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
293
+ category: DiagnosticCategory;
294
+ };
295
+ };
296
+ /**
297
+ * Helper method for creating [[CustomAttributeContainerDiagnostic]] child classes.
298
+ * @param code The that uniquely identifies the type of diagnostic in the format '<ruleSetName>:<number>'.
299
+ * @param messageText The message to associate with the diagnostic class.
300
+ * @beta
301
+ */
302
+ export declare function createCustomAttributeContainerDiagnosticClass<ARGS extends any[]>(code: string, messageText: string): {
303
+ new (container: CustomAttributeContainerProps, messageArgs: ARGS, category?: DiagnosticCategory): {
304
+ readonly code: string;
305
+ readonly messageText: string;
306
+ /** Gets the schema where the diagnostic originated. */
307
+ readonly schema: Schema;
308
+ /** Gets the DiagnosticType. */
309
+ readonly diagnosticType: DiagnosticType;
310
+ /** The EC object to associate with the diagnostic. */
311
+ ecDefinition: CustomAttributeContainerProps;
312
+ /** The arguments used when formatting the diagnostic message. */
313
+ messageArgs?: ARGS | undefined;
314
+ /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */
315
+ category: DiagnosticCategory;
316
+ };
317
+ };
318
+ /** @beta */
319
+ export declare function diagnosticCategoryToString(category: DiagnosticCategory): "Error" | "Warning" | "Message" | "Suggestion";
320
+ /** @beta */
321
+ export declare function diagnosticTypeToString(type: DiagnosticType): "CustomAttributeContainer" | "None" | "Property" | "RelationshipConstraint" | "Schema" | "SchemaItem";
322
322
  //# sourceMappingURL=Diagnostic.d.ts.map