fix(forms): publish missing types (#19941)

PR Close #19941
This commit is contained in:
Trotyl 2018-02-01 11:25:14 +08:00 committed by Alex Rickabaugh
parent 4d62be69c5
commit 2707012181
3 changed files with 23 additions and 2 deletions

View File

@ -40,7 +40,7 @@ export {NgSelectOption, SelectControlValueAccessor} from './directives/select_co
export {SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor';
export {AsyncValidator, AsyncValidatorFn, CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValidator, ValidationErrors, Validator, ValidatorFn} from './directives/validators';
export {FormBuilder} from './form_builder';
export {AbstractControl, FormArray, FormControl, FormGroup} from './model';
export {AbstractControl, AbstractControlOptions, FormArray, FormControl, FormGroup} from './model';
export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './validators';
export {VERSION} from './version';

View File

@ -80,10 +80,24 @@ function coerceToAsyncValidator(
export type FormHooks = 'change' | 'blur' | 'submit';
/**
* @whatItDoes Interface for options provided to an {@link AbstractControl}.
*
* @experimental
*/
export interface AbstractControlOptions {
/**
* List of validators applied to control.
*/
validators?: ValidatorFn|ValidatorFn[]|null;
/**
* List of async validators applied to control.
*/
asyncValidators?: AsyncValidatorFn|AsyncValidatorFn[]|null;
updateOn?: FormHooks;
/**
* The event name for control to update upon.
*/
updateOn?: 'change'|'blur'|'submit';
}

View File

@ -86,6 +86,13 @@ export declare abstract class AbstractControlDirective {
reset(value?: any): void;
}
/** @experimental */
export interface AbstractControlOptions {
asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null;
updateOn?: 'change' | 'blur' | 'submit';
validators?: ValidatorFn | ValidatorFn[] | null;
}
/** @stable */
export declare class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy {
readonly asyncValidator: AsyncValidatorFn | null;