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 * Defines the options of Checkbox. 18 * @since 8 19 */ 20declare interface CheckboxOptions { 21 /** 22 * Current name of Checkbox. 23 * @since 8 24 */ 25 name?: string; 26 27 /** 28 * Sets the group of Checkbox. 29 * @since 8 30 */ 31 group?: string; 32} 33 34/** 35 * Provides an interface for the Checkbox component. 36 * @since 8 37 */ 38interface CheckboxInterface { 39 /** 40 * Construct the Checkbox component. 41 * Called when the Checkbox component is used. 42 * @since 8 43 */ 44 (options?: CheckboxOptions): CheckboxAttribute; 45} 46 47/** 48 * Defines the attribute functions of Checkbox. 49 * @since 8 50 */ 51declare class CheckboxAttribute extends CommonMethod<CheckboxAttribute> { 52 /** 53 * setting whether checkbox is selected. 54 * @since 8 55 */ 56 select(value: boolean): CheckboxAttribute; 57 58 /** 59 * setting the display color of checkbox. 60 * @since 8 61 */ 62 selectedColor(value: ResourceColor): CheckboxAttribute; 63 64 /** 65 * Called when the selection status changes. 66 * @since 8 67 */ 68 onChange(callback: (value: boolean) => void): CheckboxAttribute; 69} 70 71declare const Checkbox: CheckboxInterface; 72declare const CheckboxInstance: CheckboxAttribute; 73