1/* 2 * Copyright (c) 2021-2023 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 * CheckboxGroup SelectStatus 18 * @since 8 19 */ 20/** 21 * CheckboxGroup SelectStatus 22 * @form 23 * @since 9 24 */ 25declare enum SelectStatus { 26 /** 27 * All checkboxes are selected. 28 * @since 8 29 */ 30 /** 31 * All checkboxes are selected. 32 * @form 33 * @since 9 34 */ 35 All, 36 /** 37 * Part of the checkbox is selected. 38 * @since 8 39 */ 40 /** 41 * Part of the checkbox is selected. 42 * @form 43 * @since 9 44 */ 45 Part, 46 /** 47 * None of the checkbox is selected. 48 * @since 8 49 */ 50 /** 51 * None of the checkbox is selected. 52 * @form 53 * @since 9 54 */ 55 None, 56} 57 58/** 59 * Defines the options of CheckboxGroup. 60 * @since 8 61 */ 62/** 63 * Defines the options of CheckboxGroup. 64 * @form 65 * @since 9 66 */ 67declare interface CheckboxGroupOptions { 68 /** 69 * Setting the group of CheckboxGroup. 70 * @since 8 71 */ 72 /** 73 * Setting the group of CheckboxGroup. 74 * @form 75 * @since 9 76 */ 77 group?: string; 78} 79 80/** 81 * Defines the options of CheckboxGroupResult. 82 * @since 8 83 */ 84/** 85 * Defines the options of CheckboxGroupResult. 86 * @form 87 * @since 9 88 */ 89declare interface CheckboxGroupResult { 90 /** 91 * Checkbox name. 92 * @since 8 93 */ 94 /** 95 * Checkbox name. 96 * @form 97 * @since 9 98 */ 99 name: Array<string>; 100 /** 101 * Set the group of status. 102 * @since 8 103 */ 104 /** 105 * Set the group of status. 106 * @form 107 * @since 9 108 */ 109 status: SelectStatus; 110} 111 112/** 113 * Provides an interface for the CheckboxGroup component. 114 * @since 8 115 */ 116/** 117 * Provides an interface for the CheckboxGroup component. 118 * @form 119 * @since 9 120 */ 121interface CheckboxGroupInterface { 122 /** 123 * Called when the CheckboxGroup component is used. 124 * @since 8 125 */ 126 /** 127 * Called when the CheckboxGroup component is used. 128 * @form 129 * @since 9 130 */ 131 (options?: CheckboxGroupOptions): CheckboxGroupAttribute; 132} 133 134/** 135 * Defines the attribute functions of CheckboxGroup. 136 * @since 8 137 */ 138/** 139 * Defines the attribute functions of CheckboxGroup. 140 * @form 141 * @since 9 142 */ 143declare class CheckboxGroupAttribute extends CommonMethod<CheckboxGroupAttribute> { 144 /** 145 * setting whether all checkbox is selected. 146 * @since 8 147 */ 148 /** 149 * setting whether all checkbox is selected. 150 * @form 151 * @since 9 152 */ 153 selectAll(value: boolean): CheckboxGroupAttribute; 154 155 /** 156 * setting the display color of checkbox. 157 * @since 8 158 */ 159 /** 160 * setting the display color of checkbox. 161 * @form 162 * @since 9 163 */ 164 selectedColor(value: ResourceColor): CheckboxGroupAttribute; 165 166 /** 167 * Called when the selection status changes. 168 * @since 8 169 */ 170 /** 171 * Called when the selection status changes. 172 * @form 173 * @since 9 174 */ 175 onChange(callback: (event: CheckboxGroupResult) => void): CheckboxGroupAttribute; 176} 177 178/** 179 * Defines CheckboxGroup Component. 180 * @since 8 181 */ 182/** 183 * Defines CheckboxGroup Component. 184 * @form 185 * @since 9 186 */ 187declare const CheckboxGroup: CheckboxGroupInterface; 188 189/** 190 * Defines CheckboxGroup Component instance. 191 * @since 8 192 */ 193/** 194 * Defines CheckboxGroup Component instance. 195 * @form 196 * @since 9 197 */ 198declare const CheckboxGroupInstance: CheckboxGroupAttribute; 199