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 * @file 18 * @kit ArkUI 19 */ 20 21/*** if arkts 1.2 */ 22import { LengthMetrics } from '../Graphics'; 23import { PointLightStyle, CommonMethod } from './common'; 24import { FlexWrap, FlexDirection, ItemAlign, FlexAlign } from './enums'; 25/*** endif */ 26 27/** 28 * Defines the options of Flex. 29 * 30 * @interface FlexOptions 31 * @syscap SystemCapability.ArkUI.ArkUI.Full 32 * @since 7 33 */ 34/** 35 * Defines the options of Flex. 36 * 37 * @interface FlexOptions 38 * @syscap SystemCapability.ArkUI.ArkUI.Full 39 * @form 40 * @since 9 41 */ 42/** 43 * Defines the options of Flex. 44 * 45 * @interface FlexOptions 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @crossplatform 48 * @form 49 * @since 10 50 */ 51/** 52 * Describes the layout and alignment of child components within the Flex component. 53 * 54 * @interface FlexOptions 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @crossplatform 57 * @form 58 * @atomicservice 59 * @since arkts {'1.1':'11','1.2':'20'} 60 * @arkts 1.1&1.2 61 */ 62declare interface FlexOptions { 63 /** 64 * Sets the horizontal layout of elements. 65 * 66 * @type { ?FlexDirection } 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @since 7 69 */ 70 /** 71 * Sets the horizontal layout of elements. 72 * 73 * @type { ?FlexDirection } 74 * @syscap SystemCapability.ArkUI.ArkUI.Full 75 * @form 76 * @since 9 77 */ 78 /** 79 * Sets the horizontal layout of elements. 80 * 81 * @type { ?FlexDirection } 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @crossplatform 84 * @form 85 * @since 10 86 */ 87 /** 88 * Direction in which child components are arranged in the Flex component. 89 * 90 * @type { ?FlexDirection } 91 * @default FlexDirection.Row 92 * @syscap SystemCapability.ArkUI.ArkUI.Full 93 * @crossplatform 94 * @form 95 * @atomicservice 96 * @since arkts {'1.1':'11','1.2':'20'} 97 * @arkts 1.1&1.2 98 */ 99 direction?: FlexDirection; 100 101 /** 102 * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. 103 * 104 * @type { ?FlexWrap } 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 7 107 */ 108 /** 109 * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. 110 * 111 * @type { ?FlexWrap } 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @form 114 * @since 9 115 */ 116 /** 117 * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. 118 * 119 * @type { ?FlexWrap } 120 * @syscap SystemCapability.ArkUI.ArkUI.Full 121 * @crossplatform 122 * @form 123 * @since 10 124 */ 125 /** 126 * Whether the Flex component has a single line or multiple lines. 127 * 128 * @type { ?FlexWrap } 129 * @default FlexWrap.NoWrap 130 * @syscap SystemCapability.ArkUI.ArkUI.Full 131 * @crossplatform 132 * @form 133 * @atomicservice 134 * @since arkts {'1.1':'11','1.2':'20'} 135 * @arkts 1.1&1.2 136 */ 137 wrap?: FlexWrap; 138 139 /** 140 * The alignment format of the subassembly on the Flex container spindle. 141 * 142 * @type { ?FlexAlign } 143 * @syscap SystemCapability.ArkUI.ArkUI.Full 144 * @since 7 145 */ 146 /** 147 * The alignment format of the subassembly on the Flex container spindle. 148 * 149 * @type { ?FlexAlign } 150 * @syscap SystemCapability.ArkUI.ArkUI.Full 151 * @form 152 * @since 9 153 */ 154 /** 155 * The alignment format of the subassembly on the Flex container spindle. 156 * 157 * @type { ?FlexAlign } 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @crossplatform 160 * @form 161 * @since 10 162 */ 163 /** 164 * Alignment mode of the child components in the Flex component along the main axis. 165 * 166 * @type { ?FlexAlign } 167 * @default FlexAlign.Start 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @form 171 * @atomicservice 172 * @since arkts {'1.1':'11','1.2':'20'} 173 * @arkts 1.1&1.2 174 */ 175 justifyContent?: FlexAlign; 176 177 /** 178 * Alignment Format for Subassembly on Flex Container Cross Axis. 179 * 180 * @type { ?ItemAlign } 181 * @syscap SystemCapability.ArkUI.ArkUI.Full 182 * @since 7 183 */ 184 /** 185 * Alignment Format for Subassembly on Flex Container Cross Axis. 186 * 187 * @type { ?ItemAlign } 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @form 190 * @since 9 191 */ 192 /** 193 * Alignment Format for Subassembly on Flex Container Cross Axis. 194 * 195 * @type { ?ItemAlign } 196 * @syscap SystemCapability.ArkUI.ArkUI.Full 197 * @crossplatform 198 * @form 199 * @since 10 200 */ 201 /** 202 * Alignment mode of the child components in the Flex component along the cross axis. 203 * 204 * @type { ?ItemAlign } 205 * @default ItemAlign.Start 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @form 209 * @atomicservice 210 * @since arkts {'1.1':'11','1.2':'20'} 211 * @arkts 1.1&1.2 212 */ 213 alignItems?: ItemAlign; 214 215 /** 216 * The alignment of multiple lines of content when there is extra space in the cross axis. 217 * 218 * @type { ?FlexAlign } 219 * @syscap SystemCapability.ArkUI.ArkUI.Full 220 * @since 7 221 */ 222 /** 223 * The alignment of multiple lines of content when there is extra space in the cross axis. 224 * 225 * @type { ?FlexAlign } 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @form 228 * @since 9 229 */ 230 /** 231 * The alignment of multiple lines of content when there is extra space in the cross axis. 232 * 233 * @type { ?FlexAlign } 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @crossplatform 236 * @form 237 * @since 10 238 */ 239 /** 240 * Alignment mode of the child components in a multi-row Flex component along the cross axis. 241 * This parameter is valid only when wrap is set to Wrap or WrapReverse. 242 * 243 * @type { ?FlexAlign } 244 * @default FlexAlign.Start 245 * @syscap SystemCapability.ArkUI.ArkUI.Full 246 * @crossplatform 247 * @form 248 * @atomicservice 249 * @since arkts {'1.1':'11','1.2':'20'} 250 * @arkts 1.1&1.2 251 */ 252 alignContent?: FlexAlign; 253 254 /** 255 * Spacing between child components along the main axis or cross axis of the Flex component. 256 * 257 * @type { ?FlexSpaceOptions } 258 * @default {main: LengthMetrics.px(0), cross: LengthMetrics.px(0)} 259 * @syscap SystemCapability.ArkUI.ArkUI.Full 260 * @crossplatform 261 * @atomicservice 262 * @since arkts {'1.1':'12','1.2':'20'} 263 * @arkts 1.1&1.2 264 */ 265 space?: FlexSpaceOptions; 266} 267 268/** 269 * Defines the spacing between child components along the main axis or cross axis of the Flex component. 270 * 271 * @interface FlexSpaceOptions 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @crossplatform 274 * @atomicservice 275 * @since arkts {'1.1':'12','1.2':'20'} 276 * @arkts 1.1&1.2 277 */ 278 279declare interface FlexSpaceOptions { 280 /** 281 * Space on the main axis of the Flex component. 282 * 283 * @type { ?LengthMetrics } 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @crossplatform 286 * @atomicservice 287 * @since arkts {'1.1':'12','1.2':'20'} 288 * @arkts 1.1&1.2 289 */ 290 main?: LengthMetrics; 291 292 /** 293 * Space on the cross axis of the Flex component. 294 * 295 * @type { ?LengthMetrics } 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @crossplatform 298 * @atomicservice 299 * @since arkts {'1.1':'12','1.2':'20'} 300 * @arkts 1.1&1.2 301 */ 302 cross?: LengthMetrics; 303} 304 305/** 306 * Provides a monthly view component to display information such as date, shift break, and schedule. 307 * 308 * @interface FlexInterface 309 * @syscap SystemCapability.ArkUI.ArkUI.Full 310 * @since 7 311 */ 312/** 313 * Provides a monthly view component to display information such as date, shift break, and schedule. 314 * 315 * @interface FlexInterface 316 * @syscap SystemCapability.ArkUI.ArkUI.Full 317 * @form 318 * @since 9 319 */ 320/** 321 * Provides a monthly view component to display information such as date, shift break, and schedule. 322 * 323 * @interface FlexInterface 324 * @syscap SystemCapability.ArkUI.ArkUI.Full 325 * @crossplatform 326 * @form 327 * @since 10 328 */ 329/** 330 * Provides a monthly view component to display information such as date, shift break, and schedule. 331 * 332 * @interface FlexInterface 333 * @syscap SystemCapability.ArkUI.ArkUI.Full 334 * @crossplatform 335 * @form 336 * @atomicservice 337 * @since arkts {'1.1':'11','1.2':'20'} 338 * @arkts 1.1&1.2 339 */ 340interface FlexInterface { 341 /** 342 * Defines the constructor of Flex. 343 * 344 * @param { FlexOptions } value 345 * @returns { FlexAttribute } 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @since 7 348 */ 349 /** 350 * Defines the constructor of Flex. 351 * 352 * @param { FlexOptions } value 353 * @returns { FlexAttribute } 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @form 356 * @since 9 357 */ 358 /** 359 * Defines the constructor of Flex. 360 * 361 * @param { FlexOptions } value 362 * @returns { FlexAttribute } 363 * @syscap SystemCapability.ArkUI.ArkUI.Full 364 * @crossplatform 365 * @form 366 * @since 10 367 */ 368 /** 369 * Defines the constructor of Flex. 370 * 371 * @param { FlexOptions } value 372 * @returns { FlexAttribute } 373 * @syscap SystemCapability.ArkUI.ArkUI.Full 374 * @crossplatform 375 * @form 376 * @atomicservice 377 * @since arkts {'1.1':'11','1.2':'20'} 378 * @arkts 1.1&1.2 379 */ 380 (value?: FlexOptions): FlexAttribute; 381} 382 383/** 384 * Defines the Flex attribute functions. 385 * 386 * @extends CommonMethod<FlexAttribute> 387 * @syscap SystemCapability.ArkUI.ArkUI.Full 388 * @since 7 389 */ 390/** 391 * Defines the Flex attribute functions. 392 * 393 * @extends CommonMethod<FlexAttribute> 394 * @syscap SystemCapability.ArkUI.ArkUI.Full 395 * @form 396 * @since 9 397 */ 398/** 399 * Defines the Flex attribute functions. 400 * 401 * @extends CommonMethod<FlexAttribute> 402 * @syscap SystemCapability.ArkUI.ArkUI.Full 403 * @crossplatform 404 * @form 405 * @since 10 406 */ 407/** 408 * Defines the Flex attribute functions. 409 * 410 * @extends CommonMethod<FlexAttribute> 411 * @syscap SystemCapability.ArkUI.ArkUI.Full 412 * @crossplatform 413 * @form 414 * @atomicservice 415 * @since arkts {'1.1':'11','1.2':'20'} 416 * @arkts 1.1&1.2 417 */ 418declare class FlexAttribute extends CommonMethod<FlexAttribute> { 419 /** 420 * Defines the PointLight 421 * 422 * @param { PointLightStyle } value - The point light style. 423 * @returns { FlexAttribute } The attribute of the flex. 424 * @syscap SystemCapability.ArkUI.ArkUI.Full 425 * @systemapi 426 * @since arkts {'1.1':'11','1.2':'20'} 427 * @arkts 1.1&1.2 428 */ 429 pointLight(value: PointLightStyle): FlexAttribute; 430} 431 432/** 433 * Defines Flex Component. 434 * 435 * @syscap SystemCapability.ArkUI.ArkUI.Full 436 * @since 7 437 */ 438/** 439 * Defines Flex Component. 440 * 441 * @syscap SystemCapability.ArkUI.ArkUI.Full 442 * @form 443 * @since 9 444 */ 445/** 446 * Defines Flex Component. 447 * 448 * @syscap SystemCapability.ArkUI.ArkUI.Full 449 * @crossplatform 450 * @form 451 * @since 10 452 */ 453/** 454 * Defines Flex Component. 455 * 456 * @syscap SystemCapability.ArkUI.ArkUI.Full 457 * @crossplatform 458 * @form 459 * @atomicservice 460 * @since 11 461 */ 462declare const Flex: FlexInterface; 463 464/** 465 * Defines Flex Component instance. 466 * 467 * @syscap SystemCapability.ArkUI.ArkUI.Full 468 * @since 7 469 */ 470/** 471 * Defines Flex Component instance. 472 * 473 * @syscap SystemCapability.ArkUI.ArkUI.Full 474 * @form 475 * @since 9 476 */ 477/** 478 * Defines Flex Component instance. 479 * 480 * @syscap SystemCapability.ArkUI.ArkUI.Full 481 * @crossplatform 482 * @form 483 * @since 10 484 */ 485/** 486 * Defines Flex Component instance. 487 * 488 * @syscap SystemCapability.ArkUI.ArkUI.Full 489 * @crossplatform 490 * @form 491 * @atomicservice 492 * @since 11 493 */ 494declare const FlexInstance: FlexAttribute; 495