praxis-kit 4.0.1 → 4.0.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.
@@ -1,4 +1,5 @@
1
- import { Except, RequireAtLeastOne, Simplify, ReadonlyDeep } from 'type-fest';
1
+ import { Diagnostics as Diagnostics$1, DiagnosticInput } from '../_shared/diagnostics.js';
2
+ import { RequireAtLeastOne, Simplify, ReadonlyDeep } from 'type-fest';
2
3
 
3
4
  type StringMap<T = unknown> = Record<string, T>;
4
5
  type AnyRecord = StringMap<unknown>;
@@ -22,148 +23,6 @@ type IntrinsicProps = AnyRecord & {
22
23
  };
23
24
  type TagMap = Partial<Record<IntrinsicTag | (string & {}), ClassName>>;
24
25
 
25
- declare enum DiagnosticCategory {
26
- Contract = 0,
27
- HTML = 1,
28
- ARIA = 2,
29
- Composition = 3,
30
- Rendering = 4,
31
- Accessibility = 5,
32
- Performance = 6,
33
- Internal = 7,
34
- Deprecation = 8,
35
- Lint = 9
36
- }
37
-
38
- declare enum DiagnosticCode {
39
- MissingRequiredChild = "COMP1001",
40
- InvalidParent = "COMP1002",
41
- InvalidChild = "COMP1003",
42
- UnexpectedChild = "COMP1004",
43
- AmbiguousChild = "COMP1005",
44
- CardinalityMin = "COMP1006",
45
- CardinalityMax = "COMP1007",
46
- PositionViolation = "COMP1008",
47
- AllowedAsViolation = "COMP1009",
48
- SlotExclusive = "SLOT1001",
49
- SlotSingleChild = "SLOT1002",
50
- SlotDiscardedChildren = "SLOT1003",
51
- SlotRenderFn = "SLOT1004",
52
- MissingAriaRelationship = "ARIA2001",
53
- AriaViolation = "ARIA2002",
54
- AriaAttributeInvalid = "ARIA2003",
55
- AriaMissingLiveRegion = "ARIA2004",
56
- AriaMissingAtomic = "ARIA2005",
57
- AriaRelevantInvalidToken = "ARIA2006",
58
- AriaRelevantSuperseded = "ARIA2007",
59
- AriaInvalidRole = "ARIA2008",
60
- AriaMissingAccessibleName = "ARIA2009",
61
- AriaAttributeOnPresentational = "ARIA2010",
62
- AriaHiddenOnFocusable = "ARIA2011",
63
- AriaRequiredProperty = "ARIA2012",
64
- AriaInvalidAttributeValue = "ARIA2013",
65
- AriaRedundantLevelAttribute = "ARIA2014",
66
- InvalidHeadingHierarchy = "HTML3001",
67
- HtmlEmptyRole = "HTML3002",
68
- HtmlImplicitRoleRedundant = "HTML3003",
69
- HtmlImplicitRoleOverride = "HTML3004",
70
- HtmlStandaloneRegionOverride = "HTML3005",
71
- HtmlLandmarkRoleOverride = "HTML3006",
72
- HtmlInvalidChild = "HTML3007",
73
- InvalidRenderingTarget = "RENDER4001",
74
- LintDeadCompoundKey = "LINT5001",
75
- LintDeadCompoundValue = "LINT5002",
76
- LintDeadCompoundNonLiteral = "LINT5003",
77
- LintMissingStrict = "LINT5004",
78
- LintInvalidDefaultKey = "LINT5005",
79
- LintInvalidDefaultValue = "LINT5006",
80
- LintInvalidDefaultNonLiteral = "LINT5007",
81
- LintNegativeMin = "LINT5008",
82
- LintNegativeMax = "LINT5009",
83
- LintMaxLessThanMin = "LINT5010",
84
- LintZeroMax = "LINT5011",
85
- LintMultipleFirst = "LINT5012",
86
- LintMultipleLast = "LINT5013",
87
- LintMinSumExceedsCapacity = "LINT5014",
88
- LintCardinalityViolation = "LINT5015",
89
- LintAriaTagOverride = "LINT5016",
90
- ContractUnknownVariantDim = "COMP1010",
91
- ContractUnknownVariantValue = "COMP1011",
92
- ContractUnknownRecipeKey = "COMP1012",
93
- ContractInvalidVariantValue = "COMP1013",
94
- TailwindMultipleDisplayProps = "CSS6001",
95
- TailwindReservedLayoutLiteral = "CSS6002",
96
- TailwindDeadVariantClass = "CSS6003",
97
- PluginInvalidShape = "PLUGIN7001",
98
- PluginPipelineReturnType = "PLUGIN7002",
99
- InternalError = "INTERNAL9000"
100
- }
101
-
102
- interface SourcePosition {
103
- line: number;
104
- col: number;
105
- }
106
- interface SourceLocation {
107
- file: string;
108
- start: SourcePosition;
109
- end?: SourcePosition;
110
- }
111
-
112
- declare enum Severity$1 {
113
- Debug = 0,
114
- Info = 1,
115
- Warning = 2,
116
- Error = 3,
117
- Fatal = 4
118
- }
119
-
120
- interface DiagnosticSuggestion {
121
- title: string;
122
- description?: string;
123
- fix?: string;
124
- }
125
-
126
- type Context = AnyRecord;
127
- type Metadata = AnyRecord;
128
- interface Diagnostic {
129
- code: DiagnosticCode;
130
- severity: Severity$1;
131
- category: DiagnosticCategory;
132
- message: string;
133
- rationale?: string;
134
- component?: string;
135
- contract?: string;
136
- location?: SourceLocation;
137
- suggestions?: DiagnosticSuggestion[];
138
- context?: Context;
139
- metadata?: Metadata;
140
- }
141
-
142
- declare enum Enforcement {
143
- Ignore = 0,
144
- Report = 1,
145
- Throw = 2
146
- }
147
- interface DiagnosticPolicy {
148
- resolve(diagnostic: Diagnostic): Enforcement;
149
- }
150
-
151
- interface DiagnosticReporter {
152
- report(diagnostic: Diagnostic): void;
153
- }
154
-
155
- type DiagnosticInput = Except<Diagnostic, 'severity'>;
156
- declare class Diagnostics {
157
- private readonly reporter;
158
- private readonly policy;
159
- readonly active: boolean;
160
- constructor(reporter: DiagnosticReporter, policy?: DiagnosticPolicy);
161
- report(diagnostic: Diagnostic): Diagnostic;
162
- warn(input: DiagnosticInput): Diagnostic;
163
- error(input: DiagnosticInput): Diagnostic;
164
- info(input: DiagnosticInput): Diagnostic;
165
- }
166
-
167
26
  type MinMax = {
168
27
  min: number;
169
28
  max: number;
@@ -271,7 +130,7 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
271
130
  readonly _pluginProps?: TProps;
272
131
  }>;
273
132
 
274
- type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, diagnostics: Diagnostics) => ClassPlugin<TProps>;
133
+ type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, diagnostics: Diagnostics$1) => ClassPlugin<TProps>;
275
134
 
276
135
  type AriaContext = {
277
136
  readonly tag: IntrinsicTag;
@@ -323,7 +182,7 @@ type AriaRule<C extends AriaContext = AriaContext> = (context: C) => readonly Ar
323
182
  type PropNormalizer = (props: Readonly<AnyRecord & IntrinsicProps>) => Partial<AnyRecord & IntrinsicProps>;
324
183
 
325
184
  type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
326
- readonly diagnostics?: Diagnostics;
185
+ readonly diagnostics?: Diagnostics$1;
327
186
  readonly aria?: readonly AriaRule[];
328
187
  readonly children?: readonly ChildRuleInput[];
329
188
  readonly props?: readonly PropNormalizer[];
@@ -382,4 +241,6 @@ declare const selectedContract: EnforcementOptions;
382
241
 
383
242
  declare function mergeContracts(...contracts: readonly EnforcementOptions[]): EnforcementOptions;
384
243
 
385
- export { type AnyFactoryOptions, type PropNormalizer, activeContract, activeProps, disabledContract, disabledProps, expandedContract, expandedProps, invalidContract, invalidProps, loadingContract, loadingProps, mergeContracts, pressedContract, pressedProps, readonlyContract, readonlyProps, selectedContract, selectedProps };
244
+ type Diagnostics = Diagnostics$1;
245
+
246
+ export { type AnyFactoryOptions, type Diagnostics, type PropNormalizer, activeContract, activeProps, disabledContract, disabledProps, expandedContract, expandedProps, invalidContract, invalidProps, loadingContract, loadingProps, mergeContracts, pressedContract, pressedProps, readonlyContract, readonlyProps, selectedContract, selectedProps };
@@ -5,7 +5,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
8
+ try {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ } catch (e) {
11
+ throw mod = 0, e;
12
+ }
9
13
  };
10
14
  var __copyProps = (to, from, except, desc) => {
11
15
  if (from && typeof from === "object" || typeof from === "function") {
@@ -24,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
28
  mod
25
29
  ));
26
30
 
27
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
31
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
28
32
  var require_deepMerge = __commonJS({
29
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js"(exports) {
33
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js"(exports) {
30
34
  "use strict";
31
35
  Object.defineProperty(exports, "__esModule", { value: true });
32
36
  exports.isObjectNotArray = isObjectNotArray;
@@ -59,9 +63,9 @@ var require_deepMerge = __commonJS({
59
63
  }
60
64
  });
61
65
 
62
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
66
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
63
67
  var require_applyDefault = __commonJS({
64
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js"(exports) {
68
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js"(exports) {
65
69
  "use strict";
66
70
  Object.defineProperty(exports, "__esModule", { value: true });
67
71
  exports.applyDefault = applyDefault;
@@ -86,9 +90,9 @@ var require_applyDefault = __commonJS({
86
90
  }
87
91
  });
88
92
 
89
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
93
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
90
94
  var require_parserSeemsToBeTSESLint = __commonJS({
91
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js"(exports) {
95
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js"(exports) {
92
96
  "use strict";
93
97
  Object.defineProperty(exports, "__esModule", { value: true });
94
98
  exports.parserSeemsToBeTSESLint = parserSeemsToBeTSESLint;
@@ -98,9 +102,9 @@ var require_parserSeemsToBeTSESLint = __commonJS({
98
102
  }
99
103
  });
100
104
 
101
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
105
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
102
106
  var require_getParserServices = __commonJS({
103
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js"(exports) {
107
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js"(exports) {
104
108
  "use strict";
105
109
  Object.defineProperty(exports, "__esModule", { value: true });
106
110
  exports.getParserServices = getParserServices;
@@ -131,17 +135,17 @@ var require_getParserServices = __commonJS({
131
135
  }
132
136
  });
133
137
 
134
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
138
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
135
139
  var require_InferTypesFromRule = __commonJS({
136
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js"(exports) {
140
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js"(exports) {
137
141
  "use strict";
138
142
  Object.defineProperty(exports, "__esModule", { value: true });
139
143
  }
140
144
  });
141
145
 
142
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
146
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
143
147
  var require_nullThrows = __commonJS({
144
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js"(exports) {
148
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js"(exports) {
145
149
  "use strict";
146
150
  Object.defineProperty(exports, "__esModule", { value: true });
147
151
  exports.NullThrowsReasons = void 0;
@@ -159,9 +163,9 @@ var require_nullThrows = __commonJS({
159
163
  }
160
164
  });
161
165
 
162
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
166
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
163
167
  var require_RuleCreator = __commonJS({
164
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js"(exports) {
168
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js"(exports) {
165
169
  "use strict";
166
170
  Object.defineProperty(exports, "__esModule", { value: true });
167
171
  exports.RuleCreator = RuleCreator8;
@@ -207,9 +211,9 @@ var require_RuleCreator = __commonJS({
207
211
  }
208
212
  });
209
213
 
210
- // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
214
+ // ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
211
215
  var require_eslint_utils = __commonJS({
212
- "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js"(exports) {
216
+ "../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.6.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js"(exports) {
213
217
  "use strict";
214
218
  var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
215
219
  if (k2 === void 0) k2 = k;
@@ -1,4 +1,5 @@
1
- import { Except, RequireAtLeastOne, Simplify, ReadonlyDeep } from 'type-fest';
1
+ import { RequireAtLeastOne, Simplify, ReadonlyDeep } from 'type-fest';
2
+ import { Diagnostics, DiagnosticInput } from '../_shared/diagnostics.js';
2
3
  import { LitElement } from 'lit';
3
4
 
4
5
  type StringMap<T = unknown> = Record<string, T>;
@@ -23,148 +24,6 @@ type IntrinsicProps = AnyRecord & {
23
24
  };
24
25
  type TagMap = Partial<Record<IntrinsicTag | (string & {}), ClassName>>;
25
26
 
26
- declare enum DiagnosticCategory {
27
- Contract = 0,
28
- HTML = 1,
29
- ARIA = 2,
30
- Composition = 3,
31
- Rendering = 4,
32
- Accessibility = 5,
33
- Performance = 6,
34
- Internal = 7,
35
- Deprecation = 8,
36
- Lint = 9
37
- }
38
-
39
- declare enum DiagnosticCode {
40
- MissingRequiredChild = "COMP1001",
41
- InvalidParent = "COMP1002",
42
- InvalidChild = "COMP1003",
43
- UnexpectedChild = "COMP1004",
44
- AmbiguousChild = "COMP1005",
45
- CardinalityMin = "COMP1006",
46
- CardinalityMax = "COMP1007",
47
- PositionViolation = "COMP1008",
48
- AllowedAsViolation = "COMP1009",
49
- SlotExclusive = "SLOT1001",
50
- SlotSingleChild = "SLOT1002",
51
- SlotDiscardedChildren = "SLOT1003",
52
- SlotRenderFn = "SLOT1004",
53
- MissingAriaRelationship = "ARIA2001",
54
- AriaViolation = "ARIA2002",
55
- AriaAttributeInvalid = "ARIA2003",
56
- AriaMissingLiveRegion = "ARIA2004",
57
- AriaMissingAtomic = "ARIA2005",
58
- AriaRelevantInvalidToken = "ARIA2006",
59
- AriaRelevantSuperseded = "ARIA2007",
60
- AriaInvalidRole = "ARIA2008",
61
- AriaMissingAccessibleName = "ARIA2009",
62
- AriaAttributeOnPresentational = "ARIA2010",
63
- AriaHiddenOnFocusable = "ARIA2011",
64
- AriaRequiredProperty = "ARIA2012",
65
- AriaInvalidAttributeValue = "ARIA2013",
66
- AriaRedundantLevelAttribute = "ARIA2014",
67
- InvalidHeadingHierarchy = "HTML3001",
68
- HtmlEmptyRole = "HTML3002",
69
- HtmlImplicitRoleRedundant = "HTML3003",
70
- HtmlImplicitRoleOverride = "HTML3004",
71
- HtmlStandaloneRegionOverride = "HTML3005",
72
- HtmlLandmarkRoleOverride = "HTML3006",
73
- HtmlInvalidChild = "HTML3007",
74
- InvalidRenderingTarget = "RENDER4001",
75
- LintDeadCompoundKey = "LINT5001",
76
- LintDeadCompoundValue = "LINT5002",
77
- LintDeadCompoundNonLiteral = "LINT5003",
78
- LintMissingStrict = "LINT5004",
79
- LintInvalidDefaultKey = "LINT5005",
80
- LintInvalidDefaultValue = "LINT5006",
81
- LintInvalidDefaultNonLiteral = "LINT5007",
82
- LintNegativeMin = "LINT5008",
83
- LintNegativeMax = "LINT5009",
84
- LintMaxLessThanMin = "LINT5010",
85
- LintZeroMax = "LINT5011",
86
- LintMultipleFirst = "LINT5012",
87
- LintMultipleLast = "LINT5013",
88
- LintMinSumExceedsCapacity = "LINT5014",
89
- LintCardinalityViolation = "LINT5015",
90
- LintAriaTagOverride = "LINT5016",
91
- ContractUnknownVariantDim = "COMP1010",
92
- ContractUnknownVariantValue = "COMP1011",
93
- ContractUnknownRecipeKey = "COMP1012",
94
- ContractInvalidVariantValue = "COMP1013",
95
- TailwindMultipleDisplayProps = "CSS6001",
96
- TailwindReservedLayoutLiteral = "CSS6002",
97
- TailwindDeadVariantClass = "CSS6003",
98
- PluginInvalidShape = "PLUGIN7001",
99
- PluginPipelineReturnType = "PLUGIN7002",
100
- InternalError = "INTERNAL9000"
101
- }
102
-
103
- interface SourcePosition {
104
- line: number;
105
- col: number;
106
- }
107
- interface SourceLocation {
108
- file: string;
109
- start: SourcePosition;
110
- end?: SourcePosition;
111
- }
112
-
113
- declare enum Severity$1 {
114
- Debug = 0,
115
- Info = 1,
116
- Warning = 2,
117
- Error = 3,
118
- Fatal = 4
119
- }
120
-
121
- interface DiagnosticSuggestion {
122
- title: string;
123
- description?: string;
124
- fix?: string;
125
- }
126
-
127
- type Context = AnyRecord;
128
- type Metadata = AnyRecord;
129
- interface Diagnostic {
130
- code: DiagnosticCode;
131
- severity: Severity$1;
132
- category: DiagnosticCategory;
133
- message: string;
134
- rationale?: string;
135
- component?: string;
136
- contract?: string;
137
- location?: SourceLocation;
138
- suggestions?: DiagnosticSuggestion[];
139
- context?: Context;
140
- metadata?: Metadata;
141
- }
142
-
143
- declare enum Enforcement {
144
- Ignore = 0,
145
- Report = 1,
146
- Throw = 2
147
- }
148
- interface DiagnosticPolicy {
149
- resolve(diagnostic: Diagnostic): Enforcement;
150
- }
151
-
152
- interface DiagnosticReporter {
153
- report(diagnostic: Diagnostic): void;
154
- }
155
-
156
- type DiagnosticInput = Except<Diagnostic, 'severity'>;
157
- declare class Diagnostics {
158
- private readonly reporter;
159
- private readonly policy;
160
- readonly active: boolean;
161
- constructor(reporter: DiagnosticReporter, policy?: DiagnosticPolicy);
162
- report(diagnostic: Diagnostic): Diagnostic;
163
- warn(input: DiagnosticInput): Diagnostic;
164
- error(input: DiagnosticInput): Diagnostic;
165
- info(input: DiagnosticInput): Diagnostic;
166
- }
167
-
168
27
  type MinMax = {
169
28
  min: number;
170
29
  max: number;