/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ElementRef, Injector, QueryList, Renderer2 } from '@angular/core'; import { BuiltInControlValueAccessor, ControlValueAccessor } from './control_value_accessor'; import { NgControl } from './ng_control'; import * as i0 from "@angular/core"; export declare const RADIO_GROUP_VALUE_ACCESSOR: any; /** * Internal-only NgModule that works as a host for the `RadioControlRegistry` tree-shakable * provider. Note: the `InternalFormsSharedModule` can not be used here directly, since it's * declared *after* the `RadioControlRegistry` class and the `providedIn` doesn't support * `forwardRef` logic. */ export declare class RadioControlRegistryModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @description * Class used by Angular to track radio buttons. For internal use only. */ export declare class RadioControlRegistry { private _accessors; /** * @description * Adds a control to the internal registry. For internal use only. */ add(control: NgControl, accessor: RadioControl): void; /** * @description * Removes a control from the internal registry. For internal use only. */ remove(accessor: RadioControl): void; /** * @description * Selects a radio button. For internal use only. */ select(accessor: RadioControl): void; private _isSameGroup; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class RadioGroupValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { children: QueryList; valueChange(value: string): void; writeValue(value: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * @description * The `ControlValueAccessor` for writing radio control values and listening to radio control * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @usageNotes * * ### Using radio buttons with reactive form directives * * The follow example shows how to use radio buttons in a reactive form. When using radio buttons in * a reactive form, radio buttons in the same group should have the same `formControlName`. * Providing a `name` attribute is optional. * * {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'} * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi * todo 写入值可以从这里来,读取的话就需要从上一级,需要处理本组件与group的关系 */ export declare class RadioControl { private renderer; private elementRef; private _registry; private _injector; /** * @description * Tracks the value of the radio input element */ readonly value: string | undefined; checked: boolean | undefined; constructor(renderer: Renderer2, elementRef: ElementRef, _registry: RadioControlRegistry, _injector: Injector); updateChecked(value: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare const RadioGroupValueAccessor_Listeners:["bindchange"]; declare const RadioGroupValueAccessor_Properties:[]; declare const RadioControl_Listeners:[]; declare const RadioControl_Properties:["value","checked"];