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 * Sets the sidebar style of showing 18 * 19 * @enum { number } 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 8 22 */ 23/** 24 * Sets the sidebar style of showing 25 * 26 * @enum { number } 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31declare enum SideBarContainerType { 32 /** 33 * The sidebar invisible 34 * 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @since 8 37 */ 38 /** 39 * The sidebar invisible 40 * 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @crossplatform 43 * @since 10 44 */ 45 Embed, 46 47 /** 48 * The sidebar visible 49 * 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @since 8 52 */ 53 /** 54 * The sidebar visible 55 * 56 * @syscap SystemCapability.ArkUI.ArkUI.Full 57 * @crossplatform 58 * @since 10 59 */ 60 Overlay, 61 62 /** 63 * The sidebar AUTO 64 * @syscap SystemCapability.ArkUI.ArkUI.Full 65 * @crossplatform 66 * @since 10 67 */ 68 AUTO, 69} 70 71/** 72 * Sets the sidebar position of showing 73 * 74 * @enum { number } 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @since 9 77 */ 78/** 79 * Sets the sidebar position of showing 80 * 81 * @enum { number } 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @crossplatform 84 * @since 10 85 */ 86declare enum SideBarPosition { 87 /** 88 * The sidebar is on the Start of the container 89 * 90 * @syscap SystemCapability.ArkUI.ArkUI.Full 91 * @since 9 92 */ 93 /** 94 * The sidebar is on the Start of the container 95 * 96 * @syscap SystemCapability.ArkUI.ArkUI.Full 97 * @crossplatform 98 * @since 10 99 */ 100 Start, 101 102 /** 103 * The sidebar is on the End of the container 104 * 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 9 107 */ 108 /** 109 * The sidebar is on the End of the container 110 * 111 * @syscap SystemCapability.ArkUI.ArkUI.Full 112 * @crossplatform 113 * @since 10 114 */ 115 End, 116} 117 118/** 119 * Sets the control button style 120 * 121 * @interface ButtonStyle 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @since 8 124 */ 125/** 126 * Sets the control button style 127 * 128 * @interface ButtonStyle 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @crossplatform 131 * @since 10 132 */ 133declare interface ButtonStyle { 134 /** 135 * Set the left of control button 136 * 137 * @type { ?number } 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @since 8 140 */ 141 /** 142 * Set the left of control button 143 * 144 * @type { ?number } 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @crossplatform 147 * @since 10 148 */ 149 left?: number; 150 151 /** 152 * Set the top of control button 153 * 154 * @type { ?number } 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @since 8 157 */ 158 /** 159 * Set the top of control button 160 * 161 * @type { ?number } 162 * @syscap SystemCapability.ArkUI.ArkUI.Full 163 * @crossplatform 164 * @since 10 165 */ 166 top?: number; 167 168 /** 169 * Set the width of control button 170 * 171 * @type { ?number } 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @since 8 174 */ 175 /** 176 * Set the width of control button 177 * 178 * @type { ?number } 179 * @syscap SystemCapability.ArkUI.ArkUI.Full 180 * @crossplatform 181 * @since 10 182 */ 183 width?: number; 184 185 /** 186 * Set the height of control button 187 * 188 * @type { ?number } 189 * @syscap SystemCapability.ArkUI.ArkUI.Full 190 * @since 8 191 */ 192 /** 193 * Set the height of control button 194 * 195 * @type { ?number } 196 * @syscap SystemCapability.ArkUI.ArkUI.Full 197 * @crossplatform 198 * @since 10 199 */ 200 height?: number; 201 202 /** 203 * Set the button icon when sidebar status has changed 204 * 205 * @type { ?({shown: string | PixelMap | Resource; 206 * hidden: string | PixelMap | Resource; 207 * switching?: string | PixelMap | Resource;}) } 208 * @syscap SystemCapability.ArkUI.ArkUI.Full 209 * @since 8 210 */ 211 /** 212 * Set the button icon when sidebar status has changed 213 * 214 * @syscap SystemCapability.ArkUI.ArkUI.Full 215 * @crossplatform 216 * @since 10 217 */ 218 icons?: { 219 shown: string | PixelMap | Resource; 220 hidden: string | PixelMap | Resource; 221 switching?: string | PixelMap | Resource; 222 }; 223} 224 225/** 226 * The construct function of sidebar 227 * 228 * @interface SideBarContainerInterface 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @since 8 231 */ 232/** 233 * The construct function of sidebar 234 * 235 * @interface SideBarContainerInterface 236 * @syscap SystemCapability.ArkUI.ArkUI.Full 237 * @crossplatform 238 * @since 10 239 */ 240interface SideBarContainerInterface { 241 /** 242 * Called when showing the sidebar of a block entry. 243 * 244 * @param { SideBarContainerType } type 245 * @returns { SideBarContainerAttribute } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @since 8 248 */ 249 /** 250 * Called when showing the sidebar of a block entry. 251 * 252 * @param { SideBarContainerType } type 253 * @returns { SideBarContainerAttribute } 254 * @syscap SystemCapability.ArkUI.ArkUI.Full 255 * @crossplatform 256 * @since 10 257 */ 258 (type?: SideBarContainerType): SideBarContainerAttribute; 259} 260 261/** 262 * Provides an interface for the style of a divider including stroke width, color, start margin 263 * and end margin 264 * 265 * @interface DividerStyle 266 * @syscap SystemCapability.ArkUI.ArkUI.Full 267 * @crossplatform 268 * @since 10 269 */ 270interface DividerStyle { 271 /** 272 * Define the stroke width of the divider 273 * 274 * @type { Length } 275 * @default 1vp 276 * @syscap SystemCapability.ArkUI.ArkUI.Full 277 * @crossplatform 278 * @since 10 279 */ 280 strokeWidth: Length; 281 282 /** 283 * Define the color of the divider 284 * 285 * @type { ?ResourceColor } 286 * @syscap SystemCapability.ArkUI.ArkUI.Full 287 * @crossplatform 288 * @since 10 289 */ 290 color?: ResourceColor; 291 292 /** 293 * Define the start margin of the divider 294 * 295 * @type { ?Length } 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @crossplatform 298 * @since 10 299 */ 300 startMargin?: Length; 301 302 /** 303 * Define the end margin of the divider 304 * 305 * @type { ?Length } 306 * @syscap SystemCapability.ArkUI.ArkUI.Full 307 * @crossplatform 308 * @since 10 309 */ 310 endMargin?: Length; 311} 312 313/** 314 * The attribute function of sidebar 315 * 316 * @extends CommonMethod 317 * @since 8 318 */ 319/** 320 * The attribute function of sidebar 321 * 322 * @extends CommonMethod 323 * @crossplatform 324 * @since 10 325 */ 326declare class SideBarContainerAttribute extends CommonMethod<SideBarContainerAttribute> { 327 /** 328 * Callback showControlButton function when setting the status of sidebar 329 * 330 * @param { boolean } value 331 * @returns { SideBarContainerAttribute } 332 * @syscap SystemCapability.ArkUI.ArkUI.Full 333 * @since 8 334 */ 335 /** 336 * Callback showControlButton function when setting the status of sidebar 337 * 338 * @param { boolean } value 339 * @returns { SideBarContainerAttribute } 340 * @syscap SystemCapability.ArkUI.ArkUI.Full 341 * @crossplatform 342 * @since 10 343 */ 344 showSideBar(value: boolean): SideBarContainerAttribute; 345 346 /** 347 * Callback controlButton function when setting the style of button 348 * 349 * @param { ButtonStyle } value 350 * @returns { SideBarContainerAttribute } 351 * @syscap SystemCapability.ArkUI.ArkUI.Full 352 * @since 8 353 */ 354 /** 355 * Callback controlButton function when setting the style of button 356 * 357 * @param { ButtonStyle } value 358 * @returns { SideBarContainerAttribute } 359 * @syscap SystemCapability.ArkUI.ArkUI.Full 360 * @crossplatform 361 * @since 10 362 */ 363 controlButton(value: ButtonStyle): SideBarContainerAttribute; 364 365 /** 366 * Callback showControlButton function when setting the status of button 367 * 368 * @param { boolean } value 369 * @returns { SideBarContainerAttribute } 370 * @syscap SystemCapability.ArkUI.ArkUI.Full 371 * @since 8 372 */ 373 /** 374 * Callback showControlButton function when setting the status of button 375 * 376 * @param { boolean } value 377 * @returns { SideBarContainerAttribute } 378 * @syscap SystemCapability.ArkUI.ArkUI.Full 379 * @crossplatform 380 * @since 10 381 */ 382 showControlButton(value: boolean): SideBarContainerAttribute; 383 384 /** 385 * Trigger callback when sidebar style of showing change finished. 386 * 387 * @param { function } callback 388 * @returns { SideBarContainerAttribute } 389 * @syscap SystemCapability.ArkUI.ArkUI.Full 390 * @since 8 391 */ 392 /** 393 * Trigger callback when sidebar style of showing change finished. 394 * 395 * @param { function } callback 396 * @returns { SideBarContainerAttribute } 397 * @syscap SystemCapability.ArkUI.ArkUI.Full 398 * @crossplatform 399 * @since 10 400 */ 401 onChange(callback: (value: boolean) => void): SideBarContainerAttribute; 402 403 /** 404 * Sets the length of sidebar. 405 * 406 * @param { number } value 407 * @returns { SideBarContainerAttribute } 408 * @syscap SystemCapability.ArkUI.ArkUI.Full 409 * @since 8 410 */ 411 /** 412 * Sets the length of sidebar. 413 * 414 * @param { number } value 415 * @returns { SideBarContainerAttribute } 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @crossplatform 418 * @since 10 419 */ 420 sideBarWidth(value: number): SideBarContainerAttribute; 421 422 /** 423 * Sets the min length of sidebar. 424 * default value is 200vp. 425 * 426 * @param { number } value 427 * @returns { SideBarContainerAttribute } 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @since 8 430 */ 431 /** 432 * Sets the min length of sidebar. 433 * default value is 200vp. 434 * 435 * @param { number } value 436 * @returns { SideBarContainerAttribute } 437 * @syscap SystemCapability.ArkUI.ArkUI.Full 438 * @crossplatform 439 * @since 10 440 */ 441 minSideBarWidth(value: number): SideBarContainerAttribute; 442 443 /** 444 * Sets the max length of sidebar. 445 * default value is 280vp. 446 * 447 * @param { number } value 448 * @returns { SideBarContainerAttribute } 449 * @syscap SystemCapability.ArkUI.ArkUI.Full 450 * @since 8 451 */ 452 /** 453 * Sets the max length of sidebar. 454 * default value is 280vp. 455 * 456 * @param { number } value 457 * @returns { SideBarContainerAttribute } 458 * @syscap SystemCapability.ArkUI.ArkUI.Full 459 * @crossplatform 460 * @since 10 461 */ 462 maxSideBarWidth(value: number): SideBarContainerAttribute; 463 464 /** 465 * Sets the length of sidebar. 466 * 467 * @param { Length } value 468 * @returns { SideBarContainerAttribute } 469 * @syscap SystemCapability.ArkUI.ArkUI.Full 470 * @since 9 471 */ 472 /** 473 * Sets the length of sidebar. 474 * 475 * @param { Length } value 476 * @returns { SideBarContainerAttribute } 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @since 10 480 */ 481 sideBarWidth(value: Length): SideBarContainerAttribute; 482 483 /** 484 * Sets the min length of sidebar. 485 * default value is 200vp. 486 * 487 * @param { Length } value 488 * @returns { SideBarContainerAttribute } 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @since 9 491 */ 492 /** 493 * Sets the min length of sidebar. 494 * default value is 200vp. 495 * 496 * @param { Length } value 497 * @returns { SideBarContainerAttribute } 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @since 10 501 */ 502 minSideBarWidth(value: Length): SideBarContainerAttribute; 503 504 /** 505 * Sets the max length of sidebar. 506 * default value is 280vp. 507 * 508 * @param { Length } value 509 * @returns { SideBarContainerAttribute } 510 * @syscap SystemCapability.ArkUI.ArkUI.Full 511 * @since 9 512 */ 513 /** 514 * Sets the max length of sidebar. 515 * default value is 280vp. 516 * 517 * @param { Length } value 518 * @returns { SideBarContainerAttribute } 519 * @syscap SystemCapability.ArkUI.ArkUI.Full 520 * @crossplatform 521 * @since 10 522 */ 523 maxSideBarWidth(value: Length): SideBarContainerAttribute; 524 525 /** 526 * Sets whether to automatically hide when drag sidebar width is less than the minimum width. 527 * default value is true. 528 * 529 * @param { boolean } value 530 * @returns { SideBarContainerAttribute } 531 * @syscap SystemCapability.ArkUI.ArkUI.Full 532 * @since 9 533 */ 534 /** 535 * Sets whether to automatically hide when drag sidebar width is less than the minimum width. 536 * default value is true. 537 * 538 * @param { boolean } value 539 * @returns { SideBarContainerAttribute } 540 * @syscap SystemCapability.ArkUI.ArkUI.Full 541 * @crossplatform 542 * @since 10 543 */ 544 autoHide(value: boolean): SideBarContainerAttribute; 545 546 /** 547 * Called when determining the location of the sidebar. 548 * default value is Start. 549 * 550 * @param { SideBarPosition } value 551 * @returns { SideBarContainerAttribute } 552 * @syscap SystemCapability.ArkUI.ArkUI.Full 553 * @since 9 554 */ 555 /** 556 * Called when determining the location of the sidebar. 557 * default value is Start. 558 * 559 * @param { SideBarPosition } value 560 * @returns { SideBarContainerAttribute } 561 * @syscap SystemCapability.ArkUI.ArkUI.Full 562 * @crossplatform 563 * @since 10 564 */ 565 sideBarPosition(value: SideBarPosition): SideBarContainerAttribute; 566 567 /** 568 * Set divider style for sideBarContainer 569 * 570 * @param { DividerStyle | null } value - indicates the style of the divider or whether to show the divider. 571 * @returns { SideBarContainerAttribute } 572 * @syscap SystemCapability.ArkUI.ArkUI.Full 573 * @crossplatform 574 * @since 10 575 */ 576 divider(value: DividerStyle | null): SideBarContainerAttribute; 577 578 /** 579 * Sets the min length of content. 580 * @param { Dimension } value - min length of content. 581 * @returns { SideBarContainerAttribute } 582 * @syscap SystemCapability.ArkUI.ArkUI.Full 583 * @crossplatform 584 * @since 10 585 */ 586 minContentWidth(value: Dimension): SideBarContainerAttribute; 587} 588 589/** 590 * Defines SideBarContainer Component. 591 * 592 * @syscap SystemCapability.ArkUI.ArkUI.Full 593 * @since 8 594 */ 595/** 596 * Defines SideBarContainer Component. 597 * 598 * @syscap SystemCapability.ArkUI.ArkUI.Full 599 * @crossplatform 600 * @since 10 601 */ 602declare const SideBarContainer: SideBarContainerInterface; 603 604/** 605 * Defines SideBarContainer Component instance. 606 * 607 * @syscap SystemCapability.ArkUI.ArkUI.Full 608 * @since 8 609 */ 610/** 611 * Defines SideBarContainer Component instance. 612 * 613 * @syscap SystemCapability.ArkUI.ArkUI.Full 614 * @crossplatform 615 * @since 10 616 */ 617declare const SideBarContainerInstance: SideBarContainerAttribute; 618