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