Skip to content

Commit 2707012

Browse files
trotylalxhub
authored andcommitted
fix(forms): publish missing types (#19941)
PR Close #19941
1 parent 4d62be6 commit 2707012

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

packages/forms/src/forms.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export {NgSelectOption, SelectControlValueAccessor} from './directives/select_co
4040
export {SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor';
4141
export {AsyncValidator, AsyncValidatorFn, CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValidator, ValidationErrors, Validator, ValidatorFn} from './directives/validators';
4242
export {FormBuilder} from './form_builder';
43-
export {AbstractControl, FormArray, FormControl, FormGroup} from './model';
43+
export {AbstractControl, AbstractControlOptions, FormArray, FormControl, FormGroup} from './model';
4444
export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './validators';
4545
export {VERSION} from './version';
4646

packages/forms/src/model.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,24 @@ function coerceToAsyncValidator(
8080

8181
export type FormHooks = 'change' | 'blur' | 'submit';
8282

83+
/**
84+
* @whatItDoes Interface for options provided to an {@link AbstractControl}.
85+
*
86+
* @experimental
87+
*/
8388
export interface AbstractControlOptions {
89+
/**
90+
* List of validators applied to control.
91+
*/
8492
validators?: ValidatorFn|ValidatorFn[]|null;
93+
/**
94+
* List of async validators applied to control.
95+
*/
8596
asyncValidators?: AsyncValidatorFn|AsyncValidatorFn[]|null;
86-
updateOn?: FormHooks;
97+
/**
98+
* The event name for control to update upon.
99+
*/
100+
updateOn?: 'change'|'blur'|'submit';
87101
}
88102

89103

tools/public_api_guard/forms/forms.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export declare abstract class AbstractControlDirective {
8686
reset(value?: any): void;
8787
}
8888

89+
/** @experimental */
90+
export interface AbstractControlOptions {
91+
asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null;
92+
updateOn?: 'change' | 'blur' | 'submit';
93+
validators?: ValidatorFn | ValidatorFn[] | null;
94+
}
95+
8996
/** @stable */
9097
export declare class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy {
9198
readonly asyncValidator: AsyncValidatorFn | null;

0 commit comments

Comments
 (0)