1/* 2 * Copyright (c) 2022-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/** 18 * Defines the option in length unit of grid-row component. 19 * @form 20 * @since 9 21 */ 22declare interface GridRowSizeOption { 23 /** 24 * Grid Row Size Option xs 25 * @form 26 * @since 9 27 */ 28 xs?: Length, 29 30 /** 31 * Grid Row Size Option sm 32 * @form 33 * @since 9 34 */ 35 sm?: Length, 36 37 /** 38 * Grid Row Size Option md 39 * @form 40 * @since 9 41 */ 42 md?: Length, 43 44 /** 45 * Grid Row Size Option lg 46 * @form 47 * @since 9 48 */ 49 lg?: Length, 50 51 /** 52 * Grid Row Size Option xl 53 * @form 54 * @since 9 55 */ 56 xl?: Length, 57 58 /** 59 * Grid Row Size Option xxl 60 * @form 61 * @since 9 62 */ 63 xxl?: Length, 64} 65 66/** 67 * Defines the option in number unit of grid-container component. 68 * @form 69 * @since 9 70 */ 71declare interface GridRowColumnOption { 72 /** 73 * Grid Row Column Option xs 74 * @form 75 * @since 9 76 */ 77 xs?: number, 78 79 /** 80 * Grid Row Column Option sm 81 * @form 82 * @since 9 83 */ 84 sm?: number, 85 86 /** 87 * Grid Row Column Option md 88 * @form 89 * @since 9 90 */ 91 md?: number, 92 93 /** 94 * Grid Row Column Option lg 95 * @form 96 * @since 9 97 */ 98 lg?: number, 99 100 /** 101 * Grid Row Column Option xl 102 * @form 103 * @since 9 104 */ 105 xl?: number, 106 107 /** 108 * Grid Row Column Option xxl 109 * @form 110 * @since 9 111 */ 112 xxl?: number, 113} 114 115/** 116 * Defines the gutter of grid-row component. 117 * @form 118 * @since 9 119 */ 120declare interface GutterOption { 121 /** 122 * Define x in GutterOption 123 * @form 124 * @since 9 125 */ 126 x?: Length | GridRowSizeOption, 127 128 /** 129 * Define y in GutterOption 130 * @form 131 * @since 9 132 */ 133 y?: Length | GridRowSizeOption 134} 135 136/** 137 * Defines the breakpoint reference of grid-container component. 138 * @form 139 * @since 9 140 */ 141declare enum BreakpointsReference { 142 /** 143 * Respond to breakpoint changes according to window width 144 * @form 145 * @since 9 146 */ 147 WindowSize, 148 149 /** 150 * Respond to breakpoint changes according to component width 151 * @form 152 * @since 9 153 */ 154 ComponentSize, 155} 156 157/** 158 * Defines the direction of grid-container component. 159 * @form 160 * @since 9 161 */ 162declare enum GridRowDirection { 163 /** 164 * The elements in the grid component are arranged in rows 165 * @form 166 * @since 9 167 */ 168 Row, 169 170 /** 171 * The elements in the grid component are arranged in reverse order of rows 172 * @form 173 * @since 9 174 */ 175 RowReverse, 176} 177 178/** 179 * Defines the breakpoints of grid-row component. 180 * @form 181 * @since 9 182 */ 183declare interface BreakPoints { 184 /** 185 * Breakpoint array 186 * @form 187 * @since 9 188 */ 189 value?: Array<string>, 190 191 /** 192 * Set breakpoint reference 193 * @form 194 * @since 9 195 */ 196 reference?: BreakpointsReference, 197} 198 199/** 200 * Defines the options of grid-row component. 201 * @form 202 * @since 9 203 */ 204declare interface GridRowOptions { 205 /** 206 * layout spacing between sub-components 207 * @form 208 * @since 9 209 */ 210 gutter?: Length | GutterOption; 211 212 /** 213 * Sets the total number of columns in the current layout. 214 * @form 215 * @since 9 216 */ 217 columns?: number | GridRowColumnOption; 218 219 /** 220 * grid-row layout breakpoints. 221 * @form 222 * @since 9 223 */ 224 breakpoints?: BreakPoints; 225 226 /** 227 * grid-row layout direction. 228 * @form 229 * @since 9 230 */ 231 direction?: GridRowDirection; 232} 233 234/** 235 * Defines the the new version of grid-container component. 236 * @form 237 * @since 9 238 */ 239interface GridRowInterface { 240 /** 241 * Defines the constructor of GridRow. 242 * @form 243 * @since 9 244 */ 245 (option?: GridRowOptions): GridRowAttribute; 246} 247 248declare class GridRowAttribute extends CommonMethod<GridRowAttribute> { 249 /** 250 * Callback triggered when the breakpoint changes 251 * @form 252 * @since 9 253 */ 254 onBreakpointChange(callback: (breakpoints: string) => void): GridRowAttribute; 255} 256 257/** 258 * Defines GridRow Component. 259 * @form 260 * @since 9 261 */ 262declare const GridRow: GridRowInterface; 263 264/** 265 * Defines GridRow Component instance. 266 * @form 267 * @since 9 268 */ 269declare const GridRowInstance: GridRowAttribute;