1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * Input parameter for creating a radio box. 18 * @since 8 19 */ 20declare interface RadioOptions { 21 /** 22 * Radio group name. 23 * @since 8 24 */ 25 group: string; 26 27 /** 28 * Radio name. 29 * @since 8 30 */ 31 value: string; 32} 33 34/** 35 * Provides an interface for creating a radio box. 36 * @since 8 37 */ 38interface RadioInterface { 39 /** 40 * Called when a radio box is created. 41 * @since 8 42 */ 43 (options: RadioOptions): RadioAttribute; 44} 45 46/** 47 * @since 8 48 */ 49declare class RadioAttribute extends CommonMethod<RadioAttribute> { 50 /** 51 * Called when the radio box is selected. 52 * @since 8 53 */ 54 checked(value: boolean): RadioAttribute; 55 56 /** 57 * Called when the radio box selection status changes. 58 * @since 8 59 */ 60 onChange(callback: (isChecked: boolean) => void): RadioAttribute; 61} 62 63declare const Radio: RadioInterface; 64declare const RadioInstance: RadioAttribute; 65