@eslint-react/shared 1.16.2-next.2 → 1.16.2-next.3

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