@angular/forms 21.0.0-next.4 → 21.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
2
|
+
* @license Angular v21.0.0-next.6
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -25,6 +25,7 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
25
25
|
* forms `NgControl`. This is provided to improve interoperability with controls designed to work
|
|
26
26
|
* with reactive forms. It should not be used by controls written for signal forms.
|
|
27
27
|
*
|
|
28
|
+
* @category control
|
|
28
29
|
* @experimental 21.0.0
|
|
29
30
|
*/
|
|
30
31
|
declare class Control<T> {
|
|
@@ -74,6 +75,7 @@ declare class Control<T> {
|
|
|
74
75
|
* Represents a property that may be defined on a field when it is created using a `property` rule
|
|
75
76
|
* in the schema. A particular `Property` can only be defined on a particular field **once**.
|
|
76
77
|
*
|
|
78
|
+
* @category logic
|
|
77
79
|
* @experimental 21.0.0
|
|
78
80
|
*/
|
|
79
81
|
declare class Property<TValue> {
|
|
@@ -144,36 +146,42 @@ declare function andProperty(): AggregateProperty<boolean, boolean>;
|
|
|
144
146
|
/**
|
|
145
147
|
* An aggregate property representing whether the field is required.
|
|
146
148
|
*
|
|
149
|
+
* @category validation
|
|
147
150
|
* @experimental 21.0.0
|
|
148
151
|
*/
|
|
149
152
|
declare const REQUIRED: AggregateProperty<boolean, boolean>;
|
|
150
153
|
/**
|
|
151
154
|
* An aggregate property representing the min value of the field.
|
|
152
155
|
*
|
|
156
|
+
* @category validation
|
|
153
157
|
* @experimental 21.0.0
|
|
154
158
|
*/
|
|
155
159
|
declare const MIN: AggregateProperty<number | undefined, number | undefined>;
|
|
156
160
|
/**
|
|
157
161
|
* An aggregate property representing the max value of the field.
|
|
158
162
|
*
|
|
163
|
+
* @category validation
|
|
159
164
|
* @experimental 21.0.0
|
|
160
165
|
*/
|
|
161
166
|
declare const MAX: AggregateProperty<number | undefined, number | undefined>;
|
|
162
167
|
/**
|
|
163
168
|
* An aggregate property representing the min length of the field.
|
|
164
169
|
*
|
|
170
|
+
* @category validation
|
|
165
171
|
* @experimental 21.0.0
|
|
166
172
|
*/
|
|
167
173
|
declare const MIN_LENGTH: AggregateProperty<number | undefined, number | undefined>;
|
|
168
174
|
/**
|
|
169
175
|
* An aggregate property representing the max length of the field.
|
|
170
176
|
*
|
|
177
|
+
* @category validation
|
|
171
178
|
* @experimental 21.0.0
|
|
172
179
|
*/
|
|
173
180
|
declare const MAX_LENGTH: AggregateProperty<number | undefined, number | undefined>;
|
|
174
181
|
/**
|
|
175
182
|
* An aggregate property representing the patterns the field must match.
|
|
176
183
|
*
|
|
184
|
+
* @category validation
|
|
177
185
|
* @experimental 21.0.0
|
|
178
186
|
*/
|
|
179
187
|
declare const PATTERN: AggregateProperty<RegExp[], RegExp | undefined>;
|
|
@@ -223,6 +231,7 @@ declare function requiredError(options: WithField<ValidationErrorOptions>): Requ
|
|
|
223
231
|
* Create a required error
|
|
224
232
|
* @param options The optional validation error options
|
|
225
233
|
*
|
|
234
|
+
* @category validation
|
|
226
235
|
* @experimental 21.0.0
|
|
227
236
|
*/
|
|
228
237
|
declare function requiredError(options?: ValidationErrorOptions): WithoutField<RequiredValidationError>;
|
|
@@ -231,6 +240,7 @@ declare function requiredError(options?: ValidationErrorOptions): WithoutField<R
|
|
|
231
240
|
* @param min The min value constraint
|
|
232
241
|
* @param options The validation error options
|
|
233
242
|
*
|
|
243
|
+
* @category validation
|
|
234
244
|
* @experimental 21.0.0
|
|
235
245
|
*/
|
|
236
246
|
declare function minError(min: number, options: WithField<ValidationErrorOptions>): MinValidationError;
|
|
@@ -239,6 +249,7 @@ declare function minError(min: number, options: WithField<ValidationErrorOptions
|
|
|
239
249
|
* @param min The min value constraint
|
|
240
250
|
* @param options The optional validation error options
|
|
241
251
|
*
|
|
252
|
+
* @category validation
|
|
242
253
|
* @experimental 21.0.0
|
|
243
254
|
*/
|
|
244
255
|
declare function minError(min: number, options?: ValidationErrorOptions): WithoutField<MinValidationError>;
|
|
@@ -247,6 +258,7 @@ declare function minError(min: number, options?: ValidationErrorOptions): Withou
|
|
|
247
258
|
* @param max The max value constraint
|
|
248
259
|
* @param options The validation error options
|
|
249
260
|
*
|
|
261
|
+
* @category validation
|
|
250
262
|
* @experimental 21.0.0
|
|
251
263
|
*/
|
|
252
264
|
declare function maxError(max: number, options: WithField<ValidationErrorOptions>): MaxValidationError;
|
|
@@ -255,6 +267,7 @@ declare function maxError(max: number, options: WithField<ValidationErrorOptions
|
|
|
255
267
|
* @param max The max value constraint
|
|
256
268
|
* @param options The optional validation error options
|
|
257
269
|
*
|
|
270
|
+
* @category validation
|
|
258
271
|
* @experimental 21.0.0
|
|
259
272
|
*/
|
|
260
273
|
declare function maxError(max: number, options?: ValidationErrorOptions): WithoutField<MaxValidationError>;
|
|
@@ -263,6 +276,7 @@ declare function maxError(max: number, options?: ValidationErrorOptions): Withou
|
|
|
263
276
|
* @param minLength The minLength constraint
|
|
264
277
|
* @param options The validation error options
|
|
265
278
|
*
|
|
279
|
+
* @category validation
|
|
266
280
|
* @experimental 21.0.0
|
|
267
281
|
*/
|
|
268
282
|
declare function minLengthError(minLength: number, options: WithField<ValidationErrorOptions>): MinLengthValidationError;
|
|
@@ -271,6 +285,7 @@ declare function minLengthError(minLength: number, options: WithField<Validation
|
|
|
271
285
|
* @param minLength The minLength constraint
|
|
272
286
|
* @param options The optional validation error options
|
|
273
287
|
*
|
|
288
|
+
* @category validation
|
|
274
289
|
* @experimental 21.0.0
|
|
275
290
|
*/
|
|
276
291
|
declare function minLengthError(minLength: number, options?: ValidationErrorOptions): WithoutField<MinLengthValidationError>;
|
|
@@ -279,6 +294,7 @@ declare function minLengthError(minLength: number, options?: ValidationErrorOpti
|
|
|
279
294
|
* @param maxLength The maxLength constraint
|
|
280
295
|
* @param options The validation error options
|
|
281
296
|
*
|
|
297
|
+
* @category validation
|
|
282
298
|
* @experimental 21.0.0
|
|
283
299
|
*/
|
|
284
300
|
declare function maxLengthError(maxLength: number, options: WithField<ValidationErrorOptions>): MaxLengthValidationError;
|
|
@@ -287,6 +303,7 @@ declare function maxLengthError(maxLength: number, options: WithField<Validation
|
|
|
287
303
|
* @param maxLength The maxLength constraint
|
|
288
304
|
* @param options The optional validation error options
|
|
289
305
|
*
|
|
306
|
+
* @category validation
|
|
290
307
|
* @experimental 21.0.0
|
|
291
308
|
*/
|
|
292
309
|
declare function maxLengthError(maxLength: number, options?: ValidationErrorOptions): WithoutField<MaxLengthValidationError>;
|
|
@@ -295,6 +312,7 @@ declare function maxLengthError(maxLength: number, options?: ValidationErrorOpti
|
|
|
295
312
|
* @param pattern The violated pattern
|
|
296
313
|
* @param options The validation error options
|
|
297
314
|
*
|
|
315
|
+
* @category validation
|
|
298
316
|
* @experimental 21.0.0
|
|
299
317
|
*/
|
|
300
318
|
declare function patternError(pattern: RegExp, options: WithField<ValidationErrorOptions>): PatternValidationError;
|
|
@@ -303,6 +321,7 @@ declare function patternError(pattern: RegExp, options: WithField<ValidationErro
|
|
|
303
321
|
* @param pattern The violated pattern
|
|
304
322
|
* @param options The optional validation error options
|
|
305
323
|
*
|
|
324
|
+
* @category validation
|
|
306
325
|
* @experimental 21.0.0
|
|
307
326
|
*/
|
|
308
327
|
declare function patternError(pattern: RegExp, options?: ValidationErrorOptions): WithoutField<PatternValidationError>;
|
|
@@ -310,6 +329,7 @@ declare function patternError(pattern: RegExp, options?: ValidationErrorOptions)
|
|
|
310
329
|
* Create an email format error associated with the target field
|
|
311
330
|
* @param options The validation error options
|
|
312
331
|
*
|
|
332
|
+
* @category validation
|
|
313
333
|
* @experimental 21.0.0
|
|
314
334
|
*/
|
|
315
335
|
declare function emailError(options: WithField<ValidationErrorOptions>): EmailValidationError;
|
|
@@ -317,6 +337,7 @@ declare function emailError(options: WithField<ValidationErrorOptions>): EmailVa
|
|
|
317
337
|
* Create an email format error
|
|
318
338
|
* @param options The optional validation error options
|
|
319
339
|
*
|
|
340
|
+
* @category validation
|
|
320
341
|
* @experimental 21.0.0
|
|
321
342
|
*/
|
|
322
343
|
declare function emailError(options?: ValidationErrorOptions): WithoutField<EmailValidationError>;
|
|
@@ -325,6 +346,7 @@ declare function emailError(options?: ValidationErrorOptions): WithoutField<Emai
|
|
|
325
346
|
* @param issue The standard schema issue
|
|
326
347
|
* @param options The validation error options
|
|
327
348
|
*
|
|
349
|
+
* @category validation
|
|
328
350
|
* @experimental 21.0.0
|
|
329
351
|
*/
|
|
330
352
|
declare function standardSchemaError(issue: StandardSchemaV1.Issue, options: WithField<ValidationErrorOptions>): StandardSchemaValidationError;
|
|
@@ -333,6 +355,7 @@ declare function standardSchemaError(issue: StandardSchemaV1.Issue, options: Wit
|
|
|
333
355
|
* @param issue The standard schema issue
|
|
334
356
|
* @param options The optional validation error options
|
|
335
357
|
*
|
|
358
|
+
* @category validation
|
|
336
359
|
* @experimental 21.0.0
|
|
337
360
|
*/
|
|
338
361
|
declare function standardSchemaError(issue: StandardSchemaV1.Issue, options?: ValidationErrorOptions): WithoutField<StandardSchemaValidationError>;
|
|
@@ -340,6 +363,7 @@ declare function standardSchemaError(issue: StandardSchemaV1.Issue, options?: Va
|
|
|
340
363
|
* Create a custom error associated with the target field
|
|
341
364
|
* @param obj The object to create an error from
|
|
342
365
|
*
|
|
366
|
+
* @category validation
|
|
343
367
|
* @experimental 21.0.0
|
|
344
368
|
*/
|
|
345
369
|
declare function customError<E extends Partial<ValidationError>>(obj: WithField<E>): CustomValidationError;
|
|
@@ -347,6 +371,7 @@ declare function customError<E extends Partial<ValidationError>>(obj: WithField<
|
|
|
347
371
|
* Create a custom error
|
|
348
372
|
* @param obj The object to create an error from
|
|
349
373
|
*
|
|
374
|
+
* @category validation
|
|
350
375
|
* @experimental 21.0.0
|
|
351
376
|
*/
|
|
352
377
|
declare function customError<E extends Partial<ValidationError>>(obj?: E): WithoutField<CustomValidationError>;
|
|
@@ -355,6 +380,7 @@ declare function customError<E extends Partial<ValidationError>>(obj?: E): Witho
|
|
|
355
380
|
*
|
|
356
381
|
* Use the creation functions to create an instance (e.g. `requiredError`, `minError`, etc.).
|
|
357
382
|
*
|
|
383
|
+
* @category validation
|
|
358
384
|
* @experimental 21.0.0
|
|
359
385
|
*/
|
|
360
386
|
interface ValidationError {
|
|
@@ -368,6 +394,7 @@ interface ValidationError {
|
|
|
368
394
|
/**
|
|
369
395
|
* A custom error that may contain additional properties
|
|
370
396
|
*
|
|
397
|
+
* @category validation
|
|
371
398
|
* @experimental 21.0.0
|
|
372
399
|
*/
|
|
373
400
|
declare class CustomValidationError implements ValidationError {
|
|
@@ -405,6 +432,7 @@ declare abstract class _NgValidationError implements ValidationError {
|
|
|
405
432
|
/**
|
|
406
433
|
* An error used to indicate that a required field is empty.
|
|
407
434
|
*
|
|
435
|
+
* @category validation
|
|
408
436
|
* @experimental 21.0.0
|
|
409
437
|
*/
|
|
410
438
|
declare class RequiredValidationError extends _NgValidationError {
|
|
@@ -413,6 +441,7 @@ declare class RequiredValidationError extends _NgValidationError {
|
|
|
413
441
|
/**
|
|
414
442
|
* An error used to indicate that a value is lower than the minimum allowed.
|
|
415
443
|
*
|
|
444
|
+
* @category validation
|
|
416
445
|
* @experimental 21.0.0
|
|
417
446
|
*/
|
|
418
447
|
declare class MinValidationError extends _NgValidationError {
|
|
@@ -423,6 +452,7 @@ declare class MinValidationError extends _NgValidationError {
|
|
|
423
452
|
/**
|
|
424
453
|
* An error used to indicate that a value is higher than the maximum allowed.
|
|
425
454
|
*
|
|
455
|
+
* @category validation
|
|
426
456
|
* @experimental 21.0.0
|
|
427
457
|
*/
|
|
428
458
|
declare class MaxValidationError extends _NgValidationError {
|
|
@@ -433,6 +463,7 @@ declare class MaxValidationError extends _NgValidationError {
|
|
|
433
463
|
/**
|
|
434
464
|
* An error used to indicate that a value is shorter than the minimum allowed length.
|
|
435
465
|
*
|
|
466
|
+
* @category validation
|
|
436
467
|
* @experimental 21.0.0
|
|
437
468
|
*/
|
|
438
469
|
declare class MinLengthValidationError extends _NgValidationError {
|
|
@@ -443,6 +474,7 @@ declare class MinLengthValidationError extends _NgValidationError {
|
|
|
443
474
|
/**
|
|
444
475
|
* An error used to indicate that a value is longer than the maximum allowed length.
|
|
445
476
|
*
|
|
477
|
+
* @category validation
|
|
446
478
|
* @experimental 21.0.0
|
|
447
479
|
*/
|
|
448
480
|
declare class MaxLengthValidationError extends _NgValidationError {
|
|
@@ -453,6 +485,7 @@ declare class MaxLengthValidationError extends _NgValidationError {
|
|
|
453
485
|
/**
|
|
454
486
|
* An error used to indicate that a value does not match the required pattern.
|
|
455
487
|
*
|
|
488
|
+
* @category validation
|
|
456
489
|
* @experimental 21.0.0
|
|
457
490
|
*/
|
|
458
491
|
declare class PatternValidationError extends _NgValidationError {
|
|
@@ -463,6 +496,7 @@ declare class PatternValidationError extends _NgValidationError {
|
|
|
463
496
|
/**
|
|
464
497
|
* An error used to indicate that a value is not a valid email.
|
|
465
498
|
*
|
|
499
|
+
* @category validation
|
|
466
500
|
* @experimental 21.0.0
|
|
467
501
|
*/
|
|
468
502
|
declare class EmailValidationError extends _NgValidationError {
|
|
@@ -471,6 +505,7 @@ declare class EmailValidationError extends _NgValidationError {
|
|
|
471
505
|
/**
|
|
472
506
|
* An error used to indicate an issue validating against a standard schema.
|
|
473
507
|
*
|
|
508
|
+
* @category validation
|
|
474
509
|
* @experimental 21.0.0
|
|
475
510
|
*/
|
|
476
511
|
declare class StandardSchemaValidationError extends _NgValidationError {
|
|
@@ -500,6 +535,7 @@ declare class StandardSchemaValidationError extends _NgValidationError {
|
|
|
500
535
|
* }
|
|
501
536
|
* ```
|
|
502
537
|
*
|
|
538
|
+
* @category validation
|
|
503
539
|
* @experimental 21.0.0
|
|
504
540
|
*/
|
|
505
541
|
declare const NgValidationError: abstract new () => NgValidationError;
|
|
@@ -559,12 +595,14 @@ type PathKind = PathKind.Root | PathKind.Child | PathKind.Item;
|
|
|
559
595
|
/**
|
|
560
596
|
* A status indicating whether a field is unsubmitted, submitted, or currently submitting.
|
|
561
597
|
*
|
|
598
|
+
* @category types
|
|
562
599
|
* @experimental 21.0.0
|
|
563
600
|
*/
|
|
564
601
|
type SubmittedStatus = 'unsubmitted' | 'submitted' | 'submitting';
|
|
565
602
|
/**
|
|
566
603
|
* A reason for a field's disablement.
|
|
567
604
|
*
|
|
605
|
+
* @category logic
|
|
568
606
|
* @experimental 21.0.0
|
|
569
607
|
*/
|
|
570
608
|
interface DisabledReason {
|
|
@@ -576,6 +614,7 @@ interface DisabledReason {
|
|
|
576
614
|
/**
|
|
577
615
|
* The absence of an error which indicates a successful validation result.
|
|
578
616
|
*
|
|
617
|
+
* @category types
|
|
579
618
|
* @experimental 21.0.0
|
|
580
619
|
*/
|
|
581
620
|
type ValidationSuccess = null | undefined | void;
|
|
@@ -590,6 +629,7 @@ type ValidationSuccess = null | undefined | void;
|
|
|
590
629
|
*
|
|
591
630
|
* @template E the type of error (defaults to {@link ValidationError}).
|
|
592
631
|
*
|
|
632
|
+
* @category types
|
|
593
633
|
* @experimental 21.0.0
|
|
594
634
|
*/
|
|
595
635
|
type FieldValidationResult<E extends ValidationError = ValidationError> = ValidationSuccess | OneOrMany<WithoutField<E>>;
|
|
@@ -604,6 +644,7 @@ type FieldValidationResult<E extends ValidationError = ValidationError> = Valida
|
|
|
604
644
|
*
|
|
605
645
|
* @template E the type of error (defaults to {@link ValidationError}).
|
|
606
646
|
*
|
|
647
|
+
* @category types
|
|
607
648
|
* @experimental 21.0.0
|
|
608
649
|
*/
|
|
609
650
|
type TreeValidationResult<E extends ValidationError = ValidationError> = ValidationSuccess | OneOrMany<WithOptionalField<E>>;
|
|
@@ -617,6 +658,7 @@ type TreeValidationResult<E extends ValidationError = ValidationError> = Validat
|
|
|
617
658
|
*
|
|
618
659
|
* @template E the type of error (defaults to {@link ValidationError}).
|
|
619
660
|
*
|
|
661
|
+
* @category types
|
|
620
662
|
* @experimental 21.0.0
|
|
621
663
|
*/
|
|
622
664
|
type ValidationResult<E extends ValidationError = ValidationError> = ValidationSuccess | OneOrMany<E>;
|
|
@@ -629,6 +671,7 @@ type ValidationResult<E extends ValidationError = ValidationError> = ValidationS
|
|
|
629
671
|
*
|
|
630
672
|
* @template E the type of error (defaults to {@link ValidationError}).
|
|
631
673
|
*
|
|
674
|
+
* @category types
|
|
632
675
|
* @experimental 21.0.0
|
|
633
676
|
*/
|
|
634
677
|
type AsyncValidationResult<E extends ValidationError = ValidationError> = ValidationResult<E> | 'pending';
|
|
@@ -642,6 +685,7 @@ type AsyncValidationResult<E extends ValidationError = ValidationError> = Valida
|
|
|
642
685
|
* @template TValue The type of the data which the field is wrapped around.
|
|
643
686
|
* @template TKey The type of the property key which this field resides under in its parent.
|
|
644
687
|
*
|
|
688
|
+
* @category types
|
|
645
689
|
* @experimental 21.0.0
|
|
646
690
|
*/
|
|
647
691
|
type Field<TValue, TKey extends string | number = string | number> = (() => FieldState<TValue, TKey>) & (TValue extends Array<infer U> ? ReadonlyArrayLike<MaybeField<U, number>> : TValue extends Record<string, any> ? Subfields<TValue> : unknown);
|
|
@@ -680,6 +724,7 @@ type MaybeField<TValue, TKey extends string | number = string | number> = (TValu
|
|
|
680
724
|
* Contains all of the state (e.g. value, statuses, etc.) associated with a `Field`, exposed as
|
|
681
725
|
* signals.
|
|
682
726
|
*
|
|
727
|
+
* @category structure
|
|
683
728
|
* @experimental 21.0.0
|
|
684
729
|
*/
|
|
685
730
|
interface FieldState<TValue, TKey extends string | number = string | number> {
|
|
@@ -811,6 +856,7 @@ interface FieldState<TValue, TKey extends string | number = string | number> {
|
|
|
811
856
|
* @template TValue The type of the data which the form is wrapped around.
|
|
812
857
|
* @template TPathKind The kind of path (root field, child field, or item of an array)
|
|
813
858
|
*
|
|
859
|
+
* @category types
|
|
814
860
|
* @experimental 21.0.0
|
|
815
861
|
*/
|
|
816
862
|
type FieldPath<TValue, TPathKind extends PathKind = PathKind.Root> = {
|
|
@@ -836,6 +882,7 @@ type MaybeFieldPath<TValue, TPathKind extends PathKind = PathKind.Root> = (TValu
|
|
|
836
882
|
*
|
|
837
883
|
* @template TValue The type of data stored in the form that this schema is attached to.
|
|
838
884
|
*
|
|
885
|
+
* @category types
|
|
839
886
|
* @experimental 21.0.0
|
|
840
887
|
*/
|
|
841
888
|
type Schema<in TValue> = {
|
|
@@ -847,6 +894,7 @@ type Schema<in TValue> = {
|
|
|
847
894
|
* @template TValue The type of data stored in the form that this schema function is attached to.
|
|
848
895
|
* @template TPathKind The kind of path this schema function can be bound to.
|
|
849
896
|
*
|
|
897
|
+
* @category types
|
|
850
898
|
* @experimental 21.0.0
|
|
851
899
|
*/
|
|
852
900
|
type SchemaFn<TValue, TPathKind extends PathKind = PathKind.Root> = (p: FieldPath<TValue, TPathKind>) => void;
|
|
@@ -856,6 +904,7 @@ type SchemaFn<TValue, TPathKind extends PathKind = PathKind.Root> = (p: FieldPat
|
|
|
856
904
|
* @template TValue The type of data stored in the form that this schema function is attached to.
|
|
857
905
|
* @template TPathKind The kind of path this schema function can be bound to.
|
|
858
906
|
*
|
|
907
|
+
* @category types
|
|
859
908
|
* @experimental 21.0.0
|
|
860
909
|
*/
|
|
861
910
|
type SchemaOrSchemaFn<TValue, TPathKind extends PathKind = PathKind.Root> = Schema<TValue> | SchemaFn<TValue, TPathKind>;
|
|
@@ -867,6 +916,7 @@ type SchemaOrSchemaFn<TValue, TPathKind extends PathKind = PathKind.Root> = Sche
|
|
|
867
916
|
* @template TReturn The type of the result returned by the logic function.
|
|
868
917
|
* @template TPathKind The kind of path the logic is applied to (root field, child field, or item of an array)
|
|
869
918
|
*
|
|
919
|
+
* @category types
|
|
870
920
|
* @experimental 21.0.0
|
|
871
921
|
*/
|
|
872
922
|
type LogicFn<TValue, TReturn, TPathKind extends PathKind = PathKind.Root> = (ctx: FieldContext<TValue, TPathKind>) => TReturn;
|
|
@@ -877,6 +927,7 @@ type LogicFn<TValue, TReturn, TPathKind extends PathKind = PathKind.Root> = (ctx
|
|
|
877
927
|
* @template TValue The type of value stored in the field being validated
|
|
878
928
|
* @template TPathKind The kind of path being validated (root field, child field, or item of an array)
|
|
879
929
|
*
|
|
930
|
+
* @category validation
|
|
880
931
|
* @experimental 21.0.0
|
|
881
932
|
*/
|
|
882
933
|
type FieldValidator<TValue, TPathKind extends PathKind = PathKind.Root> = LogicFn<TValue, FieldValidationResult, TPathKind>;
|
|
@@ -887,6 +938,7 @@ type FieldValidator<TValue, TPathKind extends PathKind = PathKind.Root> = LogicF
|
|
|
887
938
|
* @template TValue The type of value stored in the field being validated
|
|
888
939
|
* @template TPathKind The kind of path being validated (root field, child field, or item of an array)
|
|
889
940
|
*
|
|
941
|
+
* @category types
|
|
890
942
|
* @experimental 21.0.0
|
|
891
943
|
*/
|
|
892
944
|
type TreeValidator<TValue, TPathKind extends PathKind = PathKind.Root> = LogicFn<TValue, TreeValidationResult, TPathKind>;
|
|
@@ -898,6 +950,7 @@ type TreeValidator<TValue, TPathKind extends PathKind = PathKind.Root> = LogicFn
|
|
|
898
950
|
* @template TValue The type of value stored in the field being validated
|
|
899
951
|
* @template TPathKind The kind of path being validated (root field, child field, or item of an array)
|
|
900
952
|
*
|
|
953
|
+
* @category types
|
|
901
954
|
* @experimental 21.0.0
|
|
902
955
|
*/
|
|
903
956
|
type Validator<TValue, TPathKind extends PathKind = PathKind.Root> = LogicFn<TValue, ValidationResult, TPathKind>;
|
|
@@ -905,6 +958,7 @@ type Validator<TValue, TPathKind extends PathKind = PathKind.Root> = LogicFn<TVa
|
|
|
905
958
|
* Provides access to the state of the current field as well as functions that can be used to look
|
|
906
959
|
* up state of other fields based on a `FieldPath`.
|
|
907
960
|
*
|
|
961
|
+
* @category types
|
|
908
962
|
* @experimental 21.0.0
|
|
909
963
|
*/
|
|
910
964
|
type FieldContext<TValue, TPathKind extends PathKind = PathKind.Root> = TPathKind extends PathKind.Item ? ItemFieldContext<TValue> : TPathKind extends PathKind.Child ? ChildFieldContext<TValue> : RootFieldContext<TValue>;
|
|
@@ -930,6 +984,7 @@ interface RootFieldContext<TValue> {
|
|
|
930
984
|
/**
|
|
931
985
|
* Field context that is available for all fields that are a child of another field.
|
|
932
986
|
*
|
|
987
|
+
* @category structure
|
|
933
988
|
* @experimental 21.0.0
|
|
934
989
|
*/
|
|
935
990
|
interface ChildFieldContext<TValue> extends RootFieldContext<TValue> {
|
|
@@ -972,6 +1027,7 @@ type MapToErrorsFn<TValue, TResult, TPathKind extends PathKind = PathKind.Root>
|
|
|
972
1027
|
* @template TResult The type of result returned by the resource
|
|
973
1028
|
* @template TPathKind The kind of path being validated (a root path, child path, or item of an array)
|
|
974
1029
|
*
|
|
1030
|
+
* @category validation
|
|
975
1031
|
* @experimental 21.0.0
|
|
976
1032
|
*/
|
|
977
1033
|
interface AsyncValidatorOptions<TValue, TParams, TResult, TPathKind extends PathKind = PathKind.Root> {
|
|
@@ -1012,6 +1068,7 @@ interface AsyncValidatorOptions<TValue, TParams, TResult, TPathKind extends Path
|
|
|
1012
1068
|
* @template TResult The type of result returned by the httpResource
|
|
1013
1069
|
* @template TPathKind The kind of path being validated (a root path, child path, or item of an array)
|
|
1014
1070
|
*
|
|
1071
|
+
* @category validation
|
|
1015
1072
|
* @experimental 21.0.0
|
|
1016
1073
|
*/
|
|
1017
1074
|
interface HttpValidatorOptions<TValue, TResult, TPathKind extends PathKind = PathKind.Root> {
|
|
@@ -1051,6 +1108,7 @@ interface HttpValidatorOptions<TValue, TResult, TPathKind extends PathKind = Pat
|
|
|
1051
1108
|
* @template TResult The type of result returned by the resource
|
|
1052
1109
|
* @template TPathKind The kind of path being validated (a root path, child path, or item of an array)
|
|
1053
1110
|
*
|
|
1111
|
+
* @category validation
|
|
1054
1112
|
* @experimental 21.0.0
|
|
1055
1113
|
*/
|
|
1056
1114
|
declare function validateAsync<TValue, TParams, TResult, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, opts: AsyncValidatorOptions<TValue, TParams, TResult, TPathKind>): void;
|
|
@@ -1064,6 +1122,7 @@ declare function validateAsync<TValue, TParams, TResult, TPathKind extends PathK
|
|
|
1064
1122
|
* @template TResult The type of result returned by the httpResource
|
|
1065
1123
|
* @template TPathKind The kind of path being validated (a root path, child path, or item of an array)
|
|
1066
1124
|
*
|
|
1125
|
+
* @category validation
|
|
1067
1126
|
* @experimental 21.0.0
|
|
1068
1127
|
*/
|
|
1069
1128
|
declare function validateHttp<TValue, TResult = unknown, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, opts: HttpValidatorOptions<TValue, TResult, TPathKind>): void;
|
|
@@ -1071,6 +1130,7 @@ declare function validateHttp<TValue, TResult = unknown, TPathKind extends PathK
|
|
|
1071
1130
|
/**
|
|
1072
1131
|
* The base set of properties shared by all form control contracts.
|
|
1073
1132
|
*
|
|
1133
|
+
* @category control
|
|
1074
1134
|
* @experimental 21.0.0
|
|
1075
1135
|
*/
|
|
1076
1136
|
interface FormUiControl {
|
|
@@ -1165,6 +1225,7 @@ interface FormUiControl {
|
|
|
1165
1225
|
*
|
|
1166
1226
|
* @template TValue The type of `Field` that the implementing component can edit.
|
|
1167
1227
|
*
|
|
1228
|
+
* @category control
|
|
1168
1229
|
* @experimental 21.0.0
|
|
1169
1230
|
*/
|
|
1170
1231
|
interface FormValueControl<TValue> extends FormUiControl {
|
|
@@ -1188,6 +1249,7 @@ interface FormValueControl<TValue> extends FormUiControl {
|
|
|
1188
1249
|
* implemented, but if they are will be kept in sync with the field state of the field bound to the
|
|
1189
1250
|
* `Control` directive.
|
|
1190
1251
|
*
|
|
1252
|
+
* @category control
|
|
1191
1253
|
* @experimental 21.0.0
|
|
1192
1254
|
*/
|
|
1193
1255
|
interface FormCheckboxControl extends FormUiControl {
|
|
@@ -1214,6 +1276,7 @@ interface FormCheckboxControl extends FormUiControl {
|
|
|
1214
1276
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
1215
1277
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
1216
1278
|
*
|
|
1279
|
+
* @category logic
|
|
1217
1280
|
* @experimental 21.0.0
|
|
1218
1281
|
*/
|
|
1219
1282
|
declare function disabled<TValue, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, logic?: string | NoInfer<LogicFn<TValue, boolean | string, TPathKind>>): void;
|
|
@@ -1226,6 +1289,7 @@ declare function disabled<TValue, TPathKind extends PathKind = PathKind.Root>(pa
|
|
|
1226
1289
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
1227
1290
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
1228
1291
|
*
|
|
1292
|
+
* @category logic
|
|
1229
1293
|
* @experimental 21.0.0
|
|
1230
1294
|
*/
|
|
1231
1295
|
declare function readonly<TValue, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, logic?: NoInfer<LogicFn<TValue, boolean, TPathKind>>): void;
|
|
@@ -1246,6 +1310,7 @@ declare function readonly<TValue, TPathKind extends PathKind = PathKind.Root>(pa
|
|
|
1246
1310
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
1247
1311
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
1248
1312
|
*
|
|
1313
|
+
* @category logic
|
|
1249
1314
|
* @experimental 21.0.0
|
|
1250
1315
|
*/
|
|
1251
1316
|
declare function hidden<TValue, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, logic: NoInfer<LogicFn<TValue, boolean, TPathKind>>): void;
|
|
@@ -1257,6 +1322,7 @@ declare function hidden<TValue, TPathKind extends PathKind = PathKind.Root>(path
|
|
|
1257
1322
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
1258
1323
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
1259
1324
|
*
|
|
1325
|
+
* @category logic
|
|
1260
1326
|
* @experimental 21.0.0
|
|
1261
1327
|
*/
|
|
1262
1328
|
declare function validate<TValue, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, logic: NoInfer<FieldValidator<TValue, TPathKind>>): void;
|
|
@@ -1269,6 +1335,7 @@ declare function validate<TValue, TPathKind extends PathKind = PathKind.Root>(pa
|
|
|
1269
1335
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
1270
1336
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
1271
1337
|
*
|
|
1338
|
+
* @category logic
|
|
1272
1339
|
* @experimental 21.0.0
|
|
1273
1340
|
*/
|
|
1274
1341
|
declare function validateTree<TValue, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, logic: NoInfer<TreeValidator<TValue, TPathKind>>): void;
|
|
@@ -1282,6 +1349,7 @@ declare function validateTree<TValue, TPathKind extends PathKind = PathKind.Root
|
|
|
1282
1349
|
* @template TPropItem The type of value the property aggregates over.
|
|
1283
1350
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
1284
1351
|
*
|
|
1352
|
+
* @category logic
|
|
1285
1353
|
* @experimental 21.0.0
|
|
1286
1354
|
*/
|
|
1287
1355
|
declare function aggregateProperty<TValue, TPropItem, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, prop: AggregateProperty<any, TPropItem>, logic: NoInfer<LogicFn<TValue, TPropItem, TPathKind>>): void;
|
|
@@ -1293,6 +1361,7 @@ declare function aggregateProperty<TValue, TPropItem, TPathKind extends PathKind
|
|
|
1293
1361
|
* This function is **not** reactive. It is run once when the field is created.
|
|
1294
1362
|
* @returns The newly created property
|
|
1295
1363
|
*
|
|
1364
|
+
* @category logic
|
|
1296
1365
|
* @experimental 21.0.0
|
|
1297
1366
|
*/
|
|
1298
1367
|
declare function property<TValue, TData, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, factory: (ctx: FieldContext<TValue, TPathKind>) => TData): Property<TData>;
|
|
@@ -1305,6 +1374,7 @@ declare function property<TValue, TData, TPathKind extends PathKind = PathKind.R
|
|
|
1305
1374
|
* This function is **not** reactive. It is run once when the field is created.
|
|
1306
1375
|
* @returns The given property
|
|
1307
1376
|
*
|
|
1377
|
+
* @category logic
|
|
1308
1378
|
* @experimental 21.0.0
|
|
1309
1379
|
*/
|
|
1310
1380
|
declare function property<TValue, TData, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, prop: Property<TData>, factory: (ctx: FieldContext<TValue, TPathKind>) => TData): Property<TData>;
|
|
@@ -2176,6 +2246,7 @@ interface FieldAdapter {
|
|
|
2176
2246
|
/**
|
|
2177
2247
|
* Options that may be specified when creating a form.
|
|
2178
2248
|
*
|
|
2249
|
+
* @category structure
|
|
2179
2250
|
* @experimental 21.0.0
|
|
2180
2251
|
*/
|
|
2181
2252
|
interface FormOptions {
|
|
@@ -2214,6 +2285,7 @@ interface FormOptions {
|
|
|
2214
2285
|
* @return A `Field` representing a form around the data model.
|
|
2215
2286
|
* @template TValue The type of the data model.
|
|
2216
2287
|
*
|
|
2288
|
+
* @category structure
|
|
2217
2289
|
* @experimental 21.0.0
|
|
2218
2290
|
*/
|
|
2219
2291
|
declare function form<TValue>(model: WritableSignal<TValue>): Field<TValue>;
|
|
@@ -2259,6 +2331,7 @@ declare function form<TValue>(model: WritableSignal<TValue>): Field<TValue>;
|
|
|
2259
2331
|
* @return A `Field` representing a form around the data model
|
|
2260
2332
|
* @template TValue The type of the data model.
|
|
2261
2333
|
*
|
|
2334
|
+
* @category structure
|
|
2262
2335
|
* @experimental 21.0.0
|
|
2263
2336
|
*/
|
|
2264
2337
|
declare function form<TValue>(model: WritableSignal<TValue>, schemaOrOptions: SchemaOrSchemaFn<TValue> | FormOptions): Field<TValue>;
|
|
@@ -2302,6 +2375,7 @@ declare function form<TValue>(model: WritableSignal<TValue>, schemaOrOptions: Sc
|
|
|
2302
2375
|
* @return A `Field` representing a form around the data model.
|
|
2303
2376
|
* @template TValue The type of the data model.
|
|
2304
2377
|
*
|
|
2378
|
+
* @category structure
|
|
2305
2379
|
* @experimental 21.0.0
|
|
2306
2380
|
*/
|
|
2307
2381
|
declare function form<TValue>(model: WritableSignal<TValue>, schema: SchemaOrSchemaFn<TValue>, options: FormOptions): Field<TValue>;
|
|
@@ -2340,6 +2414,7 @@ declare function form<TValue>(model: WritableSignal<TValue>, schema: SchemaOrSch
|
|
|
2340
2414
|
* element of the array.
|
|
2341
2415
|
* @template TValue The data type of the item field to apply the schema to.
|
|
2342
2416
|
*
|
|
2417
|
+
* @category structure
|
|
2343
2418
|
* @experimental 21.0.0
|
|
2344
2419
|
*/
|
|
2345
2420
|
declare function applyEach<TValue>(path: FieldPath<TValue[]>, schema: NoInfer<SchemaOrSchemaFn<TValue, PathKind.Item>>): void;
|
|
@@ -2361,6 +2436,7 @@ declare function applyEach<TValue>(path: FieldPath<TValue[]>, schema: NoInfer<Sc
|
|
|
2361
2436
|
* @param schema The schema to apply to the property
|
|
2362
2437
|
* @template TValue The data type of the field to apply the schema to.
|
|
2363
2438
|
*
|
|
2439
|
+
* @category structure
|
|
2364
2440
|
* @experimental 21.0.0
|
|
2365
2441
|
*/
|
|
2366
2442
|
declare function apply<TValue>(path: FieldPath<TValue>, schema: NoInfer<SchemaOrSchemaFn<TValue>>): void;
|
|
@@ -2372,6 +2448,7 @@ declare function apply<TValue>(path: FieldPath<TValue>, schema: NoInfer<SchemaOr
|
|
|
2372
2448
|
* @param schema The schema to apply to the field when the `logic` function returns `true`.
|
|
2373
2449
|
* @template TValue The data type of the field to apply the schema to.
|
|
2374
2450
|
*
|
|
2451
|
+
* @category structure
|
|
2375
2452
|
* @experimental 21.0.0
|
|
2376
2453
|
*/
|
|
2377
2454
|
declare function applyWhen<TValue>(path: FieldPath<TValue>, logic: LogicFn<TValue, boolean>, schema: NoInfer<SchemaOrSchemaFn<TValue>>): void;
|
|
@@ -2385,6 +2462,7 @@ declare function applyWhen<TValue>(path: FieldPath<TValue>, logic: LogicFn<TValu
|
|
|
2385
2462
|
* @template TValue The data type of the field to apply the schema to.
|
|
2386
2463
|
* @template TNarrowed The data type of the schema (a narrowed type of TValue).
|
|
2387
2464
|
*
|
|
2465
|
+
* @category structure
|
|
2388
2466
|
* @experimental 21.0.0
|
|
2389
2467
|
*/
|
|
2390
2468
|
declare function applyWhenValue<TValue, TNarrowed extends TValue>(path: FieldPath<TValue>, predicate: (value: TValue) => value is TNarrowed, schema: SchemaOrSchemaFn<TNarrowed>): void;
|
|
@@ -2397,6 +2475,7 @@ declare function applyWhenValue<TValue, TNarrowed extends TValue>(path: FieldPat
|
|
|
2397
2475
|
* @param schema The schema to apply to the field when `predicate` returns `true`.
|
|
2398
2476
|
* @template TValue The data type of the field to apply the schema to.
|
|
2399
2477
|
*
|
|
2478
|
+
* @category structure
|
|
2400
2479
|
* @experimental 21.0.0
|
|
2401
2480
|
*/
|
|
2402
2481
|
declare function applyWhenValue<TValue>(path: FieldPath<TValue>, predicate: (value: TValue) => boolean, schema: NoInfer<SchemaOrSchemaFn<TValue>>): void;
|
|
@@ -2431,6 +2510,7 @@ declare function applyWhenValue<TValue>(path: FieldPath<TValue>, predicate: (val
|
|
|
2431
2510
|
* errors.
|
|
2432
2511
|
* @template TValue The data type of the field being submitted.
|
|
2433
2512
|
*
|
|
2513
|
+
* @category submission
|
|
2434
2514
|
* @experimental 21.0.0
|
|
2435
2515
|
*/
|
|
2436
2516
|
declare function submit<TValue>(form: Field<TValue>, action: (form: Field<TValue>) => Promise<TreeValidationResult>): Promise<void>;
|
|
@@ -2440,6 +2520,7 @@ declare function submit<TValue>(form: Field<TValue>, action: (form: Field<TValue
|
|
|
2440
2520
|
* @returns A schema object that implements the given logic.
|
|
2441
2521
|
* @template TValue The value type of a `Field` that this schema binds to.
|
|
2442
2522
|
*
|
|
2523
|
+
* @category structure
|
|
2443
2524
|
* @experimental 21.0.0
|
|
2444
2525
|
*/
|
|
2445
2526
|
declare function schema<TValue>(fn: SchemaFn<TValue>): Schema<TValue>;
|
|
@@ -2474,6 +2555,7 @@ type BaseValidatorConfig<TValue, TPathKind extends PathKind = PathKind.Root> = {
|
|
|
2474
2555
|
* or a function that receives the `FieldContext` and returns custom validation error(s).
|
|
2475
2556
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2476
2557
|
*
|
|
2558
|
+
* @category validation
|
|
2477
2559
|
* @experimental 21.0.0
|
|
2478
2560
|
*/
|
|
2479
2561
|
declare function email<TPathKind extends PathKind = PathKind.Root>(path: FieldPath<string, TPathKind>, config?: BaseValidatorConfig<string, TPathKind>): void;
|
|
@@ -2491,6 +2573,7 @@ declare function email<TPathKind extends PathKind = PathKind.Root>(path: FieldPa
|
|
|
2491
2573
|
* or a function that receives the `FieldContext` and returns custom validation error(s).
|
|
2492
2574
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2493
2575
|
*
|
|
2576
|
+
* @category validation
|
|
2494
2577
|
* @experimental 21.0.0
|
|
2495
2578
|
*/
|
|
2496
2579
|
declare function max<TPathKind extends PathKind = PathKind.Root>(path: FieldPath<number, TPathKind>, maxValue: number | LogicFn<number, number | undefined, TPathKind>, config?: BaseValidatorConfig<number, TPathKind>): void;
|
|
@@ -2509,6 +2592,7 @@ declare function max<TPathKind extends PathKind = PathKind.Root>(path: FieldPath
|
|
|
2509
2592
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
2510
2593
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2511
2594
|
*
|
|
2595
|
+
* @category validation
|
|
2512
2596
|
* @experimental 21.0.0
|
|
2513
2597
|
*/
|
|
2514
2598
|
declare function maxLength<TValue extends ValueWithLengthOrSize, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, maxLength: number | LogicFn<TValue, number | undefined, TPathKind>, config?: BaseValidatorConfig<TValue, TPathKind>): void;
|
|
@@ -2526,6 +2610,7 @@ declare function maxLength<TValue extends ValueWithLengthOrSize, TPathKind exten
|
|
|
2526
2610
|
* or a function that receives the `FieldContext` and returns custom validation error(s).
|
|
2527
2611
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2528
2612
|
*
|
|
2613
|
+
* @category validation
|
|
2529
2614
|
* @experimental 21.0.0
|
|
2530
2615
|
*/
|
|
2531
2616
|
declare function min<TPathKind extends PathKind = PathKind.Root>(path: FieldPath<number, TPathKind>, minValue: number | LogicFn<number, number | undefined, TPathKind>, config?: BaseValidatorConfig<number, TPathKind>): void;
|
|
@@ -2544,6 +2629,7 @@ declare function min<TPathKind extends PathKind = PathKind.Root>(path: FieldPath
|
|
|
2544
2629
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
2545
2630
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2546
2631
|
*
|
|
2632
|
+
* @category validation
|
|
2547
2633
|
* @experimental 21.0.0
|
|
2548
2634
|
*/
|
|
2549
2635
|
declare function minLength<TValue extends ValueWithLengthOrSize, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, minLength: number | LogicFn<TValue, number | undefined, TPathKind>, config?: BaseValidatorConfig<TValue, TPathKind>): void;
|
|
@@ -2560,6 +2646,7 @@ declare function minLength<TValue extends ValueWithLengthOrSize, TPathKind exten
|
|
|
2560
2646
|
* or a function that receives the `FieldContext` and returns custom validation error(s).
|
|
2561
2647
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2562
2648
|
*
|
|
2649
|
+
* @category validation
|
|
2563
2650
|
* @experimental 21.0.0
|
|
2564
2651
|
*/
|
|
2565
2652
|
declare function pattern<TPathKind extends PathKind = PathKind.Root>(path: FieldPath<string, TPathKind>, pattern: RegExp | LogicFn<string | undefined, RegExp | undefined, TPathKind>, config?: BaseValidatorConfig<string, TPathKind>): void;
|
|
@@ -2578,6 +2665,7 @@ declare function pattern<TPathKind extends PathKind = PathKind.Root>(path: Field
|
|
|
2578
2665
|
* @template TValue The type of value stored in the field the logic is bound to.
|
|
2579
2666
|
* @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
|
|
2580
2667
|
*
|
|
2668
|
+
* @category validation
|
|
2581
2669
|
* @experimental 21.0.0
|
|
2582
2670
|
*/
|
|
2583
2671
|
declare function required<TValue, TPathKind extends PathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, config?: BaseValidatorConfig<TValue, TPathKind> & {
|
|
@@ -2613,6 +2701,7 @@ type IgnoreUnknownProperties<T> = T extends Record<PropertyKey, unknown> ? {
|
|
|
2613
2701
|
* or a partial of it.
|
|
2614
2702
|
* @template TValue The type of value stored in the field being validated.
|
|
2615
2703
|
*
|
|
2704
|
+
* @category validation
|
|
2616
2705
|
* @experimental 21.0.0
|
|
2617
2706
|
*/
|
|
2618
2707
|
declare function validateStandardSchema<TSchema, TValue extends IgnoreUnknownProperties<TSchema>>(path: FieldPath<TValue>, schema: StandardSchemaV1<TSchema>): void;
|