@eslint-react/shared 1.22.1-beta.0 → 1.22.1-beta.2

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