@eslint-react/shared 1.23.1 → 1.23.2-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,61 +1,1346 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  import { E } from '@eslint-react/eff';
3
- import * as valibot from 'valibot';
4
- import { InferOutput } from 'valibot';
5
- import * as micro_memoize from 'micro-memoize';
6
3
 
7
4
  /**
8
- * The NPM scope for this project.
5
+ * Schema with pipe type.
6
+ */
7
+ type SchemaWithPipe<TPipe extends [
8
+ BaseSchema<unknown, unknown, BaseIssue<unknown>>,
9
+ ...PipeItem<any, unknown, BaseIssue<unknown>>[]
10
+ ]> = Omit<FirstTupleItem<TPipe>, '~standard' | '~run' | '~types'> & {
11
+ /**
12
+ * The pipe items.
13
+ */
14
+ readonly pipe: TPipe;
15
+ /**
16
+ * The Standard Schema properties.
17
+ *
18
+ * @internal
19
+ */
20
+ readonly '~standard': StandardSchemaProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
21
+ /**
22
+ * Parses unknown input values.
23
+ *
24
+ * @param dataset The input dataset.
25
+ * @param config The configuration.
26
+ *
27
+ * @returns The output dataset.
28
+ *
29
+ * @internal
30
+ */
31
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<InferOutput<LastTupleItem<TPipe>>, InferIssue<TPipe[number]>>;
32
+ /**
33
+ * The input, output and issue type.
34
+ *
35
+ * @internal
36
+ */
37
+ readonly '~types'?: {
38
+ readonly input: InferInput<FirstTupleItem<TPipe>>;
39
+ readonly output: InferOutput<LastTupleItem<TPipe>>;
40
+ readonly issue: InferIssue<TPipe[number]>;
41
+ } | undefined;
42
+ };
43
+
44
+ /**
45
+ * Schema with pipe async type.
46
+ */
47
+ type SchemaWithPipeAsync<TPipe extends [
48
+ (BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>),
49
+ ...(PipeItem<any, unknown, BaseIssue<unknown>> | PipeItemAsync<any, unknown, BaseIssue<unknown>>)[]
50
+ ]> = Omit<FirstTupleItem<TPipe>, 'async' | '~standard' | '~run' | '~types'> & {
51
+ /**
52
+ * The pipe items.
53
+ */
54
+ readonly pipe: TPipe;
55
+ /**
56
+ * Whether it's async.
57
+ */
58
+ readonly async: true;
59
+ /**
60
+ * The Standard Schema properties.
61
+ *
62
+ * @internal
63
+ */
64
+ readonly '~standard': StandardSchemaProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
65
+ /**
66
+ * Parses unknown input values.
67
+ *
68
+ * @param dataset The input dataset.
69
+ * @param config The configuration.
70
+ *
71
+ * @returns The output dataset.
72
+ *
73
+ * @internal
74
+ */
75
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<InferOutput<LastTupleItem<TPipe>>, InferIssue<TPipe[number]>>>;
76
+ /**
77
+ * The input, output and issue type.
78
+ *
79
+ * @internal
80
+ */
81
+ readonly '~types'?: {
82
+ readonly input: InferInput<FirstTupleItem<TPipe>>;
83
+ readonly output: InferOutput<LastTupleItem<TPipe>>;
84
+ readonly issue: InferIssue<TPipe[number]>;
85
+ } | undefined;
86
+ };
87
+
88
+ /**
89
+ * Base metadata type.
90
+ */
91
+ interface BaseMetadata<TInput> {
92
+ /**
93
+ * The object kind.
94
+ */
95
+ readonly kind: 'metadata';
96
+ /**
97
+ * The metadata type.
98
+ */
99
+ readonly type: string;
100
+ /**
101
+ * The metadata reference.
102
+ */
103
+ readonly reference: (...args: any[]) => BaseMetadata<any>;
104
+ /**
105
+ * The input, output and issue type.
106
+ *
107
+ * @internal
108
+ */
109
+ readonly '~types'?: {
110
+ readonly input: TInput;
111
+ readonly output: TInput;
112
+ readonly issue: never;
113
+ } | undefined;
114
+ }
115
+
116
+ /**
117
+ * Unknown dataset type.
118
+ */
119
+ interface UnknownDataset {
120
+ /**
121
+ * Whether is's typed.
122
+ */
123
+ typed?: false;
124
+ /**
125
+ * The dataset value.
126
+ */
127
+ value: unknown;
128
+ /**
129
+ * The dataset issues.
130
+ */
131
+ issues?: undefined;
132
+ }
133
+ /**
134
+ * Success dataset type.
135
+ */
136
+ interface SuccessDataset<TValue> {
137
+ /**
138
+ * Whether is's typed.
139
+ */
140
+ typed: true;
141
+ /**
142
+ * The dataset value.
143
+ */
144
+ value: TValue;
145
+ /**
146
+ * The dataset issues.
147
+ */
148
+ issues?: undefined;
149
+ }
150
+ /**
151
+ * Partial dataset type.
152
+ */
153
+ interface PartialDataset<TValue, TIssue extends BaseIssue<unknown>> {
154
+ /**
155
+ * Whether is's typed.
156
+ */
157
+ typed: true;
158
+ /**
159
+ * The dataset value.
160
+ */
161
+ value: TValue;
162
+ /**
163
+ * The dataset issues.
164
+ */
165
+ issues: [TIssue, ...TIssue[]];
166
+ }
167
+ /**
168
+ * Failure dataset type.
169
+ */
170
+ interface FailureDataset<TIssue extends BaseIssue<unknown>> {
171
+ /**
172
+ * Whether is's typed.
173
+ */
174
+ typed: false;
175
+ /**
176
+ * The dataset value.
177
+ */
178
+ value: unknown;
179
+ /**
180
+ * The dataset issues.
181
+ */
182
+ issues: [TIssue, ...TIssue[]];
183
+ }
184
+ /**
185
+ * Output dataset type.
186
+ */
187
+ type OutputDataset<TValue, TIssue extends BaseIssue<unknown>> = SuccessDataset<TValue> | PartialDataset<TValue, TIssue> | FailureDataset<TIssue>;
188
+
189
+ /**
190
+ * The Standard Schema properties interface.
191
+ */
192
+ interface StandardSchemaProps<Input, Output> {
193
+ /**
194
+ * The version number of the standard.
195
+ */
196
+ readonly version: 1;
197
+ /**
198
+ * The vendor name of the schema library.
199
+ */
200
+ readonly vendor: 'valibot';
201
+ /**
202
+ * Validates unknown input values.
203
+ */
204
+ readonly validate: (value: unknown) => StandardResult<Output> | Promise<StandardResult<Output>>;
205
+ /**
206
+ * Inferred types associated with the schema.
207
+ */
208
+ readonly types?: StandardTypes<Input, Output> | undefined;
209
+ }
210
+ /**
211
+ * The result interface of the validate function.
212
+ */
213
+ type StandardResult<Output> = StandardSuccessResult<Output> | StandardFailureResult;
214
+ /**
215
+ * The result interface if validation succeeds.
216
+ */
217
+ interface StandardSuccessResult<Output> {
218
+ /**
219
+ * The typed output value.
220
+ */
221
+ readonly value: Output;
222
+ /**
223
+ * The non-existent issues.
224
+ */
225
+ readonly issues?: undefined;
226
+ }
227
+ /**
228
+ * The result interface if validation fails.
229
+ */
230
+ interface StandardFailureResult {
231
+ /**
232
+ * The issues of failed validation.
233
+ */
234
+ readonly issues: readonly StandardIssue[];
235
+ }
236
+ /**
237
+ * The issue interface of the failure output.
238
+ */
239
+ interface StandardIssue {
240
+ /**
241
+ * The error message of the issue.
242
+ */
243
+ readonly message: string;
244
+ /**
245
+ * The path of the issue, if any.
246
+ */
247
+ readonly path?: readonly (PropertyKey | StandardPathSegment)[] | undefined;
248
+ }
249
+ /**
250
+ * The path segment interface of the issue.
251
+ */
252
+ interface StandardPathSegment {
253
+ /**
254
+ * The key representing a path segment.
255
+ */
256
+ readonly key: PropertyKey;
257
+ }
258
+ /**
259
+ * The base types interface of Standard Schema.
260
+ */
261
+ interface StandardTypes<Input, Output> {
262
+ /**
263
+ * The input type of the schema.
264
+ */
265
+ readonly input: Input;
266
+ /**
267
+ * The output type of the schema.
268
+ */
269
+ readonly output: Output;
270
+ }
271
+
272
+ /**
273
+ * Base schema type.
274
+ */
275
+ interface BaseSchema<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
276
+ /**
277
+ * The object kind.
278
+ */
279
+ readonly kind: 'schema';
280
+ /**
281
+ * The schema type.
282
+ */
283
+ readonly type: string;
284
+ /**
285
+ * The schema reference.
286
+ */
287
+ readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>>;
288
+ /**
289
+ * The expected property.
290
+ */
291
+ readonly expects: string;
292
+ /**
293
+ * Whether it's async.
294
+ */
295
+ readonly async: false;
296
+ /**
297
+ * The Standard Schema properties.
298
+ *
299
+ * @internal
300
+ */
301
+ readonly '~standard': StandardSchemaProps<TInput, TOutput>;
302
+ /**
303
+ * Parses unknown input values.
304
+ *
305
+ * @param dataset The input dataset.
306
+ * @param config The configuration.
307
+ *
308
+ * @returns The output dataset.
309
+ *
310
+ * @internal
311
+ */
312
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, TIssue>;
313
+ /**
314
+ * The input, output and issue type.
315
+ *
316
+ * @internal
317
+ */
318
+ readonly '~types'?: {
319
+ readonly input: TInput;
320
+ readonly output: TOutput;
321
+ readonly issue: TIssue;
322
+ } | undefined;
323
+ }
324
+ /**
325
+ * Base schema async type.
326
+ */
327
+ interface BaseSchemaAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseSchema<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
328
+ /**
329
+ * The schema reference.
330
+ */
331
+ readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
332
+ /**
333
+ * Whether it's async.
334
+ */
335
+ readonly async: true;
336
+ /**
337
+ * Parses unknown input values.
338
+ *
339
+ * @param dataset The input dataset.
340
+ * @param config The configuration.
341
+ *
342
+ * @returns The output dataset.
343
+ *
344
+ * @internal
345
+ */
346
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, TIssue>>;
347
+ }
348
+
349
+ /**
350
+ * Base transformation type.
351
+ */
352
+ interface BaseTransformation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
353
+ /**
354
+ * The object kind.
355
+ */
356
+ readonly kind: 'transformation';
357
+ /**
358
+ * The transformation type.
359
+ */
360
+ readonly type: string;
361
+ /**
362
+ * The transformation reference.
363
+ */
364
+ readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>>;
365
+ /**
366
+ * Whether it's async.
367
+ */
368
+ readonly async: false;
369
+ /**
370
+ * Transforms known input values.
371
+ *
372
+ * @param dataset The input dataset.
373
+ * @param config The configuration.
374
+ *
375
+ * @returns The output dataset.
376
+ *
377
+ * @internal
378
+ */
379
+ readonly '~run': (dataset: SuccessDataset<TInput>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, BaseIssue<unknown> | TIssue>;
380
+ /**
381
+ * The input, output and issue type.
382
+ *
383
+ * @internal
384
+ */
385
+ readonly '~types'?: {
386
+ readonly input: TInput;
387
+ readonly output: TOutput;
388
+ readonly issue: TIssue;
389
+ } | undefined;
390
+ }
391
+ /**
392
+ * Base transformation async type.
393
+ */
394
+ interface BaseTransformationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseTransformation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
395
+ /**
396
+ * The transformation reference.
397
+ */
398
+ readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>> | BaseTransformationAsync<any, any, BaseIssue<unknown>>;
399
+ /**
400
+ * Whether it's async.
401
+ */
402
+ readonly async: true;
403
+ /**
404
+ * Transforms known input values.
405
+ *
406
+ * @param dataset The input dataset.
407
+ * @param config The configuration.
408
+ *
409
+ * @returns The output dataset.
410
+ *
411
+ * @internal
412
+ */
413
+ readonly '~run': (dataset: SuccessDataset<TInput>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, BaseIssue<unknown> | TIssue>>;
414
+ }
415
+
416
+ /**
417
+ * Base validation type.
418
+ */
419
+ interface BaseValidation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
420
+ /**
421
+ * The object kind.
422
+ */
423
+ readonly kind: 'validation';
424
+ /**
425
+ * The validation type.
426
+ */
427
+ readonly type: string;
428
+ /**
429
+ * The validation reference.
430
+ */
431
+ readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>>;
432
+ /**
433
+ * The expected property.
434
+ */
435
+ readonly expects: string | null;
436
+ /**
437
+ * Whether it's async.
438
+ */
439
+ readonly async: false;
440
+ /**
441
+ * Validates known input values.
442
+ *
443
+ * @param dataset The input dataset.
444
+ * @param config The configuration.
445
+ *
446
+ * @returns The output dataset.
447
+ *
448
+ * @internal
449
+ */
450
+ readonly '~run': (dataset: OutputDataset<TInput, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, BaseIssue<unknown> | TIssue>;
451
+ /**
452
+ * The input, output and issue type.
453
+ *
454
+ * @internal
455
+ */
456
+ readonly '~types'?: {
457
+ readonly input: TInput;
458
+ readonly output: TOutput;
459
+ readonly issue: TIssue;
460
+ } | undefined;
461
+ }
462
+ /**
463
+ * Base validation async type.
464
+ */
465
+ interface BaseValidationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseValidation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
466
+ /**
467
+ * The validation reference.
468
+ */
469
+ readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>> | BaseValidationAsync<any, any, BaseIssue<unknown>>;
470
+ /**
471
+ * Whether it's async.
472
+ */
473
+ readonly async: true;
474
+ /**
475
+ * Validates known input values.
476
+ *
477
+ * @param dataset The input dataset.
478
+ * @param config The configuration.
479
+ *
480
+ * @returns The output dataset.
481
+ *
482
+ * @internal
483
+ */
484
+ readonly '~run': (dataset: OutputDataset<TInput, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, BaseIssue<unknown> | TIssue>>;
485
+ }
486
+
487
+ /**
488
+ * Infer input type.
489
+ */
490
+ type InferInput<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['input'];
491
+ /**
492
+ * Infer output type.
493
+ */
494
+ type InferOutput<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['output'];
495
+ /**
496
+ * Infer issue type.
497
+ */
498
+ type InferIssue<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['issue'];
499
+ /**
500
+ * Constructs a type that is maybe readonly.
501
+ */
502
+ type MaybeReadonly<TValue> = TValue | Readonly<TValue>;
503
+ /**
504
+ * Constructs a type that is maybe a promise.
505
+ */
506
+ type MaybePromise<TValue> = TValue | Promise<TValue>;
507
+ /**
508
+ * Prettifies a type for better readability.
509
+ *
510
+ * Hint: This type has no effect and is only used so that TypeScript displays
511
+ * the final type in the preview instead of the utility types used.
512
+ */
513
+ type Prettify<TObject> = {
514
+ [TKey in keyof TObject]: TObject[TKey];
515
+ } & {};
516
+ /**
517
+ * Marks specific keys as optional.
518
+ */
519
+ type MarkOptional<TObject, TKeys extends keyof TObject> = Omit<TObject, TKeys> & Partial<Pick<TObject, TKeys>>;
520
+ /**
521
+ * Extracts first tuple item.
522
+ */
523
+ type FirstTupleItem<TTuple extends [unknown, ...unknown[]]> = TTuple[0];
524
+ /**
525
+ * Extracts last tuple item.
526
+ */
527
+ type LastTupleItem<TTuple extends [unknown, ...unknown[]]> = TTuple[TTuple extends [unknown, ...infer TRest] ? TRest['length'] : never];
528
+
529
+ /**
530
+ * Error message type.
531
+ */
532
+ type ErrorMessage<TIssue extends BaseIssue<unknown>> = ((issue: TIssue) => string) | string;
533
+ /**
534
+ * Default type.
535
+ */
536
+ type Default<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TInput extends null | undefined> = MaybeReadonly<InferInput<TWrapped> | TInput> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybeReadonly<InferInput<TWrapped> | TInput>) | undefined;
537
+ /**
538
+ * Default async type.
539
+ */
540
+ type DefaultAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TInput extends null | undefined> = MaybeReadonly<InferInput<TWrapped> | TInput> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<MaybeReadonly<InferInput<TWrapped> | TInput>>) | undefined;
541
+ /**
542
+ * Default value type.
543
+ */
544
+ type DefaultValue<TDefault extends Default<BaseSchema<unknown, unknown, BaseIssue<unknown>>, null | undefined> | DefaultAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, null | undefined>> = TDefault extends DefaultAsync<infer TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TInput> ? TDefault extends (dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<InferInput<TWrapped> | TInput> ? Awaited<ReturnType<TDefault>> : TDefault : never;
545
+
546
+ /**
547
+ * Pipe action type.
548
+ */
549
+ type PipeAction<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseValidation<TInput, TOutput, TIssue> | BaseTransformation<TInput, TOutput, TIssue> | BaseMetadata<TInput>;
550
+ /**
551
+ * Pipe action async type.
552
+ */
553
+ type PipeActionAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseValidationAsync<TInput, TOutput, TIssue> | BaseTransformationAsync<TInput, TOutput, TIssue>;
554
+ /**
555
+ * Pipe item type.
556
+ */
557
+ type PipeItem<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseSchema<TInput, TOutput, TIssue> | PipeAction<TInput, TOutput, TIssue>;
558
+ /**
559
+ * Pipe item async type.
560
+ */
561
+ type PipeItemAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseSchemaAsync<TInput, TOutput, TIssue> | PipeActionAsync<TInput, TOutput, TIssue>;
562
+ /**
563
+ * Schema without pipe type.
564
+ */
565
+ type SchemaWithoutPipe<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema & {
566
+ pipe?: never;
567
+ };
568
+
569
+ /**
570
+ * Object entries type.
571
+ */
572
+ interface ObjectEntries {
573
+ [key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>>;
574
+ }
575
+ /**
576
+ * Object entries async type.
577
+ */
578
+ interface ObjectEntriesAsync {
579
+ [key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
580
+ }
581
+ /**
582
+ * Question mark schema type.
583
+ */
584
+ type QuestionMarkSchema = NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>;
585
+ /**
586
+ * Has default type.
587
+ */
588
+ type HasDefault<TSchema extends QuestionMarkSchema> = undefined extends TSchema['default'] ? false : true;
589
+ /**
590
+ * Exact optional input type.
591
+ */
592
+ type ExactOptionalInput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends OptionalSchema<infer TWrapped, unknown> | OptionalSchemaAsync<infer TWrapped, unknown> ? ExactOptionalInput<TWrapped> : InferInput<TSchema>;
593
+ /**
594
+ * Exact optional output type.
595
+ */
596
+ type ExactOptionalOutput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends SchemaWithoutPipe<OptionalSchema<infer TWrapped, unknown>> | SchemaWithoutPipe<OptionalSchemaAsync<infer TWrapped, unknown>> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> : InferOutput<TSchema>;
597
+ /**
598
+ * Infer entries input type.
599
+ */
600
+ type InferEntriesInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
601
+ -readonly [TKey in keyof TEntries]: ExactOptionalInput<TEntries[TKey]>;
602
+ };
603
+ /**
604
+ * Infer entries output type.
605
+ */
606
+ type InferEntriesOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
607
+ -readonly [TKey in keyof TEntries]: ExactOptionalOutput<TEntries[TKey]>;
608
+ };
609
+ /**
610
+ * Optional input keys type.
611
+ */
612
+ type OptionalInputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
613
+ [TKey in keyof TEntries]: TEntries[TKey] extends QuestionMarkSchema ? TKey : never;
614
+ }[keyof TEntries];
615
+ /**
616
+ * Optional output keys type.
617
+ */
618
+ type OptionalOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
619
+ [TKey in keyof TEntries]: TEntries[TKey] extends QuestionMarkSchema ? undefined extends InferOutput<TEntries[TKey]> ? HasDefault<TEntries[TKey]> extends false ? TKey : never : never : never;
620
+ }[keyof TEntries];
621
+ /**
622
+ * Input with question marks type.
623
+ */
624
+ type InputWithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesInput<TEntries>> = MarkOptional<TObject, OptionalInputKeys<TEntries>>;
625
+ /**
626
+ * Output with question marks type.
627
+ */
628
+ type OutputWithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesOutput<TEntries>> = MarkOptional<TObject, OptionalOutputKeys<TEntries>>;
629
+ /**
630
+ * Readonly output keys type.
631
+ */
632
+ type ReadonlyOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
633
+ [TKey in keyof TEntries]: TEntries[TKey] extends SchemaWithPipe<infer TPipe> | SchemaWithPipeAsync<infer TPipe> ? ReadonlyAction<any> extends TPipe[number] ? TKey : never : never;
634
+ }[keyof TEntries];
635
+ /**
636
+ * Output with readonly type.
637
+ */
638
+ type OutputWithReadonly<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends OutputWithQuestionMarks<TEntries, InferEntriesOutput<TEntries>>> = Readonly<TObject> & Pick<TObject, Exclude<keyof TObject, ReadonlyOutputKeys<TEntries>>>;
639
+ /**
640
+ * Infer object input type.
641
+ */
642
+ type InferObjectInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Prettify<InputWithQuestionMarks<TEntries, InferEntriesInput<TEntries>>>;
643
+ /**
644
+ * Infer object output type.
645
+ */
646
+ type InferObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Prettify<OutputWithReadonly<TEntries, OutputWithQuestionMarks<TEntries, InferEntriesOutput<TEntries>>>>;
647
+ /**
648
+ * Infer object issue type.
649
+ */
650
+ type InferObjectIssue<TEntries extends ObjectEntries | ObjectEntriesAsync> = InferIssue<TEntries[keyof TEntries]>;
651
+
652
+ /**
653
+ * Array path item type.
654
+ */
655
+ interface ArrayPathItem {
656
+ /**
657
+ * The path item type.
658
+ */
659
+ readonly type: 'array';
660
+ /**
661
+ * The path item origin.
662
+ */
663
+ readonly origin: 'value';
664
+ /**
665
+ * The path item input.
666
+ */
667
+ readonly input: MaybeReadonly<unknown[]>;
668
+ /**
669
+ * The path item key.
670
+ */
671
+ readonly key: number;
672
+ /**
673
+ * The path item value.
674
+ */
675
+ readonly value: unknown;
676
+ }
677
+ /**
678
+ * Map path item type.
679
+ */
680
+ interface MapPathItem {
681
+ /**
682
+ * The path item type.
683
+ */
684
+ readonly type: 'map';
685
+ /**
686
+ * The path item origin.
687
+ */
688
+ readonly origin: 'key' | 'value';
689
+ /**
690
+ * The path item input.
691
+ */
692
+ readonly input: Map<unknown, unknown>;
693
+ /**
694
+ * The path item key.
695
+ */
696
+ readonly key: unknown;
697
+ /**
698
+ * The path item value.
699
+ */
700
+ readonly value: unknown;
701
+ }
702
+ /**
703
+ * Object path item type.
704
+ */
705
+ interface ObjectPathItem {
706
+ /**
707
+ * The path item type.
708
+ */
709
+ readonly type: 'object';
710
+ /**
711
+ * The path item origin.
712
+ */
713
+ readonly origin: 'key' | 'value';
714
+ /**
715
+ * The path item input.
716
+ */
717
+ readonly input: Record<string, unknown>;
718
+ /**
719
+ * The path item key.
720
+ */
721
+ readonly key: string;
722
+ /**
723
+ * The path item value.
724
+ */
725
+ readonly value: unknown;
726
+ }
727
+ /**
728
+ * Set path item type.
729
+ */
730
+ interface SetPathItem {
731
+ /**
732
+ * The path item type.
733
+ */
734
+ readonly type: 'set';
735
+ /**
736
+ * The path item origin.
737
+ */
738
+ readonly origin: 'value';
739
+ /**
740
+ * The path item input.
741
+ */
742
+ readonly input: Set<unknown>;
743
+ /**
744
+ * The path item key.
745
+ */
746
+ readonly key: null;
747
+ /**
748
+ * The path item key.
749
+ */
750
+ readonly value: unknown;
751
+ }
752
+ /**
753
+ * Unknown path item type.
754
+ */
755
+ interface UnknownPathItem {
756
+ /**
757
+ * The path item type.
758
+ */
759
+ readonly type: 'unknown';
760
+ /**
761
+ * The path item origin.
762
+ */
763
+ readonly origin: 'key' | 'value';
764
+ /**
765
+ * The path item input.
766
+ */
767
+ readonly input: unknown;
768
+ /**
769
+ * The path item key.
770
+ */
771
+ readonly key: unknown;
772
+ /**
773
+ * The path item value.
774
+ */
775
+ readonly value: unknown;
776
+ }
777
+ /**
778
+ * Issue path item type.
779
+ */
780
+ type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem;
781
+ /**
782
+ * Base issue type.
783
+ */
784
+ interface BaseIssue<TInput> extends Config<BaseIssue<TInput>> {
785
+ /**
786
+ * The issue kind.
787
+ */
788
+ readonly kind: 'schema' | 'validation' | 'transformation';
789
+ /**
790
+ * The issue type.
791
+ */
792
+ readonly type: string;
793
+ /**
794
+ * The raw input data.
795
+ */
796
+ readonly input: TInput;
797
+ /**
798
+ * The expected property.
799
+ */
800
+ readonly expected: string | null;
801
+ /**
802
+ * The received property.
803
+ */
804
+ readonly received: string;
805
+ /**
806
+ * The error message.
807
+ */
808
+ readonly message: string;
809
+ /**
810
+ * The input requirement.
811
+ */
812
+ readonly requirement?: unknown | undefined;
813
+ /**
814
+ * The issue path.
815
+ */
816
+ readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined;
817
+ /**
818
+ * The sub issues.
819
+ */
820
+ readonly issues?: [BaseIssue<TInput>, ...BaseIssue<TInput>[]] | undefined;
821
+ }
822
+
823
+ /**
824
+ * Config type.
825
+ */
826
+ interface Config<TIssue extends BaseIssue<unknown>> {
827
+ /**
828
+ * The selected language.
829
+ */
830
+ readonly lang?: string | undefined;
831
+ /**
832
+ * The error message.
833
+ */
834
+ readonly message?: ErrorMessage<TIssue> | undefined;
835
+ /**
836
+ * Whether it was abort early.
837
+ */
838
+ readonly abortEarly?: boolean | undefined;
839
+ /**
840
+ * Whether the pipe was abort early.
841
+ */
842
+ readonly abortPipeEarly?: boolean | undefined;
843
+ }
844
+
845
+ /**
846
+ * Array issue type.
847
+ */
848
+ interface ArrayIssue extends BaseIssue<unknown> {
849
+ /**
850
+ * The issue kind.
851
+ */
852
+ readonly kind: 'schema';
853
+ /**
854
+ * The issue type.
855
+ */
856
+ readonly type: 'array';
857
+ /**
858
+ * The expected property.
859
+ */
860
+ readonly expected: 'Array';
861
+ }
862
+
863
+ /**
864
+ * Array schema type.
865
+ */
866
+ interface ArraySchema<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<ArrayIssue> | undefined> extends BaseSchema<InferInput<TItem>[], InferOutput<TItem>[], ArrayIssue | InferIssue<TItem>> {
867
+ /**
868
+ * The schema type.
869
+ */
870
+ readonly type: 'array';
871
+ /**
872
+ * The schema reference.
873
+ */
874
+ readonly reference: typeof array;
875
+ /**
876
+ * The expected property.
877
+ */
878
+ readonly expects: 'Array';
879
+ /**
880
+ * The array item schema.
881
+ */
882
+ readonly item: TItem;
883
+ /**
884
+ * The error message.
885
+ */
886
+ readonly message: TMessage;
887
+ }
888
+ /**
889
+ * Creates an array schema.
890
+ *
891
+ * @param item The item schema.
892
+ *
893
+ * @returns An array schema.
894
+ */
895
+ declare function array<const TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(item: TItem): ArraySchema<TItem, undefined>;
896
+ /**
897
+ * Creates an array schema.
898
+ *
899
+ * @param item The item schema.
900
+ * @param message The error message.
901
+ *
902
+ * @returns An array schema.
903
+ */
904
+ declare function array<const TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<ArrayIssue> | undefined>(item: TItem, message: TMessage): ArraySchema<TItem, TMessage>;
905
+
906
+ /**
907
+ * Boolean issue type.
908
+ */
909
+ interface BooleanIssue extends BaseIssue<unknown> {
910
+ /**
911
+ * The issue kind.
912
+ */
913
+ readonly kind: 'schema';
914
+ /**
915
+ * The issue type.
916
+ */
917
+ readonly type: 'boolean';
918
+ /**
919
+ * The expected property.
920
+ */
921
+ readonly expected: 'boolean';
922
+ }
923
+ /**
924
+ * Boolean schema type.
925
+ */
926
+ interface BooleanSchema<TMessage extends ErrorMessage<BooleanIssue> | undefined> extends BaseSchema<boolean, boolean, BooleanIssue> {
927
+ /**
928
+ * The schema type.
929
+ */
930
+ readonly type: 'boolean';
931
+ /**
932
+ * The schema reference.
933
+ */
934
+ readonly reference: typeof boolean;
935
+ /**
936
+ * The expected property.
937
+ */
938
+ readonly expects: 'boolean';
939
+ /**
940
+ * The error message.
941
+ */
942
+ readonly message: TMessage;
943
+ }
944
+ /**
945
+ * Creates a boolean schema.
946
+ *
947
+ * @returns A boolean schema.
9
948
  */
10
- declare const NPM_SCOPE = "@eslint-react";
949
+ declare function boolean(): BooleanSchema<undefined>;
11
950
  /**
12
- * The GitHub repository for this project.
951
+ * Creates a boolean schema.
952
+ *
953
+ * @param message The error message.
954
+ *
955
+ * @returns A boolean schema.
13
956
  */
14
- declare const GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
957
+ declare function boolean<const TMessage extends ErrorMessage<BooleanIssue> | undefined>(message: TMessage): BooleanSchema<TMessage>;
958
+
15
959
  /**
16
- * The URL to the project's website.
960
+ * Class type.
17
961
  */
18
- declare const WEBSITE_URL = "https://eslint-react.xyz";
962
+ type Class = new (...args: any[]) => any;
19
963
  /**
20
- * Regular expression for matching a PascalCase string.
964
+ * Instance issue type.
21
965
  */
22
- declare const RE_PASCAL_CASE: RegExp;
966
+ interface InstanceIssue extends BaseIssue<unknown> {
967
+ /**
968
+ * The issue kind.
969
+ */
970
+ readonly kind: 'schema';
971
+ /**
972
+ * The issue type.
973
+ */
974
+ readonly type: 'instance';
975
+ /**
976
+ * The expected property.
977
+ */
978
+ readonly expected: string;
979
+ }
23
980
  /**
24
- * Regular expression for matching a camelCase string.
981
+ * Instance schema type.
25
982
  */
26
- declare const RE_CAMEL_CASE: RegExp;
983
+ interface InstanceSchema<TClass extends Class, TMessage extends ErrorMessage<InstanceIssue> | undefined> extends BaseSchema<InstanceType<TClass>, InstanceType<TClass>, InstanceIssue> {
984
+ /**
985
+ * The schema type.
986
+ */
987
+ readonly type: 'instance';
988
+ /**
989
+ * The schema reference.
990
+ */
991
+ readonly reference: typeof instance;
992
+ /**
993
+ * The class of the instance.
994
+ */
995
+ readonly class: TClass;
996
+ /**
997
+ * The error message.
998
+ */
999
+ readonly message: TMessage;
1000
+ }
27
1001
  /**
28
- * Regular expression for matching a kebab-case string.
1002
+ * Creates an instance schema.
1003
+ *
1004
+ * @param class_ The class of the instance.
1005
+ *
1006
+ * @returns An instance schema.
29
1007
  */
30
- declare const RE_KEBAB_CASE: RegExp;
1008
+ declare function instance<TClass extends Class>(class_: TClass): InstanceSchema<TClass, undefined>;
31
1009
  /**
32
- * Regular expression for matching a snake_case string.
1010
+ * Creates an instance schema.
1011
+ *
1012
+ * @param class_ The class of the instance.
1013
+ * @param message The error message.
1014
+ *
1015
+ * @returns An instance schema.
33
1016
  */
34
- declare const RE_SNAKE_CASE: RegExp;
1017
+ declare function instance<TClass extends Class, const TMessage extends ErrorMessage<InstanceIssue> | undefined>(class_: TClass, message: TMessage): InstanceSchema<TClass, TMessage>;
1018
+
35
1019
  /**
36
- * Regular expression for matching a CONSTANT_CASE string.
1020
+ * Infer nullish output type.
37
1021
  */
38
- declare const RE_CONSTANT_CASE: RegExp;
39
- declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
1022
+ type InferNullishOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | null | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, null | undefined>;
1023
+
40
1024
  /**
41
- * @internal
1025
+ * Nullish schema type.
42
1026
  */
43
- declare const HOST_HTML_COMPONENT_TYPES: readonly ["aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "menu", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
1027
+ interface NullishSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, null | undefined>> extends BaseSchema<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1028
+ /**
1029
+ * The schema type.
1030
+ */
1031
+ readonly type: 'nullish';
1032
+ /**
1033
+ * The schema reference.
1034
+ */
1035
+ readonly reference: typeof nullish;
1036
+ /**
1037
+ * The expected property.
1038
+ */
1039
+ readonly expects: `(${TWrapped['expects']} | null | undefined)`;
1040
+ /**
1041
+ * The wrapped schema.
1042
+ */
1043
+ readonly wrapped: TWrapped;
1044
+ /**
1045
+ * The default value.
1046
+ */
1047
+ readonly default: TDefault;
1048
+ }
44
1049
  /**
45
- * @internal
1050
+ * Creates a nullish schema.
1051
+ *
1052
+ * @param wrapped The wrapped schema.
1053
+ *
1054
+ * @returns A nullish schema.
46
1055
  */
47
- declare const HOST_SVG_COMPONENT_TYPES: readonly ["a", "animate", "animateMotion", "animateTransform", "circle", "clipPath", "defs", "desc", "discard", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "hatch", "hatchpath", "image", "line", "linearGradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "script", "set", "stop", "style", "svg", "switch", "symbol", "text", "textPath", "title", "tspan", "use", "view"];
48
- declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
1056
+ declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullishSchema<TWrapped, undefined>;
1057
+ /**
1058
+ * Creates a nullish schema.
1059
+ *
1060
+ * @param wrapped The wrapped schema.
1061
+ * @param default_ The default value.
1062
+ *
1063
+ * @returns A nullish schema.
1064
+ */
1065
+ declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchema<TWrapped, TDefault>;
49
1066
 
50
1067
  /**
51
- * Get the ESLint rule creator for a plugin.
52
- * @internal
53
- * @param pluginName The name of the plugin.
54
- * @returns The ESLint rule creator.
1068
+ * Nullish schema async type.
55
1069
  */
56
- declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
1070
+ interface NullishSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1071
+ /**
1072
+ * The schema type.
1073
+ */
1074
+ readonly type: 'nullish';
1075
+ /**
1076
+ * The schema reference.
1077
+ */
1078
+ readonly reference: typeof nullishAsync;
1079
+ /**
1080
+ * The expected property.
1081
+ */
1082
+ readonly expects: `(${TWrapped['expects']} | null | undefined)`;
1083
+ /**
1084
+ * The wrapped schema.
1085
+ */
1086
+ readonly wrapped: TWrapped;
1087
+ /**
1088
+ * The default value.
1089
+ */
1090
+ readonly default: TDefault;
1091
+ }
1092
+ /**
1093
+ * Creates a nullish schema.
1094
+ *
1095
+ * @param wrapped The wrapped schema.
1096
+ *
1097
+ * @returns A nullish schema.
1098
+ */
1099
+ declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullishSchemaAsync<TWrapped, undefined>;
1100
+ /**
1101
+ * Creates a nullish schema.
1102
+ *
1103
+ * @param wrapped The wrapped schema.
1104
+ * @param default_ The default value.
1105
+ *
1106
+ * @returns A nullish schema.
1107
+ */
1108
+ declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchemaAsync<TWrapped, TDefault>;
57
1109
 
58
- declare function getReactVersion(at?: string): E.Either<string, unknown>;
1110
+ /**
1111
+ * Object issue type.
1112
+ */
1113
+ interface ObjectIssue extends BaseIssue<unknown> {
1114
+ /**
1115
+ * The issue kind.
1116
+ */
1117
+ readonly kind: 'schema';
1118
+ /**
1119
+ * The issue type.
1120
+ */
1121
+ readonly type: 'object';
1122
+ /**
1123
+ * The expected property.
1124
+ */
1125
+ readonly expected: 'Object';
1126
+ }
1127
+
1128
+ /**
1129
+ * Object schema type.
1130
+ */
1131
+ interface ObjectSchema<TEntries extends ObjectEntries, TMessage extends ErrorMessage<ObjectIssue> | undefined> extends BaseSchema<InferObjectInput<TEntries>, InferObjectOutput<TEntries>, ObjectIssue | InferObjectIssue<TEntries>> {
1132
+ /**
1133
+ * The schema type.
1134
+ */
1135
+ readonly type: 'object';
1136
+ /**
1137
+ * The schema reference.
1138
+ */
1139
+ readonly reference: typeof object;
1140
+ /**
1141
+ * The expected property.
1142
+ */
1143
+ readonly expects: 'Object';
1144
+ /**
1145
+ * The entries schema.
1146
+ */
1147
+ readonly entries: TEntries;
1148
+ /**
1149
+ * The error message.
1150
+ */
1151
+ readonly message: TMessage;
1152
+ }
1153
+ /**
1154
+ * Creates an object schema.
1155
+ *
1156
+ * Hint: This schema removes unknown entries. The output will only include the
1157
+ * entries you specify. To include unknown entries, use `looseObject`. To
1158
+ * return an issue for unknown entries, use `strictObject`. To include and
1159
+ * validate unknown entries, use `objectWithRest`.
1160
+ *
1161
+ * @param entries The entries schema.
1162
+ *
1163
+ * @returns An object schema.
1164
+ */
1165
+ declare function object<const TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries, undefined>;
1166
+ /**
1167
+ * Creates an object schema.
1168
+ *
1169
+ * Hint: This schema removes unknown entries. The output will only include the
1170
+ * entries you specify. To include unknown entries, use `looseObject`. To
1171
+ * return an issue for unknown entries, use `strictObject`. To include and
1172
+ * validate unknown entries, use `objectWithRest`.
1173
+ *
1174
+ * @param entries The entries schema.
1175
+ * @param message The error message.
1176
+ *
1177
+ * @returns An object schema.
1178
+ */
1179
+ declare function object<const TEntries extends ObjectEntries, const TMessage extends ErrorMessage<ObjectIssue> | undefined>(entries: TEntries, message: TMessage): ObjectSchema<TEntries, TMessage>;
1180
+
1181
+ /**
1182
+ * Infer optional output type.
1183
+ */
1184
+ type InferOptionalOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, undefined>;
1185
+
1186
+ /**
1187
+ * Optional schema type.
1188
+ */
1189
+ interface OptionalSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, undefined>> extends BaseSchema<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1190
+ /**
1191
+ * The schema type.
1192
+ */
1193
+ readonly type: 'optional';
1194
+ /**
1195
+ * The schema reference.
1196
+ */
1197
+ readonly reference: typeof optional;
1198
+ /**
1199
+ * The expected property.
1200
+ */
1201
+ readonly expects: `(${TWrapped['expects']} | undefined)`;
1202
+ /**
1203
+ * The wrapped schema.
1204
+ */
1205
+ readonly wrapped: TWrapped;
1206
+ /**
1207
+ * The default value.
1208
+ */
1209
+ readonly default: TDefault;
1210
+ }
1211
+ /**
1212
+ * Creates a optional schema.
1213
+ *
1214
+ * @param wrapped The wrapped schema.
1215
+ *
1216
+ * @returns A optional schema.
1217
+ */
1218
+ declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): OptionalSchema<TWrapped, undefined>;
1219
+ /**
1220
+ * Creates a optional schema.
1221
+ *
1222
+ * @param wrapped The wrapped schema.
1223
+ * @param default_ The default value.
1224
+ *
1225
+ * @returns A optional schema.
1226
+ */
1227
+ declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchema<TWrapped, TDefault>;
1228
+
1229
+ /**
1230
+ * Optional schema async type.
1231
+ */
1232
+ interface OptionalSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1233
+ /**
1234
+ * The schema type.
1235
+ */
1236
+ readonly type: 'optional';
1237
+ /**
1238
+ * The schema reference.
1239
+ */
1240
+ readonly reference: typeof optionalAsync;
1241
+ /**
1242
+ * The expected property.
1243
+ */
1244
+ readonly expects: `(${TWrapped['expects']} | undefined)`;
1245
+ /**
1246
+ * The wrapped schema.
1247
+ */
1248
+ readonly wrapped: TWrapped;
1249
+ /**
1250
+ * The default value.
1251
+ */
1252
+ readonly default: TDefault;
1253
+ }
1254
+ /**
1255
+ * Creates an optional schema.
1256
+ *
1257
+ * @param wrapped The wrapped schema.
1258
+ *
1259
+ * @returns An optional schema.
1260
+ */
1261
+ declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): OptionalSchemaAsync<TWrapped, undefined>;
1262
+ /**
1263
+ * Creates an optional schema.
1264
+ *
1265
+ * @param wrapped The wrapped schema.
1266
+ * @param default_ The default value.
1267
+ *
1268
+ * @returns An optional schema.
1269
+ */
1270
+ declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchemaAsync<TWrapped, TDefault>;
1271
+
1272
+ /**
1273
+ * String issue type.
1274
+ */
1275
+ interface StringIssue extends BaseIssue<unknown> {
1276
+ /**
1277
+ * The issue kind.
1278
+ */
1279
+ readonly kind: 'schema';
1280
+ /**
1281
+ * The issue type.
1282
+ */
1283
+ readonly type: 'string';
1284
+ /**
1285
+ * The expected property.
1286
+ */
1287
+ readonly expected: 'string';
1288
+ }
1289
+ /**
1290
+ * String schema type.
1291
+ */
1292
+ interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined> extends BaseSchema<string, string, StringIssue> {
1293
+ /**
1294
+ * The schema type.
1295
+ */
1296
+ readonly type: 'string';
1297
+ /**
1298
+ * The schema reference.
1299
+ */
1300
+ readonly reference: typeof string;
1301
+ /**
1302
+ * The expected property.
1303
+ */
1304
+ readonly expects: 'string';
1305
+ /**
1306
+ * The error message.
1307
+ */
1308
+ readonly message: TMessage;
1309
+ }
1310
+ /**
1311
+ * Creates a string schema.
1312
+ *
1313
+ * @returns A string schema.
1314
+ */
1315
+ declare function string(): StringSchema<undefined>;
1316
+ /**
1317
+ * Creates a string schema.
1318
+ *
1319
+ * @param message The error message.
1320
+ *
1321
+ * @returns A string schema.
1322
+ */
1323
+ declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
1324
+
1325
+ /**
1326
+ * Readonly action type.
1327
+ */
1328
+ interface ReadonlyAction<TInput> extends BaseTransformation<TInput, Readonly<TInput>, never> {
1329
+ /**
1330
+ * The action type.
1331
+ */
1332
+ readonly type: 'readonly';
1333
+ /**
1334
+ * The action reference.
1335
+ */
1336
+ readonly reference: typeof readonly;
1337
+ }
1338
+ /**
1339
+ * Creates a readonly transformation action.
1340
+ *
1341
+ * @returns A readonly action.
1342
+ */
1343
+ declare function readonly<TInput>(): ReadonlyAction<TInput>;
59
1344
 
60
1345
  /**
61
1346
  * @internal
@@ -63,35 +1348,35 @@ declare function getReactVersion(at?: string): E.Either<string, unknown>;
63
1348
  * This allows the rule to know some key information before checking for user-defined hooks.
64
1349
  * For example, the position of the `deps` argument for the user-defined `useCustomEffect` hook that represents the built-in `useEffect` hook.
65
1350
  */
66
- declare const CustomHookSchema: valibot.ObjectSchema<{}, undefined>;
1351
+ declare const CustomHookSchema: ObjectSchema<{}, undefined>;
67
1352
  /**
68
1353
  * @internal
69
1354
  */
70
- declare const CustomAttributeSchema: valibot.ObjectSchema<{
1355
+ declare const CustomAttributeSchema: ObjectSchema<{
71
1356
  /**
72
1357
  * The name of the attribute in the user-defined component.
73
1358
  * @example
74
1359
  * "to"
75
1360
  */
76
- readonly name: valibot.StringSchema<undefined>;
1361
+ readonly name: StringSchema<undefined>;
77
1362
  /**
78
1363
  * The name of the attribute in the built-in component.
79
1364
  * @example
80
1365
  * "href"
81
1366
  */
82
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1367
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
83
1368
  /**
84
1369
  * Whether the attribute is controlled or not in the user-defined component.
85
1370
  * @example
86
1371
  * `true`
87
1372
  */
88
- readonly controlled: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1373
+ readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
89
1374
  /**
90
1375
  * The default value of the attribute in the user-defined component.
91
1376
  * @example
92
1377
  * `"/"`
93
1378
  */
94
- readonly defaultValue: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1379
+ readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
95
1380
  }, undefined>;
96
1381
  /**
97
1382
  * @internal
@@ -101,188 +1386,188 @@ declare const CustomAttributeSchema: valibot.ObjectSchema<{
101
1386
  * Which attribute is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element.
102
1387
  * Which attributes are used as `children` props for a user-defined `Button` component to receive children of that component.
103
1388
  */
104
- declare const CustomComponentSchema: valibot.ObjectSchema<{
1389
+ declare const CustomComponentSchema: ObjectSchema<{
105
1390
  /**
106
1391
  * The name of the user-defined component.
107
1392
  * @example
108
1393
  * "Link"
109
1394
  */
110
- readonly name: valibot.StringSchema<undefined>;
1395
+ readonly name: StringSchema<undefined>;
111
1396
  /**
112
1397
  * The ESQuery selector to select the component precisely.
113
1398
  * @example
114
1399
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
115
1400
  */
116
- readonly selector: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1401
+ readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
117
1402
  /**
118
1403
  * The name of the built-in component that the user-defined component represents.
119
1404
  * @example
120
1405
  * "a"
121
1406
  */
122
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1407
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
123
1408
  /**
124
1409
  * Pre-defined attributes that are used in the user-defined component.
125
1410
  * @example
126
1411
  * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
127
1412
  */
128
- readonly attributes: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1413
+ readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
129
1414
  /**
130
1415
  * The name of the attribute in the user-defined component.
131
1416
  * @example
132
1417
  * "to"
133
1418
  */
134
- readonly name: valibot.StringSchema<undefined>;
1419
+ readonly name: StringSchema<undefined>;
135
1420
  /**
136
1421
  * The name of the attribute in the built-in component.
137
1422
  * @example
138
1423
  * "href"
139
1424
  */
140
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1425
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
141
1426
  /**
142
1427
  * Whether the attribute is controlled or not in the user-defined component.
143
1428
  * @example
144
1429
  * `true`
145
1430
  */
146
- readonly controlled: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1431
+ readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
147
1432
  /**
148
1433
  * The default value of the attribute in the user-defined component.
149
1434
  * @example
150
1435
  * `"/"`
151
1436
  */
152
- readonly defaultValue: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1437
+ readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
153
1438
  }, undefined>, undefined>, undefined>;
154
1439
  }, undefined>;
155
- declare const CustomComponentNormalizedSchema: valibot.ObjectSchema<{
156
- readonly name: valibot.StringSchema<undefined>;
157
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
158
- readonly attributes: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1440
+ declare const CustomComponentNormalizedSchema: ObjectSchema<{
1441
+ readonly name: StringSchema<undefined>;
1442
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
1443
+ readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
159
1444
  /**
160
1445
  * The name of the attribute in the user-defined component.
161
1446
  * @example
162
1447
  * "to"
163
1448
  */
164
- readonly name: valibot.StringSchema<undefined>;
1449
+ readonly name: StringSchema<undefined>;
165
1450
  /**
166
1451
  * The name of the attribute in the built-in component.
167
1452
  * @example
168
1453
  * "href"
169
1454
  */
170
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1455
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
171
1456
  /**
172
1457
  * Whether the attribute is controlled or not in the user-defined component.
173
1458
  * @example
174
1459
  * `true`
175
1460
  */
176
- readonly controlled: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1461
+ readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
177
1462
  /**
178
1463
  * The default value of the attribute in the user-defined component.
179
1464
  * @example
180
1465
  * `"/"`
181
1466
  */
182
- readonly defaultValue: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1467
+ readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
183
1468
  }, undefined>, undefined>, readonly []>;
184
- readonly re: valibot.InstanceSchema<RegExpConstructor, undefined>;
185
- readonly selector: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1469
+ readonly re: InstanceSchema<RegExpConstructor, undefined>;
1470
+ readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
186
1471
  }, undefined>;
187
1472
  /**
188
1473
  * @internal
189
1474
  */
190
- declare const ESLintReactSettingsSchema: valibot.ObjectSchema<{
1475
+ declare const ESLintReactSettingsSchema: ObjectSchema<{
191
1476
  /**
192
1477
  * The source where React is imported from.
193
1478
  * @description This allows to specify a custom import location for React when not using the official distribution.
194
1479
  * @default `"react"`
195
1480
  * @example `"@pika/react"`
196
1481
  */
197
- readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1482
+ readonly importSource: OptionalSchema<StringSchema<undefined>, undefined>;
198
1483
  /**
199
1484
  * The identifier that’s used for JSX Element creation.
200
1485
  * @default `"createElement"`
201
1486
  * @deprecated
202
1487
  */
203
- readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1488
+ readonly jsxPragma: OptionalSchema<StringSchema<undefined>, undefined>;
204
1489
  /**
205
1490
  * The identifier that’s used for JSX fragment elements.
206
1491
  * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
207
1492
  * @default `"Fragment"`
208
1493
  * @deprecated
209
1494
  */
210
- readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1495
+ readonly jsxPragmaFrag: OptionalSchema<StringSchema<undefined>, undefined>;
211
1496
  /**
212
1497
  * The name of the prop that is used for polymorphic components.
213
1498
  * @description This is used to determine the type of the component.
214
1499
  * @example `"as"`
215
1500
  */
216
- readonly polymorphicPropName: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1501
+ readonly polymorphicPropName: OptionalSchema<StringSchema<undefined>, undefined>;
217
1502
  /**
218
1503
  * @internal
219
1504
  */
220
- readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1505
+ readonly strict: OptionalSchema<BooleanSchema<undefined>, undefined>;
221
1506
  /**
222
1507
  * @internal
223
1508
  */
224
- readonly strictImportCheck: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1509
+ readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, undefined>;
225
1510
  /**
226
1511
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
227
1512
  * If `importSource` is specified, an equivalent version of React should be provided here.
228
1513
  * @example `"18.3.1"`
229
1514
  * @default `"detect"`
230
1515
  */
231
- readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1516
+ readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
232
1517
  /**
233
1518
  * An array of user-defined components
234
1519
  * @description This is used to inform the ESLint React plugins how to treat these components during checks.
235
1520
  * @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
236
1521
  */
237
- readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1522
+ readonly additionalComponents: OptionalSchema<ArraySchema<ObjectSchema<{
238
1523
  /**
239
1524
  * The name of the user-defined component.
240
1525
  * @example
241
1526
  * "Link"
242
1527
  */
243
- readonly name: valibot.StringSchema<undefined>;
1528
+ readonly name: StringSchema<undefined>;
244
1529
  /**
245
1530
  * The ESQuery selector to select the component precisely.
246
1531
  * @example
247
1532
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
248
1533
  */
249
- readonly selector: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1534
+ readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
250
1535
  /**
251
1536
  * The name of the built-in component that the user-defined component represents.
252
1537
  * @example
253
1538
  * "a"
254
1539
  */
255
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1540
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
256
1541
  /**
257
1542
  * Pre-defined attributes that are used in the user-defined component.
258
1543
  * @example
259
1544
  * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
260
1545
  */
261
- readonly attributes: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1546
+ readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
262
1547
  /**
263
1548
  * The name of the attribute in the user-defined component.
264
1549
  * @example
265
1550
  * "to"
266
1551
  */
267
- readonly name: valibot.StringSchema<undefined>;
1552
+ readonly name: StringSchema<undefined>;
268
1553
  /**
269
1554
  * The name of the attribute in the built-in component.
270
1555
  * @example
271
1556
  * "href"
272
1557
  */
273
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1558
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
274
1559
  /**
275
1560
  * Whether the attribute is controlled or not in the user-defined component.
276
1561
  * @example
277
1562
  * `true`
278
1563
  */
279
- readonly controlled: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1564
+ readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
280
1565
  /**
281
1566
  * The default value of the attribute in the user-defined component.
282
1567
  * @example
283
1568
  * `"/"`
284
1569
  */
285
- readonly defaultValue: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1570
+ readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
286
1571
  }, undefined>, undefined>, undefined>;
287
1572
  }, undefined>, undefined>, undefined>;
288
1573
  /**
@@ -290,128 +1575,128 @@ declare const ESLintReactSettingsSchema: valibot.ObjectSchema<{
290
1575
  * @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
291
1576
  * @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
292
1577
  */
293
- readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
294
- readonly use: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
295
- readonly useActionState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
296
- readonly useCallback: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
297
- readonly useContext: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
298
- readonly useDebugValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
299
- readonly useDeferredValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
300
- readonly useEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
301
- readonly useFormStatus: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
302
- readonly useId: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
303
- readonly useImperativeHandle: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
304
- readonly useInsertionEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
305
- readonly useLayoutEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
306
- readonly useMemo: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
307
- readonly useOptimistic: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
308
- readonly useReducer: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
309
- readonly useRef: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
310
- readonly useState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
311
- readonly useSyncExternalStore: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
312
- readonly useTransition: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
1578
+ readonly additionalHooks: OptionalSchema<ObjectSchema<{
1579
+ readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1580
+ readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1581
+ readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1582
+ readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1583
+ readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1584
+ readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1585
+ readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1586
+ readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1587
+ readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1588
+ readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1589
+ readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1590
+ readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1591
+ readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1592
+ readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1593
+ readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1594
+ readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1595
+ readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1596
+ readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1597
+ readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
313
1598
  }, undefined>, undefined>;
314
1599
  }, undefined>;
315
1600
  /**
316
1601
  * @internal
317
1602
  */
318
- declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<{
319
- readonly "react-x": valibot.OptionalSchema<valibot.ObjectSchema<{
1603
+ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1604
+ readonly "react-x": OptionalSchema<ObjectSchema<{
320
1605
  /**
321
1606
  * The source where React is imported from.
322
1607
  * @description This allows to specify a custom import location for React when not using the official distribution.
323
1608
  * @default `"react"`
324
1609
  * @example `"@pika/react"`
325
1610
  */
326
- readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1611
+ readonly importSource: OptionalSchema<StringSchema<undefined>, undefined>;
327
1612
  /**
328
1613
  * The identifier that’s used for JSX Element creation.
329
1614
  * @default `"createElement"`
330
1615
  * @deprecated
331
1616
  */
332
- readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1617
+ readonly jsxPragma: OptionalSchema<StringSchema<undefined>, undefined>;
333
1618
  /**
334
1619
  * The identifier that’s used for JSX fragment elements.
335
1620
  * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
336
1621
  * @default `"Fragment"`
337
1622
  * @deprecated
338
1623
  */
339
- readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1624
+ readonly jsxPragmaFrag: OptionalSchema<StringSchema<undefined>, undefined>;
340
1625
  /**
341
1626
  * The name of the prop that is used for polymorphic components.
342
1627
  * @description This is used to determine the type of the component.
343
1628
  * @example `"as"`
344
1629
  */
345
- readonly polymorphicPropName: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1630
+ readonly polymorphicPropName: OptionalSchema<StringSchema<undefined>, undefined>;
346
1631
  /**
347
1632
  * @internal
348
1633
  */
349
- readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1634
+ readonly strict: OptionalSchema<BooleanSchema<undefined>, undefined>;
350
1635
  /**
351
1636
  * @internal
352
1637
  */
353
- readonly strictImportCheck: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1638
+ readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, undefined>;
354
1639
  /**
355
1640
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
356
1641
  * If `importSource` is specified, an equivalent version of React should be provided here.
357
1642
  * @example `"18.3.1"`
358
1643
  * @default `"detect"`
359
1644
  */
360
- readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1645
+ readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
361
1646
  /**
362
1647
  * An array of user-defined components
363
1648
  * @description This is used to inform the ESLint React plugins how to treat these components during checks.
364
1649
  * @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
365
1650
  */
366
- readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1651
+ readonly additionalComponents: OptionalSchema<ArraySchema<ObjectSchema<{
367
1652
  /**
368
1653
  * The name of the user-defined component.
369
1654
  * @example
370
1655
  * "Link"
371
1656
  */
372
- readonly name: valibot.StringSchema<undefined>;
1657
+ readonly name: StringSchema<undefined>;
373
1658
  /**
374
1659
  * The ESQuery selector to select the component precisely.
375
1660
  * @example
376
1661
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
377
1662
  */
378
- readonly selector: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1663
+ readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
379
1664
  /**
380
1665
  * The name of the built-in component that the user-defined component represents.
381
1666
  * @example
382
1667
  * "a"
383
1668
  */
384
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1669
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
385
1670
  /**
386
1671
  * Pre-defined attributes that are used in the user-defined component.
387
1672
  * @example
388
1673
  * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
389
1674
  */
390
- readonly attributes: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1675
+ readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
391
1676
  /**
392
1677
  * The name of the attribute in the user-defined component.
393
1678
  * @example
394
1679
  * "to"
395
1680
  */
396
- readonly name: valibot.StringSchema<undefined>;
1681
+ readonly name: StringSchema<undefined>;
397
1682
  /**
398
1683
  * The name of the attribute in the built-in component.
399
1684
  * @example
400
1685
  * "href"
401
1686
  */
402
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1687
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
403
1688
  /**
404
1689
  * Whether the attribute is controlled or not in the user-defined component.
405
1690
  * @example
406
1691
  * `true`
407
1692
  */
408
- readonly controlled: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1693
+ readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
409
1694
  /**
410
1695
  * The default value of the attribute in the user-defined component.
411
1696
  * @example
412
1697
  * `"/"`
413
1698
  */
414
- readonly defaultValue: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1699
+ readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
415
1700
  }, undefined>, undefined>, undefined>;
416
1701
  }, undefined>, undefined>, undefined>;
417
1702
  /**
@@ -419,125 +1704,125 @@ declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<
419
1704
  * @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
420
1705
  * @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
421
1706
  */
422
- readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
423
- readonly use: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
424
- readonly useActionState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
425
- readonly useCallback: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
426
- readonly useContext: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
427
- readonly useDebugValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
428
- readonly useDeferredValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
429
- readonly useEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
430
- readonly useFormStatus: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
431
- readonly useId: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
432
- readonly useImperativeHandle: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
433
- readonly useInsertionEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
434
- readonly useLayoutEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
435
- readonly useMemo: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
436
- readonly useOptimistic: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
437
- readonly useReducer: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
438
- readonly useRef: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
439
- readonly useState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
440
- readonly useSyncExternalStore: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
441
- readonly useTransition: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
1707
+ readonly additionalHooks: OptionalSchema<ObjectSchema<{
1708
+ readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1709
+ readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1710
+ readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1711
+ readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1712
+ readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1713
+ readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1714
+ readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1715
+ readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1716
+ readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1717
+ readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1718
+ readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1719
+ readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1720
+ readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1721
+ readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1722
+ readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1723
+ readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1724
+ readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1725
+ readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1726
+ readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
442
1727
  }, undefined>, undefined>;
443
1728
  }, undefined>, undefined>;
444
1729
  /** @deprecated Use `react-x` instead */
445
- readonly reactOptions: valibot.OptionalSchema<valibot.ObjectSchema<{
1730
+ readonly reactOptions: OptionalSchema<ObjectSchema<{
446
1731
  /**
447
1732
  * The source where React is imported from.
448
1733
  * @description This allows to specify a custom import location for React when not using the official distribution.
449
1734
  * @default `"react"`
450
1735
  * @example `"@pika/react"`
451
1736
  */
452
- readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1737
+ readonly importSource: OptionalSchema<StringSchema<undefined>, undefined>;
453
1738
  /**
454
1739
  * The identifier that’s used for JSX Element creation.
455
1740
  * @default `"createElement"`
456
1741
  * @deprecated
457
1742
  */
458
- readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1743
+ readonly jsxPragma: OptionalSchema<StringSchema<undefined>, undefined>;
459
1744
  /**
460
1745
  * The identifier that’s used for JSX fragment elements.
461
1746
  * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
462
1747
  * @default `"Fragment"`
463
1748
  * @deprecated
464
1749
  */
465
- readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1750
+ readonly jsxPragmaFrag: OptionalSchema<StringSchema<undefined>, undefined>;
466
1751
  /**
467
1752
  * The name of the prop that is used for polymorphic components.
468
1753
  * @description This is used to determine the type of the component.
469
1754
  * @example `"as"`
470
1755
  */
471
- readonly polymorphicPropName: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1756
+ readonly polymorphicPropName: OptionalSchema<StringSchema<undefined>, undefined>;
472
1757
  /**
473
1758
  * @internal
474
1759
  */
475
- readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1760
+ readonly strict: OptionalSchema<BooleanSchema<undefined>, undefined>;
476
1761
  /**
477
1762
  * @internal
478
1763
  */
479
- readonly strictImportCheck: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1764
+ readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, undefined>;
480
1765
  /**
481
1766
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
482
1767
  * If `importSource` is specified, an equivalent version of React should be provided here.
483
1768
  * @example `"18.3.1"`
484
1769
  * @default `"detect"`
485
1770
  */
486
- readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1771
+ readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
487
1772
  /**
488
1773
  * An array of user-defined components
489
1774
  * @description This is used to inform the ESLint React plugins how to treat these components during checks.
490
1775
  * @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
491
1776
  */
492
- readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1777
+ readonly additionalComponents: OptionalSchema<ArraySchema<ObjectSchema<{
493
1778
  /**
494
1779
  * The name of the user-defined component.
495
1780
  * @example
496
1781
  * "Link"
497
1782
  */
498
- readonly name: valibot.StringSchema<undefined>;
1783
+ readonly name: StringSchema<undefined>;
499
1784
  /**
500
1785
  * The ESQuery selector to select the component precisely.
501
1786
  * @example
502
1787
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
503
1788
  */
504
- readonly selector: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1789
+ readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
505
1790
  /**
506
1791
  * The name of the built-in component that the user-defined component represents.
507
1792
  * @example
508
1793
  * "a"
509
1794
  */
510
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1795
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
511
1796
  /**
512
1797
  * Pre-defined attributes that are used in the user-defined component.
513
1798
  * @example
514
1799
  * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
515
1800
  */
516
- readonly attributes: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
1801
+ readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
517
1802
  /**
518
1803
  * The name of the attribute in the user-defined component.
519
1804
  * @example
520
1805
  * "to"
521
1806
  */
522
- readonly name: valibot.StringSchema<undefined>;
1807
+ readonly name: StringSchema<undefined>;
523
1808
  /**
524
1809
  * The name of the attribute in the built-in component.
525
1810
  * @example
526
1811
  * "href"
527
1812
  */
528
- readonly as: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1813
+ readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
529
1814
  /**
530
1815
  * Whether the attribute is controlled or not in the user-defined component.
531
1816
  * @example
532
1817
  * `true`
533
1818
  */
534
- readonly controlled: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
1819
+ readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
535
1820
  /**
536
1821
  * The default value of the attribute in the user-defined component.
537
1822
  * @example
538
1823
  * `"/"`
539
1824
  */
540
- readonly defaultValue: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
1825
+ readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
541
1826
  }, undefined>, undefined>, undefined>;
542
1827
  }, undefined>, undefined>, undefined>;
543
1828
  /**
@@ -545,26 +1830,26 @@ declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<
545
1830
  * @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
546
1831
  * @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
547
1832
  */
548
- readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
549
- readonly use: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
550
- readonly useActionState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
551
- readonly useCallback: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
552
- readonly useContext: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
553
- readonly useDebugValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
554
- readonly useDeferredValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
555
- readonly useEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
556
- readonly useFormStatus: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
557
- readonly useId: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
558
- readonly useImperativeHandle: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
559
- readonly useInsertionEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
560
- readonly useLayoutEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
561
- readonly useMemo: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
562
- readonly useOptimistic: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
563
- readonly useReducer: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
564
- readonly useRef: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
565
- readonly useState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
566
- readonly useSyncExternalStore: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
567
- readonly useTransition: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
1833
+ readonly additionalHooks: OptionalSchema<ObjectSchema<{
1834
+ readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1835
+ readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1836
+ readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1837
+ readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1838
+ readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1839
+ readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1840
+ readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1841
+ readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1842
+ readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1843
+ readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1844
+ readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1845
+ readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1846
+ readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1847
+ readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1848
+ readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1849
+ readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1850
+ readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1851
+ readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
1852
+ readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
568
1853
  }, undefined>, undefined>;
569
1854
  }, undefined>, undefined>;
570
1855
  }, undefined>, {}>;
@@ -584,6 +1869,205 @@ interface ESLintReactSettingsNormalized extends ESLintReactSettings {
584
1869
  version: string;
585
1870
  }
586
1871
 
1872
+ declare const normalizedSettingsCache: WeakMap<{
1873
+ importSource?: string;
1874
+ jsxPragma?: string;
1875
+ jsxPragmaFrag?: string;
1876
+ polymorphicPropName?: string;
1877
+ strict?: boolean;
1878
+ strictImportCheck?: boolean;
1879
+ version?: string;
1880
+ additionalComponents?: {
1881
+ name: string;
1882
+ as?: string;
1883
+ selector?: string;
1884
+ attributes?: {
1885
+ name: string;
1886
+ as?: string;
1887
+ controlled?: boolean;
1888
+ defaultValue?: string;
1889
+ }[];
1890
+ }[];
1891
+ additionalHooks?: {
1892
+ use?: string[];
1893
+ useActionState?: string[];
1894
+ useCallback?: string[];
1895
+ useContext?: string[];
1896
+ useDebugValue?: string[];
1897
+ useDeferredValue?: string[];
1898
+ useEffect?: string[];
1899
+ useFormStatus?: string[];
1900
+ useId?: string[];
1901
+ useImperativeHandle?: string[];
1902
+ useInsertionEffect?: string[];
1903
+ useLayoutEffect?: string[];
1904
+ useMemo?: string[];
1905
+ useOptimistic?: string[];
1906
+ useReducer?: string[];
1907
+ useRef?: string[];
1908
+ useState?: string[];
1909
+ useSyncExternalStore?: string[];
1910
+ useTransition?: string[];
1911
+ };
1912
+ }, ESLintReactSettingsNormalized>;
1913
+
1914
+ /**
1915
+ * The NPM scope for this project.
1916
+ */
1917
+ declare const NPM_SCOPE = "@eslint-react";
1918
+ /**
1919
+ * The GitHub repository for this project.
1920
+ */
1921
+ declare const GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
1922
+ /**
1923
+ * The URL to the project's website.
1924
+ */
1925
+ declare const WEBSITE_URL = "https://eslint-react.xyz";
1926
+ /**
1927
+ * Regular expression for matching a PascalCase string.
1928
+ */
1929
+ declare const RE_PASCAL_CASE: RegExp;
1930
+ /**
1931
+ * Regular expression for matching a camelCase string.
1932
+ */
1933
+ declare const RE_CAMEL_CASE: RegExp;
1934
+ /**
1935
+ * Regular expression for matching a kebab-case string.
1936
+ */
1937
+ declare const RE_KEBAB_CASE: RegExp;
1938
+ /**
1939
+ * Regular expression for matching a snake_case string.
1940
+ */
1941
+ declare const RE_SNAKE_CASE: RegExp;
1942
+ /**
1943
+ * Regular expression for matching a CONSTANT_CASE string.
1944
+ */
1945
+ declare const RE_CONSTANT_CASE: RegExp;
1946
+ declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
1947
+ /**
1948
+ * @internal
1949
+ */
1950
+ declare const HOST_HTML_COMPONENT_TYPES: readonly ["aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "menu", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
1951
+ /**
1952
+ * @internal
1953
+ */
1954
+ declare const HOST_SVG_COMPONENT_TYPES: readonly ["a", "animate", "animateMotion", "animateTransform", "circle", "clipPath", "defs", "desc", "discard", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "hatch", "hatchpath", "image", "line", "linearGradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "script", "set", "stop", "style", "svg", "switch", "symbol", "text", "textPath", "title", "tspan", "use", "view"];
1955
+ declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
1956
+
1957
+ /**
1958
+ * Get the ESLint rule creator for a plugin.
1959
+ * @internal
1960
+ * @param pluginName The name of the plugin.
1961
+ * @returns The ESLint rule creator.
1962
+ */
1963
+ declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
1964
+
1965
+ declare function getReactVersion(at?: string): E.Either<string, unknown>;
1966
+
1967
+ interface Dictionary<Type> {
1968
+ [key: string]: Type;
1969
+ [index: number]: Type;
1970
+ }
1971
+
1972
+ type AnyFn = (...args: any[]) => any;
1973
+
1974
+ type Key = any[];
1975
+ type RawKey = Key | IArguments;
1976
+ type Value = any;
1977
+
1978
+ interface CacheSnapshot {
1979
+ keys: Key[];
1980
+ size: number;
1981
+ values: Value[];
1982
+ }
1983
+
1984
+ declare class Cache<Fn extends AnyFn> {
1985
+ readonly canTransformKey: boolean;
1986
+ readonly getKeyIndex: KeyIndexGetter;
1987
+ readonly options: NormalizedOptions<Fn>;
1988
+ readonly shouldCloneArguments: boolean;
1989
+ readonly shouldUpdateOnAdd: boolean;
1990
+ readonly shouldUpdateOnChange: boolean;
1991
+ readonly shouldUpdateOnHit: boolean;
1992
+
1993
+ /**
1994
+ * The prevents call arguments which have cached results.
1995
+ */
1996
+ keys: Key[];
1997
+ /**
1998
+ * The results of previous cached calls.
1999
+ */
2000
+ values: Value[];
2001
+
2002
+ constructor(options: NormalizedOptions<Fn>);
2003
+
2004
+ /**
2005
+ * The number of cached [key,value] results.
2006
+ */
2007
+ get size(): number;
2008
+
2009
+ /**
2010
+ * A copy of the cache at a moment in time. This is useful
2011
+ * to compare changes over time, since the cache mutates
2012
+ * internally for performance reasons.
2013
+ */
2014
+ get snapshot(): CacheSnapshot;
2015
+
2016
+ /**
2017
+ * Order the array based on a Least-Recently-Used basis.
2018
+ */
2019
+ orderByLru(key: Key, value: Value, startingIndex: number): void;
2020
+
2021
+ /**
2022
+ * Update the promise method to auto-remove from cache if rejected, and
2023
+ * if resolved then fire cache hit / changed.
2024
+ */
2025
+ updateAsyncCache(memoized: Memoized<Fn>): void;
2026
+ }
2027
+
2028
+ type EqualityComparator = (object1: any, object2: any) => boolean;
2029
+
2030
+ type MatchingKeyComparator = (key1: Key, key2: RawKey) => boolean;
2031
+
2032
+ type CacheModifiedHandler<Fn extends AnyFn> = (
2033
+ cache: Cache<Fn>,
2034
+ options: NormalizedOptions<Fn>,
2035
+ memoized: Memoized<Fn>,
2036
+ ) => void;
2037
+
2038
+ type KeyTransformer = (args: Key) => Key;
2039
+
2040
+ type KeyIndexGetter = (keyToMatch: RawKey) => number;
2041
+
2042
+ interface StandardOptions<Fn extends AnyFn> {
2043
+ isEqual?: EqualityComparator;
2044
+ isMatchingKey?: MatchingKeyComparator;
2045
+ isPromise?: boolean;
2046
+ maxSize?: number;
2047
+ onCacheAdd?: CacheModifiedHandler<Fn>;
2048
+ onCacheChange?: CacheModifiedHandler<Fn>;
2049
+ onCacheHit?: CacheModifiedHandler<Fn>;
2050
+ transformKey?: KeyTransformer;
2051
+ }
2052
+
2053
+ interface Options<Fn extends AnyFn>
2054
+ extends StandardOptions<Fn>,
2055
+ Dictionary<any> {}
2056
+
2057
+ interface NormalizedOptions<Fn extends AnyFn> extends Options<Fn> {
2058
+ isEqual: EqualityComparator;
2059
+ isPromise: boolean;
2060
+ maxSize: number;
2061
+ }
2062
+
2063
+ type Memoized<Fn extends AnyFn> = Fn &
2064
+ Dictionary<any> & {
2065
+ cache: Cache<Fn>;
2066
+ fn: Fn;
2067
+ isMemoized: true;
2068
+ options: NormalizedOptions<Fn>;
2069
+ };
2070
+
587
2071
  /**
588
2072
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
589
2073
 
@@ -735,21 +2219,24 @@ declare const DEFAULT_ESLINT_REACT_SETTINGS: {
735
2219
  * @param data The data object.
736
2220
  * @returns settings The settings.
737
2221
  */
738
- declare function unsafeReadSettings(data: unknown): PartialDeep<ESLintReactSettings>;
2222
+ declare function unsafeDecodeSettings(data: unknown): PartialDeep<ESLintReactSettings>;
739
2223
  /**
740
2224
  * Decodes settings from a data object from `context.settings`.
741
2225
  * @internal
742
2226
  * @param data The data object.
743
2227
  * @returns settings The settings.
744
2228
  */
745
- declare const decodeSettings: micro_memoize.Memoized<(data: unknown) => ESLintReactSettings>;
2229
+ declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
746
2230
  /**
747
2231
  * Normalizes the settings by converting all shorthand properties to their full form.
748
2232
  * @param settings The settings.
749
2233
  * @returns The normalized settings.
750
2234
  * @internal
751
2235
  */
752
- declare const normalizeSettings: micro_memoize.Memoized<(settings: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2236
+ declare const normalizeSettings: Memoized<(settings: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2237
+ declare function getSettingsFromContext(context: {
2238
+ settings: unknown;
2239
+ }): ESLintReactSettingsNormalized;
753
2240
  /**
754
2241
  * A helper function to define settings for "react-x" with type checking in JavaScript files.
755
2242
  * @param settings The settings.
@@ -762,4 +2249,6 @@ declare module "@typescript-eslint/utils/ts-eslint" {
762
2249
  }
763
2250
  }
764
2251
 
765
- export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, normalizeSettings, unsafeReadSettings };
2252
+ declare function tryRequire(id: string, at?: string): E.Either<unknown, Error>;
2253
+
2254
+ export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, normalizedSettingsCache, tryRequire, unsafeDecodeSettings };