1/* 2 * Copyright (c) 2023-2024 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 22import font from './@ohos.font'; 23import mediaQuery from './@ohos.mediaquery'; 24import type inspector from './@ohos.arkui.inspector'; 25import type observer from './@ohos.arkui.observer'; 26import promptAction, { LevelOrder } from './@ohos.promptAction'; 27import router from './@ohos.router'; 28import type componentUtils from './@ohos.arkui.componentUtils'; 29import { ComponentContent, FrameNode, Frame } from './@ohos.arkui.node'; 30import type { AnimatorOptions, AnimatorResult } from './@ohos.animator'; 31import { SimpleAnimatorOptions } from './@ohos.animator'; 32import type { Callback, AsyncCallback } from './@ohos.base'; 33import { MeasureOptions } from './@ohos.measure'; 34import type componentSnapshot from './@ohos.arkui.componentSnapshot'; 35import type dragController from './@ohos.arkui.dragController'; 36import image from './@ohos.multimedia.image'; 37import type common from './@ohos.app.ability.common'; 38import type pointer from './@ohos.multimodalInput.pointer'; 39 40/** 41 * class Font 42 * 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 10 46 */ 47/** 48 * class Font 49 * 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @crossplatform 52 * @atomicservice 53 * @since 11 54 */ 55export class Font { 56 /** 57 * Register a customized font in the FontManager. 58 * 59 * @param { font.FontOptions } options - FontOptions 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 */ 64 /** 65 * Register a customized font in the FontManager. 66 * 67 * @param { font.FontOptions } options - FontOptions 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @atomicservice 71 * @since 11 72 */ 73 registerFont(options: font.FontOptions): void; 74 75 /** 76 * Gets a list of fonts supported by system. 77 * @returns { Array<string> } A list of font names 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @since 10 80 */ 81 /** 82 * Gets a list of fonts supported by system. 83 * @returns { Array<string> } A list of font names 84 * @syscap SystemCapability.ArkUI.ArkUI.Full 85 * @atomicservice 86 * @since 11 87 */ 88 getSystemFontList(): Array<string>; 89 90 /** 91 * Get font details according to the font name. 92 * @param { string } fontName - font name 93 * @returns { font.FontInfo } Returns the font info 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @since 10 96 */ 97 /** 98 * Get font details according to the font name. 99 * @param { string } fontName - font name 100 * @returns { font.FontInfo } Returns the font info 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @atomicservice 103 * @since 11 104 */ 105 getFontByName(fontName: string): font.FontInfo; 106} 107 108/** 109 * class MediaQuery 110 * 111 * @syscap SystemCapability.ArkUI.ArkUI.Full 112 * @crossplatform 113 * @since 10 114 */ 115/** 116 * class MediaQuery 117 * 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @crossplatform 120 * @atomicservice 121 * @since 11 122 */ 123export class MediaQuery { 124 /** 125 * Sets the media query criteria and returns the corresponding listening handle 126 * 127 * @param { string } condition - media conditions 128 * @returns { mediaQuery.MediaQueryListener } the corresponding listening handle 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @crossplatform 131 * @since 10 132 */ 133 /** 134 * Sets the media query criteria and returns the corresponding listening handle 135 * 136 * @param { string } condition - media conditions 137 * @returns { mediaQuery.MediaQueryListener } the corresponding listening handle 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @crossplatform 140 * @atomicservice 141 * @since 11 142 */ 143 matchMediaSync(condition: string): mediaQuery.MediaQueryListener; 144} 145 146/** 147 * class UIInspector 148 * @syscap SystemCapability.ArkUI.ArkUI.Full 149 * @crossplatform 150 * @since 10 151 */ 152/** 153 * class UIInspector 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @crossplatform 156 * @atomicservice 157 * @since 11 158 */ 159export class UIInspector { 160 /** 161 * Sets the component after layout or draw criteria and returns the corresponding listening handle 162 * @param { string } id - component id. 163 * @returns { inspector.ComponentObserver } create listener for observer component event. 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @since 10 167 */ 168 /** 169 * Sets the component after layout or draw criteria and returns the corresponding listening handle 170 * @param { string } id - component id. 171 * @returns { inspector.ComponentObserver } create listener for observer component event. 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @crossplatform 174 * @atomicservice 175 * @since 11 176 */ 177 createComponentObserver(id: string): inspector.ComponentObserver; 178} 179 180/** 181 * class Router 182 * 183 * @syscap SystemCapability.ArkUI.ArkUI.Full 184 * @crossplatform 185 * @since 10 186 */ 187/** 188 * class Router 189 * 190 * @syscap SystemCapability.ArkUI.ArkUI.Full 191 * @crossplatform 192 * @atomicservice 193 * @since 11 194 */ 195/** 196 * class Router 197 * 198 * @syscap SystemCapability.ArkUI.ArkUI.Full 199 * @crossplatform 200 * @atomicservice 201 * @since 12 202 */ 203export class Router { 204 /** 205 * Navigates to a specified page in the application based on the page URL and parameters. 206 * 207 * @param { router.RouterOptions } options - Options. 208 * @param { AsyncCallback<void> } callback - the callback of pushUrl. 209 * @throws { BusinessError } 401 - Parameter error. Possible causes: 210 * <br> 1. Mandatory parameters are left unspecified. 211 * <br> 2. Incorrect parameters types. 212 * <br> 3. Parameter verification failed. 213 * @throws { BusinessError } 100001 - Internal error. 214 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 215 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 216 * @syscap SystemCapability.ArkUI.ArkUI.Full 217 * @crossplatform 218 * @since 10 219 */ 220 /** 221 * Navigates to a specified page in the application based on the page URL and parameters. 222 * 223 * @param { router.RouterOptions } options - Options. 224 * @param { AsyncCallback<void> } callback - the callback of pushUrl. 225 * @throws { BusinessError } 401 - Parameter error. Possible causes: 226 * <br> 1. Mandatory parameters are left unspecified. 227 * <br> 2. Incorrect parameters types. 228 * <br> 3. Parameter verification failed. 229 * @throws { BusinessError } 100001 - Internal error. 230 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 231 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 232 * @syscap SystemCapability.ArkUI.ArkUI.Full 233 * @crossplatform 234 * @atomicservice 235 * @since 11 236 */ 237 pushUrl(options: router.RouterOptions, callback: AsyncCallback<void>): void; 238 239 /** 240 * Navigates to a specified page in the application based on the page URL and parameters. 241 * 242 * @param { router.RouterOptions } options - Options. 243 * @returns { Promise<void> } the promise returned by the function. 244 * @throws { BusinessError } 401 - Parameter error. Possible causes: 245 * <br> 1. Mandatory parameters are left unspecified. 246 * <br> 2. Incorrect parameters types. 247 * <br> 3. Parameter verification failed. 248 * @throws { BusinessError } 100001 - Internal error. 249 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 250 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 251 * @syscap SystemCapability.ArkUI.ArkUI.Full 252 * @crossplatform 253 * @since 10 254 */ 255 /** 256 * Navigates to a specified page in the application based on the page URL and parameters. 257 * 258 * @param { router.RouterOptions } options - Options. 259 * @returns { Promise<void> } the promise returned by the function. 260 * @throws { BusinessError } 401 - Parameter error. Possible causes: 261 * <br> 1. Mandatory parameters are left unspecified. 262 * <br> 2. Incorrect parameters types. 263 * <br> 3. Parameter verification failed. 264 * @throws { BusinessError } 100001 - Internal error. 265 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 266 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 267 * @syscap SystemCapability.ArkUI.ArkUI.Full 268 * @crossplatform 269 * @atomicservice 270 * @since 11 271 */ 272 pushUrl(options: router.RouterOptions): Promise<void>; 273 274 /** 275 * Navigates to a specified page in the application based on the page URL and parameters. 276 * 277 * @param { router.RouterOptions } options - Options. 278 * @param { router.RouterMode } mode - RouterMode. 279 * @param { AsyncCallback<void> } callback - the callback of pushUrl. 280 * @throws { BusinessError } 401 - Parameter error. Possible causes: 281 * <br> 1. Mandatory parameters are left unspecified. 282 * <br> 2. Incorrect parameters types. 283 * <br> 3. Parameter verification failed. 284 * @throws { BusinessError } 100001 - Internal error. 285 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 286 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 287 * @syscap SystemCapability.ArkUI.ArkUI.Full 288 * @crossplatform 289 * @since 10 290 */ 291 /** 292 * Navigates to a specified page in the application based on the page URL and parameters. 293 * 294 * @param { router.RouterOptions } options - Options. 295 * @param { router.RouterMode } mode - RouterMode. 296 * @param { AsyncCallback<void> } callback - the callback of pushUrl. 297 * @throws { BusinessError } 401 - Parameter error. Possible causes: 298 * <br> 1. Mandatory parameters are left unspecified. 299 * <br> 2. Incorrect parameters types. 300 * <br> 3. Parameter verification failed. 301 * @throws { BusinessError } 100001 - Internal error. 302 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 303 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @crossplatform 306 * @atomicservice 307 * @since 11 308 */ 309 pushUrl(options: router.RouterOptions, mode: router.RouterMode, callback: AsyncCallback<void>): void; 310 311 /** 312 * Navigates to a specified page in the application based on the page URL and parameters. 313 * 314 * @param { router.RouterOptions } options - Options. 315 * @param { router.RouterMode } mode - RouterMode. 316 * @returns { Promise<void> } the promise returned by the function. 317 * @throws { BusinessError } 401 - Parameter error. Possible causes: 318 * <br> 1. Mandatory parameters are left unspecified. 319 * <br> 2. Incorrect parameters types. 320 * <br> 3. Parameter verification failed. 321 * @throws { BusinessError } 100001 - Internal error. 322 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 323 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 324 * @syscap SystemCapability.ArkUI.ArkUI.Full 325 * @crossplatform 326 * @since 10 327 */ 328 /** 329 * Navigates to a specified page in the application based on the page URL and parameters. 330 * 331 * @param { router.RouterOptions } options - Options. 332 * @param { router.RouterMode } mode - RouterMode. 333 * @returns { Promise<void> } the promise returned by the function. 334 * @throws { BusinessError } 401 - Parameter error. Possible causes: 335 * <br> 1. Mandatory parameters are left unspecified. 336 * <br> 2. Incorrect parameters types. 337 * <br> 3. Parameter verification failed. 338 * @throws { BusinessError } 100001 - Internal error. 339 * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist 340 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 341 * @syscap SystemCapability.ArkUI.ArkUI.Full 342 * @crossplatform 343 * @atomicservice 344 * @since 11 345 */ 346 pushUrl(options: router.RouterOptions, mode: router.RouterMode): Promise<void>; 347 348 /** 349 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 350 * 351 * @param { router.RouterOptions } options - Options. 352 * @param { AsyncCallback<void> } callback - the callback of replaceUrl. 353 * @throws { BusinessError } 401 - Parameter error. Possible causes: 354 * <br> 1. Mandatory parameters are left unspecified. 355 * <br> 2. Incorrect parameters types. 356 * <br> 3. Parameter verification failed. 357 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 358 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 359 * @syscap SystemCapability.ArkUI.ArkUI.Full 360 * @crossplatform 361 * @since 10 362 */ 363 /** 364 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 365 * 366 * @param { router.RouterOptions } options - Options. 367 * @param { AsyncCallback<void> } callback - the callback of replaceUrl. 368 * @throws { BusinessError } 401 - Parameter error. Possible causes: 369 * <br> 1. Mandatory parameters are left unspecified. 370 * <br> 2. Incorrect parameters types. 371 * <br> 3. Parameter verification failed. 372 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 373 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 374 * @syscap SystemCapability.ArkUI.ArkUI.Full 375 * @crossplatform 376 * @atomicservice 377 * @since 11 378 */ 379 replaceUrl(options: router.RouterOptions, callback: AsyncCallback<void>): void; 380 381 /** 382 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 383 * 384 * @param { router.RouterOptions } options - Options. 385 * @returns { Promise<void> } the promise returned by the function. 386 * @throws { BusinessError } 401 - Parameter error. Possible causes: 387 * <br> 1. Mandatory parameters are left unspecified. 388 * <br> 2. Incorrect parameters types. 389 * <br> 3. Parameter verification failed. 390 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 391 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 392 * @syscap SystemCapability.ArkUI.ArkUI.Full 393 * @crossplatform 394 * @since 10 395 */ 396 /** 397 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 398 * 399 * @param { router.RouterOptions } options - Options. 400 * @returns { Promise<void> } the promise returned by the function. 401 * @throws { BusinessError } 401 - Parameter error. Possible causes: 402 * <br> 1. Mandatory parameters are left unspecified. 403 * <br> 2. Incorrect parameters types. 404 * <br> 3. Parameter verification failed. 405 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 406 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 407 * @syscap SystemCapability.ArkUI.ArkUI.Full 408 * @crossplatform 409 * @atomicservice 410 * @since 11 411 */ 412 replaceUrl(options: router.RouterOptions): Promise<void>; 413 414 /** 415 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 416 * 417 * @param { router.RouterOptions } options - Options. 418 * @param { router.RouterMode } mode - RouterMode. 419 * @param { AsyncCallback<void> } callback - the callback of replaceUrl. 420 * @throws { BusinessError } 401 - Parameter error. Possible causes: 421 * <br> 1. Mandatory parameters are left unspecified. 422 * <br> 2. Incorrect parameters types. 423 * <br> 3. Parameter verification failed. 424 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 425 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 426 * @syscap SystemCapability.ArkUI.ArkUI.Full 427 * @crossplatform 428 * @since 10 429 */ 430 /** 431 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 432 * 433 * @param { router.RouterOptions } options - Options. 434 * @param { router.RouterMode } mode - RouterMode. 435 * @param { AsyncCallback<void> } callback - the callback of replaceUrl. 436 * @throws { BusinessError } 401 - Parameter error. Possible causes: 437 * <br> 1. Mandatory parameters are left unspecified. 438 * <br> 2. Incorrect parameters types. 439 * <br> 3. Parameter verification failed. 440 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 441 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 442 * @syscap SystemCapability.ArkUI.ArkUI.Full 443 * @crossplatform 444 * @atomicservice 445 * @since 11 446 */ 447 replaceUrl(options: router.RouterOptions, mode: router.RouterMode, callback: AsyncCallback<void>): void; 448 449 /** 450 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 451 * 452 * @param { router.RouterOptions } options - Options. 453 * @param { router.RouterMode } mode - RouterMode. 454 * @returns { Promise<void> } the promise returned by the function. 455 * @throws { BusinessError } 401 - Parameter error. Possible causes: 456 * <br> 1. Mandatory parameters are left unspecified. 457 * <br> 2. Incorrect parameters types. 458 * <br> 3. Parameter verification failed. 459 * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. 460 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 461 * @syscap SystemCapability.ArkUI.ArkUI.Full 462 * @crossplatform 463 * @since 10 464 */ 465 /** 466 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 467 * 468 * @param { router.RouterOptions } options - Options. 469 * @param { router.RouterMode } mode - RouterMode. 470 * @returns { Promise<void> } the promise returned by the function. 471 * @throws { BusinessError } 401 - Parameter error. Possible causes: 472 * <br> 1. Mandatory parameters are left unspecified. 473 * <br> 2. Incorrect parameters types. 474 * <br> 3. Parameter verification failed. 475 * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. 476 * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @atomicservice 480 * @since 11 481 */ 482 replaceUrl(options: router.RouterOptions, mode: router.RouterMode): Promise<void>; 483 484 /** 485 * Returns to the previous page or a specified page. 486 * 487 * @param { router.RouterOptions } options - Options. 488 * @syscap SystemCapability.ArkUI.ArkUI.Full 489 * @crossplatform 490 * @since 10 491 */ 492 /** 493 * Returns to the previous page or a specified page. 494 * 495 * @param { router.RouterOptions } options - Options. 496 * @syscap SystemCapability.ArkUI.ArkUI.Full 497 * @crossplatform 498 * @atomicservice 499 * @since 11 500 */ 501 back(options?: router.RouterOptions): void; 502 503 /** 504 * Returns to the specified page. 505 * 506 * @param { number } index - index of page. 507 * @param { Object } [params] - params of page. 508 * @syscap SystemCapability.ArkUI.ArkUI.Full 509 * @crossplatform 510 * @atomicservice 511 * @since 12 512 */ 513 back(index: number, params?: Object): void; 514 515 /** 516 * Clears all historical pages and retains only the current page at the top of the stack. 517 * 518 * @syscap SystemCapability.ArkUI.ArkUI.Full 519 * @crossplatform 520 * @since 10 521 */ 522 /** 523 * Clears all historical pages and retains only the current page at the top of the stack. 524 * 525 * @syscap SystemCapability.ArkUI.ArkUI.Full 526 * @crossplatform 527 * @atomicservice 528 * @since 11 529 */ 530 clear(): void; 531 532 /** 533 * Obtains the number of pages in the current stack. 534 * 535 * @returns { string } Number of pages in the stack. The maximum value is 32. 536 * @syscap SystemCapability.ArkUI.ArkUI.Full 537 * @crossplatform 538 * @since 10 539 */ 540 /** 541 * Obtains the number of pages in the current stack. 542 * 543 * @returns { string } Number of pages in the stack. The maximum value is 32. 544 * @syscap SystemCapability.ArkUI.ArkUI.Full 545 * @crossplatform 546 * @atomicservice 547 * @since 11 548 */ 549 getLength(): string; 550 551 /** 552 * Obtains information about the current page state. 553 * 554 * @returns { router.RouterState } Page state. 555 * @syscap SystemCapability.ArkUI.ArkUI.Full 556 * @crossplatform 557 * @since 10 558 */ 559 /** 560 * Obtains information about the current page state. 561 * 562 * @returns { router.RouterState } Page state. 563 * @syscap SystemCapability.ArkUI.ArkUI.Full 564 * @crossplatform 565 * @atomicservice 566 * @since 11 567 */ 568 getState(): router.RouterState; 569 570 /** 571 * Obtains page information by index. 572 * 573 * @param { number } index - Index of page. 574 * @returns { router.RouterState | undefined } Page state. 575 * @syscap SystemCapability.ArkUI.ArkUI.Full 576 * @crossplatform 577 * @atomicservice 578 * @since 12 579 */ 580 getStateByIndex(index: number): router.RouterState | undefined; 581 582 /** 583 * Obtains page information by url. 584 * 585 * @param { string } url - URL of page. 586 * @returns { Array<router.RouterState> } Page state. 587 * @syscap SystemCapability.ArkUI.ArkUI.Full 588 * @crossplatform 589 * @atomicservice 590 * @since 12 591 */ 592 getStateByUrl(url: string): Array<router.RouterState>; 593 594 /** 595 * Pop up alert dialog to ask whether to back. 596 * 597 * @param { router.EnableAlertOptions } options - Options. 598 * @throws { BusinessError } 401 - Parameter error. Possible causes: 599 * <br> 1. Mandatory parameters are left unspecified. 600 * <br> 2. Incorrect parameters types. 601 * <br> 3. Parameter verification failed. 602 * @throws { BusinessError } 100001 - Internal error. 603 * @syscap SystemCapability.ArkUI.ArkUI.Full 604 * @crossplatform 605 * @since 10 606 */ 607 /** 608 * Pop up alert dialog to ask whether to back. 609 * 610 * @param { router.EnableAlertOptions } options - Options. 611 * @throws { BusinessError } 401 - Parameter error. Possible causes: 612 * <br> 1. Mandatory parameters are left unspecified. 613 * <br> 2. Incorrect parameters types. 614 * <br> 3. Parameter verification failed. 615 * @throws { BusinessError } 100001 - Internal error. 616 * @syscap SystemCapability.ArkUI.ArkUI.Full 617 * @crossplatform 618 * @atomicservice 619 * @since 11 620 */ 621 showAlertBeforeBackPage(options: router.EnableAlertOptions): void; 622 623 /** 624 * Hide alert before back page. 625 * 626 * @syscap SystemCapability.ArkUI.ArkUI.Full 627 * @crossplatform 628 * @since 10 629 */ 630 /** 631 * Hide alert before back page. 632 * 633 * @syscap SystemCapability.ArkUI.ArkUI.Full 634 * @crossplatform 635 * @atomicservice 636 * @since 11 637 */ 638 hideAlertBeforeBackPage(): void; 639 640 /** 641 * Obtains information about the current page params. 642 * 643 * @returns { Object } Page params. 644 * @syscap SystemCapability.ArkUI.ArkUI.Full 645 * @crossplatform 646 * @since 10 647 */ 648 /** 649 * Obtains information about the current page params. 650 * 651 * @returns { Object } Page params. 652 * @syscap SystemCapability.ArkUI.ArkUI.Full 653 * @crossplatform 654 * @atomicservice 655 * @since 11 656 */ 657 getParams(): Object; 658 659 /** 660 * Navigates to a specified page in the application based on the page URL and parameters. 661 * @param { router.NamedRouterOptions } options - Options. 662 * @param { AsyncCallback<void> } callback - the callback of pushNamedRoute. 663 * @throws { BusinessError } 401 - Parameter error. Possible causes: 664 * <br> 1. Mandatory parameters are left unspecified. 665 * <br> 2. Incorrect parameters types. 666 * <br> 3. Parameter verification failed. 667 * @throws { BusinessError } 100001 - Internal error. 668 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 669 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 670 * @syscap SystemCapability.ArkUI.ArkUI.Full 671 * @crossplatform 672 * @since 10 673 */ 674 /** 675 * Navigates to a specified page in the application based on the page URL and parameters. 676 * @param { router.NamedRouterOptions } options - Options. 677 * @param { AsyncCallback<void> } callback - the callback of pushNamedRoute. 678 * @throws { BusinessError } 401 - Parameter error. Possible causes: 679 * <br> 1. Mandatory parameters are left unspecified. 680 * <br> 2. Incorrect parameters types. 681 * <br> 3. Parameter verification failed. 682 * @throws { BusinessError } 100001 - Internal error. 683 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 684 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 685 * @syscap SystemCapability.ArkUI.ArkUI.Full 686 * @crossplatform 687 * @atomicservice 688 * @since 11 689 */ 690 pushNamedRoute(options: router.NamedRouterOptions, callback: AsyncCallback<void>): void; 691 692 /** 693 * Navigates to a specified page in the application based on the page URL and parameters. 694 * @param { router.NamedRouterOptions } options - Options. 695 * @returns { Promise<void> } the promise returned by the function. 696 * @throws { BusinessError } 401 - Parameter error. Possible causes: 697 * <br> 1. Mandatory parameters are left unspecified. 698 * <br> 2. Incorrect parameters types. 699 * <br> 3. Parameter verification failed. 700 * @throws { BusinessError } 100001 - Internal error. 701 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 702 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 703 * @syscap SystemCapability.ArkUI.ArkUI.Full 704 * @crossplatform 705 * @since 10 706 */ 707 /** 708 * Navigates to a specified page in the application based on the page URL and parameters. 709 * @param { router.NamedRouterOptions } options - Options. 710 * @returns { Promise<void> } the promise returned by the function. 711 * @throws { BusinessError } 401 - Parameter error. Possible causes: 712 * <br> 1. Mandatory parameters are left unspecified. 713 * <br> 2. Incorrect parameters types. 714 * <br> 3. Parameter verification failed. 715 * @throws { BusinessError } 100001 - Internal error. 716 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 717 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 718 * @syscap SystemCapability.ArkUI.ArkUI.Full 719 * @crossplatform 720 * @atomicservice 721 * @since 11 722 */ 723 pushNamedRoute(options: router.NamedRouterOptions): Promise<void>; 724 725 /** 726 * Navigates to a specified page in the application based on the page URL and parameters. 727 * @param { router.NamedRouterOptions } options - Options. 728 * @param { router.RouterMode } mode - RouterMode. 729 * @param { AsyncCallback<void> } callback - the callback of pushNamedRoute. 730 * @throws { BusinessError } 401 - Parameter error. Possible causes: 731 * <br> 1. Mandatory parameters are left unspecified. 732 * <br> 2. Incorrect parameters types. 733 * <br> 3. Parameter verification failed. 734 * @throws { BusinessError } 100001 - Internal error. 735 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 736 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 737 * @syscap SystemCapability.ArkUI.ArkUI.Full 738 * @crossplatform 739 * @since 10 740 */ 741 /** 742 * Navigates to a specified page in the application based on the page URL and parameters. 743 * @param { router.NamedRouterOptions } options - Options. 744 * @param { router.RouterMode } mode - RouterMode. 745 * @param { AsyncCallback<void> } callback - the callback of pushNamedRoute. 746 * @throws { BusinessError } 401 - Parameter error. Possible causes: 747 * <br> 1. Mandatory parameters are left unspecified. 748 * <br> 2. Incorrect parameters types. 749 * <br> 3. Parameter verification failed. 750 * @throws { BusinessError } 100001 - Internal error. 751 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 752 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 753 * @syscap SystemCapability.ArkUI.ArkUI.Full 754 * @crossplatform 755 * @atomicservice 756 * @since 11 757 */ 758 pushNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode, callback: AsyncCallback<void>): void; 759 760 /** 761 * Navigates to a specified page in the application based on the page URL and parameters. 762 * @param { router.NamedRouterOptions } options - Options. 763 * @param { router.RouterMode } mode - RouterMode. 764 * @returns { Promise<void> } the promise returned by the function. 765 * @throws { BusinessError } 401 - Parameter error. Possible causes: 766 * <br> 1. Mandatory parameters are left unspecified. 767 * <br> 2. Incorrect parameters types. 768 * <br> 3. Parameter verification failed. 769 * @throws { BusinessError } 100001 - Internal error. 770 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 771 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 772 * @syscap SystemCapability.ArkUI.ArkUI.Full 773 * @crossplatform 774 * @since 10 775 */ 776 /** 777 * Navigates to a specified page in the application based on the page URL and parameters. 778 * @param { router.NamedRouterOptions } options - Options. 779 * @param { router.RouterMode } mode - RouterMode. 780 * @returns { Promise<void> } the promise returned by the function. 781 * @throws { BusinessError } 401 - Parameter error. Possible causes: 782 * <br> 1. Mandatory parameters are left unspecified. 783 * <br> 2. Incorrect parameters types. 784 * <br> 3. Parameter verification failed. 785 * @throws { BusinessError } 100001 - Internal error. 786 * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. 787 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 788 * @syscap SystemCapability.ArkUI.ArkUI.Full 789 * @crossplatform 790 * @atomicservice 791 * @since 11 792 */ 793 pushNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode): Promise<void>; 794 795 /** 796 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 797 * @param { router.NamedRouterOptions } options - Options. 798 * @param { AsyncCallback<void> } callback - the callback of replaceNamedRoute. 799 * @throws { BusinessError } 401 - Parameter error. Possible causes: 800 * <br> 1. Mandatory parameters are left unspecified. 801 * <br> 2. Incorrect parameters types. 802 * <br> 3. Parameter verification failed. 803 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 804 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 805 * @syscap SystemCapability.ArkUI.ArkUI.Full 806 * @crossplatform 807 * @since 10 808 */ 809 /** 810 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 811 * @param { router.NamedRouterOptions } options - Options. 812 * @param { AsyncCallback<void> } callback - the callback of replaceNamedRoute. 813 * @throws { BusinessError } 401 - Parameter error. Possible causes: 814 * <br> 1. Mandatory parameters are left unspecified. 815 * <br> 2. Incorrect parameters types. 816 * <br> 3. Parameter verification failed. 817 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 818 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 819 * @syscap SystemCapability.ArkUI.ArkUI.Full 820 * @crossplatform 821 * @atomicservice 822 * @since 11 823 */ 824 replaceNamedRoute(options: router.NamedRouterOptions, callback: AsyncCallback<void>): void; 825 826 /** 827 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 828 * @param { router.NamedRouterOptions } options - Options. 829 * @returns { Promise<void> } the promise returned by the function. 830 * @throws { BusinessError } 401 - Parameter error. Possible causes: 831 * <br> 1. Mandatory parameters are left unspecified. 832 * <br> 2. Incorrect parameters types. 833 * <br> 3. Parameter verification failed. 834 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 835 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 836 * @syscap SystemCapability.ArkUI.ArkUI.Full 837 * @crossplatform 838 * @since 10 839 */ 840 /** 841 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 842 * @param { router.NamedRouterOptions } options - Options. 843 * @returns { Promise<void> } the promise returned by the function. 844 * @throws { BusinessError } 401 - if the number of parameters is less than 1 or the type of the url parameter is not string. 845 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 846 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 847 * @syscap SystemCapability.ArkUI.ArkUI.Full 848 * @crossplatform 849 * @atomicservice 850 * @since 11 851 */ 852 replaceNamedRoute(options: router.NamedRouterOptions): Promise<void>; 853 854 /** 855 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 856 * @param { router.NamedRouterOptions } options - Options. 857 * @param { router.RouterMode } mode - RouterMode. 858 * @param { AsyncCallback<void> } callback - the callback of replaceNamedRoute. 859 * @throws { BusinessError } 401 - Parameter error. Possible causes: 860 * <br> 1. Mandatory parameters are left unspecified. 861 * <br> 2. Incorrect parameters types. 862 * <br> 3. Parameter verification failed. 863 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 864 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 865 * @syscap SystemCapability.ArkUI.ArkUI.Full 866 * @crossplatform 867 * @since 10 868 */ 869 /** 870 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 871 * @param { router.NamedRouterOptions } options - Options. 872 * @param { router.RouterMode } mode - RouterMode. 873 * @param { AsyncCallback<void> } callback - the callback of replaceNamedRoute. 874 * @throws { BusinessError } 401 - if the number of parameters is less than 1 or the type of the url parameter is not string. 875 * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. 876 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 877 * @syscap SystemCapability.ArkUI.ArkUI.Full 878 * @crossplatform 879 * @atomicservice 880 * @since 11 881 */ 882 replaceNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode, callback: AsyncCallback<void>): void; 883 884 /** 885 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 886 * @param { router.NamedRouterOptions } options - Options. 887 * @param { router.RouterMode } mode - RouterMode. 888 * @returns { Promise<void> } the promise returned by the function. 889 * @throws { BusinessError } 401 - Parameter error. Possible causes: 890 * <br> 1. Mandatory parameters are left unspecified. 891 * <br> 2. Incorrect parameters types. 892 * <br> 3. Parameter verification failed. 893 * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. 894 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 895 * @syscap SystemCapability.ArkUI.ArkUI.Full 896 * @crossplatform 897 * @since 10 898 */ 899 /** 900 * Replaces the current page with another one in the application. The current page is destroyed after replacement. 901 * @param { router.NamedRouterOptions } options - Options. 902 * @param { router.RouterMode } mode - RouterMode. 903 * @returns { Promise<void> } the promise returned by the function. 904 * @throws { BusinessError } 401 - Parameter error. Possible causes: 905 * <br> 1. Mandatory parameters are left unspecified. 906 * <br> 2. Incorrect parameters types. 907 * <br> 3. Parameter verification failed. 908 * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. 909 * @throws { BusinessError } 100004 - Named route error. The named route does not exist. 910 * @syscap SystemCapability.ArkUI.ArkUI.Full 911 * @crossplatform 912 * @atomicservice 913 * @since 11 914 */ 915 replaceNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode): Promise<void>; 916} 917 918/** 919 * Defines the custom builder with id. 920 * 921 * @typedef { function } CustomBuilderWithId 922 * @syscap SystemCapability.ArkUI.ArkUI.Full 923 * @crossplatform 924 * @atomicservice 925 * @since 18 926 */ 927declare type CustomBuilderWithId = (id: number) => void; 928 929/** 930 * Defines the target info. 931 * 932 * @interface TargetInfo 933 * @syscap SystemCapability.ArkUI.ArkUI.Full 934 * @crossplatform 935 * @atomicservice 936 * @since 18 937 */ 938export interface TargetInfo { 939 /** 940 * ID of target node. 941 * 942 * @type { string | number } 943 * @syscap SystemCapability.ArkUI.ArkUI.Full 944 * @crossplatform 945 * @atomicservice 946 * @since 18 947 */ 948 id: string | number; 949 950 /** 951 * Unique ID that generated by framework. This ID used to constrain range of target. 952 * 953 * @type { ?number } 954 * @syscap SystemCapability.ArkUI.ArkUI.Full 955 * @crossplatform 956 * @atomicservice 957 * @since 18 958 */ 959 componentId?: number; 960} 961 962/** 963 * class PromptAction 964 * 965 * @syscap SystemCapability.ArkUI.ArkUI.Full 966 * @crossplatform 967 * @since 10 968 */ 969/** 970 * class PromptAction 971 * 972 * @syscap SystemCapability.ArkUI.ArkUI.Full 973 * @crossplatform 974 * @atomicservice 975 * @since 11 976 */ 977export class PromptAction { 978 /** 979 * Displays the notification text. 980 * 981 * @param { promptAction.ShowToastOptions } options - Options. 982 * @throws { BusinessError } 401 - Parameter error. Possible causes: 983 * <br> 1. Mandatory parameters are left unspecified. 984 * <br> 2. Incorrect parameters types. 985 * <br> 3. Parameter verification failed. 986 * @throws { BusinessError } 100001 - Internal error. 987 * @syscap SystemCapability.ArkUI.ArkUI.Full 988 * @crossplatform 989 * @since 10 990 */ 991 /** 992 * Displays the notification text. 993 * 994 * @param { promptAction.ShowToastOptions } options - Options. 995 * @throws { BusinessError } 401 - Parameter error. Possible causes: 996 * <br> 1. Mandatory parameters are left unspecified. 997 * <br> 2. Incorrect parameters types. 998 * <br> 3. Parameter verification failed. 999 * @throws { BusinessError } 100001 - Internal error. 1000 * @syscap SystemCapability.ArkUI.ArkUI.Full 1001 * @crossplatform 1002 * @atomicservice 1003 * @since 11 1004 */ 1005 showToast(options: promptAction.ShowToastOptions): void; 1006 1007 /** 1008 * Displays the notification text. 1009 * 1010 * @param { promptAction.ShowToastOptions } options - Options. 1011 * @returns { Promise<number> } return the toast id that will be used by closeToast. 1012 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1013 * <br> 1. Mandatory parameters are left unspecified. 1014 * <br> 2. Incorrect parameters types. 1015 * <br> 3. Parameter verification failed. 1016 * @throws { BusinessError } 100001 - Internal error. 1017 * @syscap SystemCapability.ArkUI.ArkUI.Full 1018 * @crossplatform 1019 * @atomicservice 1020 * @since 18 1021 */ 1022 openToast(options: promptAction.ShowToastOptions): Promise<number>; 1023 1024 /** 1025 * Close the notification text. 1026 * 1027 * @param { number } toastId - the toast id that returned by openToast. 1028 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1029 * <br> 1. Mandatory parameters are left unspecified. 1030 * <br> 2. Incorrect parameters types. 1031 * <br> 3. Parameter verification failed. 1032 * @throws { BusinessError } 100001 - Internal error. 1033 * @syscap SystemCapability.ArkUI.ArkUI.Full 1034 * @crossplatform 1035 * @atomicservice 1036 * @since 18 1037 */ 1038 closeToast(toastId: number): void; 1039 1040 /** 1041 * Displays the dialog box. 1042 * 1043 * @param { promptAction.ShowDialogOptions } options - Options. 1044 * @param { AsyncCallback<promptAction.ShowDialogSuccessResponse> } callback - the callback of showDialog. 1045 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1046 * <br> 1. Mandatory parameters are left unspecified. 1047 * <br> 2. Incorrect parameters types. 1048 * <br> 3. Parameter verification failed. 1049 * @throws { BusinessError } 100001 - Internal error. 1050 * @syscap SystemCapability.ArkUI.ArkUI.Full 1051 * @crossplatform 1052 * @since 10 1053 */ 1054 /** 1055 * Displays the dialog box. 1056 * 1057 * @param { promptAction.ShowDialogOptions } options - Options. 1058 * @param { AsyncCallback<promptAction.ShowDialogSuccessResponse> } callback - the callback of showDialog. 1059 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1060 * <br> 1. Mandatory parameters are left unspecified. 1061 * <br> 2. Incorrect parameters types. 1062 * <br> 3. Parameter verification failed. 1063 * @throws { BusinessError } 100001 - Internal error. 1064 * @syscap SystemCapability.ArkUI.ArkUI.Full 1065 * @crossplatform 1066 * @atomicservice 1067 * @since 11 1068 */ 1069 /** 1070 * Displays the dialog box. 1071 * 1072 * @param { promptAction.ShowDialogOptions } options - Options. 1073 * @param { AsyncCallback<promptAction.ShowDialogSuccessResponse> } callback - the callback of showDialog. 1074 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1075 * <br> 1. Mandatory parameters are left unspecified. 1076 * <br> 2. Incorrect parameters types. 1077 * <br> 3. Parameter verification failed. 1078 * @throws { BusinessError } 100001 - Internal error. 1079 * @syscap SystemCapability.ArkUI.ArkUI.Full 1080 * @crossplatform 1081 * @atomicservice 1082 * @since 12 1083 */ 1084 showDialog(options: promptAction.ShowDialogOptions, callback: AsyncCallback<promptAction.ShowDialogSuccessResponse>): void; 1085 1086 /** 1087 * Displays the dialog box. 1088 * 1089 * @param { promptAction.ShowDialogOptions } options - Options. 1090 * @returns { Promise<promptAction.ShowDialogSuccessResponse> } the promise returned by the function. 1091 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1092 * <br> 1. Mandatory parameters are left unspecified. 1093 * <br> 2. Incorrect parameters types. 1094 * <br> 3. Parameter verification failed. 1095 * @throws { BusinessError } 100001 - Internal error. 1096 * @syscap SystemCapability.ArkUI.ArkUI.Full 1097 * @crossplatform 1098 * @since 10 1099 */ 1100 /** 1101 * Displays the dialog box. 1102 * 1103 * @param { promptAction.ShowDialogOptions } options - Options. 1104 * @returns { Promise<promptAction.ShowDialogSuccessResponse> } the promise returned by the function. 1105 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1106 * <br> 1. Mandatory parameters are left unspecified. 1107 * <br> 2. Incorrect parameters types. 1108 * <br> 3. Parameter verification failed. 1109 * @throws { BusinessError } 100001 - Internal error. 1110 * @syscap SystemCapability.ArkUI.ArkUI.Full 1111 * @crossplatform 1112 * @atomicservice 1113 * @since 11 1114 */ 1115 showDialog(options: promptAction.ShowDialogOptions): Promise<promptAction.ShowDialogSuccessResponse>; 1116 1117 /** 1118 * Displays the menu. 1119 * 1120 * @param { promptAction.ActionMenuOptions } options - Options. 1121 * @param { promptAction.ActionMenuSuccessResponse } callback - the callback of showActionMenu. 1122 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1123 * <br> 1. Mandatory parameters are left unspecified. 1124 * <br> 2. Incorrect parameters types. 1125 * <br> 3. Parameter verification failed. 1126 * @throws { BusinessError } 100001 - Internal error. 1127 * @syscap SystemCapability.ArkUI.ArkUI.Full 1128 * @crossplatform 1129 * @since 10 1130 * @deprecated since 11 1131 * @useinstead showActionMenu 1132 */ 1133 showActionMenu(options: promptAction.ActionMenuOptions, callback: promptAction.ActionMenuSuccessResponse): void; 1134 1135 /** 1136 * Displays the menu. 1137 * 1138 * @param { promptAction.ActionMenuOptions } options - Options. 1139 * @param { AsyncCallback<promptAction.ActionMenuSuccessResponse> } callback - the callback of showActionMenu. 1140 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1141 * <br> 1. Mandatory parameters are left unspecified. 1142 * <br> 2. Incorrect parameters types. 1143 * <br> 3. Parameter verification failed. 1144 * @throws { BusinessError } 100001 - Internal error. 1145 * @syscap SystemCapability.ArkUI.ArkUI.Full 1146 * @crossplatform 1147 * @atomicservice 1148 * @since 11 1149 */ 1150 showActionMenu(options: promptAction.ActionMenuOptions, callback: AsyncCallback<promptAction.ActionMenuSuccessResponse>): void; 1151 1152 /** 1153 * Displays the menu. 1154 * 1155 * @param { promptAction.ActionMenuOptions } options - Options. 1156 * @returns { Promise<promptAction.ActionMenuSuccessResponse> } callback - the callback of showActionMenu. 1157 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1158 * <br> 1. Mandatory parameters are left unspecified. 1159 * <br> 2. Incorrect parameters types. 1160 * <br> 3. Parameter verification failed. 1161 * @throws { BusinessError } 100001 - Internal error. 1162 * @syscap SystemCapability.ArkUI.ArkUI.Full 1163 * @crossplatform 1164 * @since 10 1165 */ 1166 /** 1167 * Displays the menu. 1168 * 1169 * @param { promptAction.ActionMenuOptions } options - Options. 1170 * @returns { Promise<promptAction.ActionMenuSuccessResponse> } callback - the callback of showActionMenu. 1171 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1172 * <br> 1. Mandatory parameters are left unspecified. 1173 * <br> 2. Incorrect parameters types. 1174 * <br> 3. Parameter verification failed. 1175 * @throws { BusinessError } 100001 - Internal error. 1176 * @syscap SystemCapability.ArkUI.ArkUI.Full 1177 * @crossplatform 1178 * @atomicservice 1179 * @since 11 1180 */ 1181 showActionMenu(options: promptAction.ActionMenuOptions): Promise<promptAction.ActionMenuSuccessResponse>; 1182 1183 /** 1184 * Open the custom dialog with frameNode. 1185 * 1186 * @param { ComponentContent<T> } dialogContent - the content of custom dialog. 1187 * @param { promptAction.BaseDialogOptions } options - Options. 1188 * @returns { Promise<void> } the promise returned by the function. 1189 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1190 * <br> 1. Mandatory parameters are left unspecified. 1191 * <br> 2. Incorrect parameters types. 1192 * <br> 3. Parameter verification failed. 1193 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1194 * @throws { BusinessError } 103302 - Dialog content already exists. 1195 * @syscap SystemCapability.ArkUI.ArkUI.Full 1196 * @crossplatform 1197 * @atomicservice 1198 * @since 12 1199 */ 1200 openCustomDialog<T extends Object>(dialogContent: ComponentContent<T>, options?: promptAction.BaseDialogOptions): Promise<void>; 1201 1202 /** 1203 * Open the custom dialog with frameNode and controller. 1204 * 1205 * @param { ComponentContent<T> } dialogContent - the content of custom dialog. 1206 * @param { promptAction.DialogController } controller - Dialog controller. 1207 * @param { promptAction.BaseDialogOptions } options - Options. 1208 * @returns { Promise<void> } the promise returned by the function. 1209 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1210 * <br> 1. Mandatory parameters are left unspecified. 1211 * <br> 2. Incorrect parameters types. 1212 * <br> 3. Parameter verification failed. 1213 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1214 * @throws { BusinessError } 103302 - Dialog content already exists. 1215 * @syscap SystemCapability.ArkUI.ArkUI.Full 1216 * @crossplatform 1217 * @atomicservice 1218 * @since 18 1219 */ 1220 openCustomDialogWithController<T extends Object>(dialogContent: ComponentContent<T>, controller: promptAction.DialogController, 1221 options?: promptAction.BaseDialogOptions): Promise<void>; 1222 1223 /** 1224 * Update the custom dialog with frameNode. 1225 * 1226 * @param { ComponentContent<T> } dialogContent - the content of custom dialog. 1227 * @param { promptAction.BaseDialogOptions } options - Options. 1228 * @returns { Promise<void> } the promise returned by the function. 1229 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1230 * <br> 1. Mandatory parameters are left unspecified. 1231 * <br> 2. Incorrect parameters types. 1232 * <br> 3. Parameter verification failed. 1233 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1234 * @throws { BusinessError } 103303 - The ComponentContent cannot be found. 1235 * @syscap SystemCapability.ArkUI.ArkUI.Full 1236 * @crossplatform 1237 * @atomicservice 1238 * @since 12 1239 */ 1240 updateCustomDialog<T extends Object>(dialogContent: ComponentContent<T>, options: promptAction.BaseDialogOptions): Promise<void>; 1241 1242 /** 1243 * Close the custom dialog with frameNode. 1244 * 1245 * @param { ComponentContent<T> } dialogContent - the content of custom dialog. 1246 * @returns { Promise<void> } the promise returned by the function. 1247 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1248 * <br> 1. Mandatory parameters are left unspecified. 1249 * <br> 2. Incorrect parameters types. 1250 * <br> 3. Parameter verification failed. 1251 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1252 * @throws { BusinessError } 103303 - The ComponentContent cannot be found. 1253 * @syscap SystemCapability.ArkUI.ArkUI.Full 1254 * @crossplatform 1255 * @atomicservice 1256 * @since 12 1257 */ 1258 closeCustomDialog<T extends Object>(dialogContent: ComponentContent<T>): Promise<void>; 1259 1260 /** 1261 * Open the custom dialog. 1262 * 1263 * @param { promptAction.CustomDialogOptions } options - Options. 1264 * @returns { Promise<number> } return the dialog id that will be used by closeCustomDialog. 1265 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1266 * <br> 1. Mandatory parameters are left unspecified. 1267 * <br> 2. Incorrect parameters types. 1268 * <br> 3. Parameter verification failed. 1269 * @throws { BusinessError } 100001 - Internal error. 1270 * @syscap SystemCapability.ArkUI.ArkUI.Full 1271 * @crossplatform 1272 * @atomicservice 1273 * @since 12 1274 */ 1275 openCustomDialog(options: promptAction.CustomDialogOptions): Promise<number>; 1276 1277 /** 1278 * Present the custom dialog with controller. 1279 * 1280 * @param { CustomBuilder | CustomBuilderWithId } builder - Dialog builder. 1281 * @param { promptAction.DialogController } controller - Dialog controller. 1282 * @param { promptAction.DialogOptions } options - Options. 1283 * @returns { Promise<number> } return the dialog id that will be used by closeCustomDialog. 1284 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1285 * <br> 1. Mandatory parameters are left unspecified. 1286 * <br> 2. Incorrect parameters types. 1287 * <br> 3. Parameter verification failed. 1288 * @throws { BusinessError } 100001 - Internal error. 1289 * @syscap SystemCapability.ArkUI.ArkUI.Full 1290 * @crossplatform 1291 * @atomicservice 1292 * @since 18 1293 */ 1294 presentCustomDialog(builder: CustomBuilder | CustomBuilderWithId, controller?: promptAction.DialogController, 1295 options?: promptAction.DialogOptions): Promise<number>; 1296 1297 /** 1298 * Close the custom dialog. 1299 * 1300 * @param { number } dialogId - the dialog id that returned by openCustomDialog. 1301 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1302 * <br> 1. Mandatory parameters are left unspecified. 1303 * <br> 2. Incorrect parameters types. 1304 * <br> 3. Parameter verification failed. 1305 * @throws { BusinessError } 100001 - Internal error. 1306 * @syscap SystemCapability.ArkUI.ArkUI.Full 1307 * @crossplatform 1308 * @atomicservice 1309 * @since 12 1310 */ 1311 closeCustomDialog(dialogId: number): void; 1312 1313 /** 1314 * Get order value of top dialog. 1315 * 1316 * @returns { LevelOrder } the display order. 1317 * @syscap SystemCapability.ArkUI.ArkUI.Full 1318 * @crossplatform 1319 * @atomicservice 1320 * @since 18 1321 */ 1322 getTopOrder(): LevelOrder; 1323 1324 /** 1325 * Get order value of bottom dialog. 1326 * 1327 * @returns { LevelOrder } the display order. 1328 * @syscap SystemCapability.ArkUI.ArkUI.Full 1329 * @crossplatform 1330 * @atomicservice 1331 * @since 18 1332 */ 1333 getBottomOrder(): LevelOrder; 1334 1335 /** 1336 * Open popup with frameNode. 1337 * 1338 * @param { ComponentContent<T> } content - The content of popup. 1339 * @param { TargetInfo } target - The target of popup. 1340 * @param { PopupCommonOptions } options - Options. 1341 * @returns { Promise<void> } the promise returned by the function. 1342 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1343 * <br> 1. Mandatory parameters are left unspecified. 1344 * <br> 2. Incorrect parameters types. 1345 * <br> 3. Parameter verification failed. 1346 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1347 * @throws { BusinessError } 103302 - The ComponentContent already exists. 1348 * @throws { BusinessError } 103304 - The targetId does not exist. 1349 * @throws { BusinessError } 103305 - The node of targetId is not in the component tree. 1350 * @syscap SystemCapability.ArkUI.ArkUI.Full 1351 * @crossplatform 1352 * @atomicservice 1353 * @since 18 1354 */ 1355 openPopup<T extends Object>(content: ComponentContent<T>, target: TargetInfo, options?: PopupCommonOptions): Promise<void>; 1356 1357 /** 1358 * Update popup with frameNode. 1359 * 1360 * @param { ComponentContent<T> } content - The content of popup. 1361 * @param { PopupCommonOptions } options - Options. 1362 * @param { boolean } partialUpdate - If true, only the specified properties in the options are updated, 1363 * otherwise the rest of the properties are overwritten with the default values. 1364 * Default value is false. 1365 * @returns { Promise<void> } the promise returned by the function. 1366 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1367 * <br> 1. Mandatory parameters are left unspecified. 1368 * <br> 2. Incorrect parameters types. 1369 * <br> 3. Parameter verification failed. 1370 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1371 * @throws { BusinessError } 103303 - The ComponentContent cannot be found. 1372 * @syscap SystemCapability.ArkUI.ArkUI.Full 1373 * @crossplatform 1374 * @atomicservice 1375 * @since 18 1376 */ 1377 updatePopup<T extends Object>(content: ComponentContent<T>, options: PopupCommonOptions, partialUpdate?: boolean): Promise<void>; 1378 1379 /** 1380 * Close popup with frameNode. 1381 * 1382 * @param { ComponentContent<T> } content - The content of popup. 1383 * @returns { Promise<void> } the promise returned by the function. 1384 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1385 * <br> 1. Mandatory parameters are left unspecified. 1386 * <br> 2. Incorrect parameters types. 1387 * <br> 3. Parameter verification failed. 1388 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1389 * @throws { BusinessError } 103303 - The ComponentContent cannot be found. 1390 * @syscap SystemCapability.ArkUI.ArkUI.Full 1391 * @crossplatform 1392 * @atomicservice 1393 * @since 18 1394 */ 1395 closePopup<T extends Object>(content: ComponentContent<T>): Promise<void>; 1396 1397 /** 1398 * Open menu with frameNode. 1399 * 1400 * @param { ComponentContent<T> } content - The content of menu. 1401 * @param { TargetInfo } target - The target of menu. 1402 * @param { MenuOptions } options - Options. 1403 * @returns { Promise<void> } the promise returned by the function. 1404 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1405 * <br> 1. Mandatory parameters are left unspecified. 1406 * <br> 2. Incorrect parameters types. 1407 * <br> 3. Parameter verification failed. 1408 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1409 * @throws { BusinessError } 103302 - The ComponentContent already exists. 1410 * @throws { BusinessError } 103304 - The targetId does not exist. 1411 * @throws { BusinessError } 103305 - The node of targetId is not in the component tree. 1412 * @syscap SystemCapability.ArkUI.ArkUI.Full 1413 * @crossplatform 1414 * @atomicservice 1415 * @since 18 1416 */ 1417 openMenu<T extends Object>(content: ComponentContent<T>, target: TargetInfo, options?: MenuOptions): Promise<void>; 1418 1419 /** 1420 * Update menu with frameNode. 1421 * 1422 * @param { ComponentContent<T> } content - The content of menu. 1423 * @param { MenuOptions } options - Options. 1424 * @param { boolean } partialUpdate - If true, only the specified properties in the MenuOptions are updated, 1425 * otherwise the rest of the properties are overwritten with the default values. 1426 * Default value is false. 1427 * @returns { Promise<void> } the promise returned by the function. 1428 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1429 * <br> 1. Mandatory parameters are left unspecified. 1430 * <br> 2. Incorrect parameters types. 1431 * <br> 3. Parameter verification failed. 1432 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1433 * @throws { BusinessError } 103303 - The ComponentContent cannot be found. 1434 * @syscap SystemCapability.ArkUI.ArkUI.Full 1435 * @crossplatform 1436 * @atomicservice 1437 * @since 18 1438 */ 1439 updateMenu<T extends Object>(content: ComponentContent<T>, options: MenuOptions, partialUpdate?: boolean): Promise<void>; 1440 1441 /** 1442 * Close menu with frameNode. 1443 * 1444 * @param { ComponentContent<T> } content - The content of menu. 1445 * @returns { Promise<void> } the promise returned by the function. 1446 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1447 * <br> 1. Mandatory parameters are left unspecified. 1448 * <br> 2. Incorrect parameters types. 1449 * <br> 3. Parameter verification failed. 1450 * @throws { BusinessError } 103301 - The ComponentContent is incorrect. 1451 * @throws { BusinessError } 103303 - The ComponentContent cannot be found. 1452 * @syscap SystemCapability.ArkUI.ArkUI.Full 1453 * @crossplatform 1454 * @atomicservice 1455 * @since 18 1456 */ 1457 closeMenu<T extends Object>(content: ComponentContent<T>): Promise<void>; 1458} 1459 1460/** 1461 * Defines the callback type used in UIObserver watch click event. 1462 * The value of event indicates the information of ClickEvent. 1463 * The value of node indicates the frameNode which will receive the event. 1464 * 1465 * @typedef { function } ClickEventListenerCallback 1466 * @param { ClickEvent } event - the information of ClickEvent 1467 * @param { FrameNode } [node] - the information of frameNode 1468 * @syscap SystemCapability.ArkUI.ArkUI.Full 1469 * @crossplatform 1470 * @atomicservice 1471 * @since 12 1472 */ 1473declare type ClickEventListenerCallback = (event: ClickEvent, node?: FrameNode) => void; 1474 1475/** 1476 * Defines the callback type used in UIObserver watch gesture. 1477 * The value of event indicates the information of gesture. 1478 * The value of node indicates the frameNode which will receive the event. 1479 * 1480 * @typedef { function } GestureEventListenerCallback 1481 * @param { GestureEvent } event - the information of GestureEvent 1482 * @param { FrameNode } [node] - the information of frameNode 1483 * @syscap SystemCapability.ArkUI.ArkUI.Full 1484 * @crossplatform 1485 * @atomicservice 1486 * @since 12 1487 */ 1488declare type GestureEventListenerCallback = (event: GestureEvent, node?: FrameNode) => void; 1489 1490/** 1491 * Defines the PageInfo type. 1492 * The value of routerPageInfo indicates the information of the router page, or undefined if the 1493 * frameNode does not have router page information. And the value of navDestinationInfo indicates 1494 * the information of the navDestination, or undefined if the frameNode does not have navDestination 1495 * information. 1496 * 1497 * @interface PageInfo 1498 * @syscap SystemCapability.ArkUI.ArkUI.Full 1499 * @crossplatform 1500 * @atomicservice 1501 * @since 12 1502 */ 1503export interface PageInfo { 1504 /** 1505 * the property of router page information. 1506 * 1507 * @type { ?observer.RouterPageInfo } 1508 * @syscap SystemCapability.ArkUI.ArkUI.Full 1509 * @atomicservice 1510 * @since 12 1511 */ 1512 routerPageInfo?: observer.RouterPageInfo; 1513 1514 /** 1515 * the property of navDestination information. 1516 * 1517 * @type { ?observer.NavDestinationInfo } 1518 * @syscap SystemCapability.ArkUI.ArkUI.Full 1519 * @atomicservice 1520 * @since 12 1521 */ 1522 navDestinationInfo?: observer.NavDestinationInfo; 1523} 1524 1525/** 1526 * the property of OverlayManager. 1527 * 1528 * @interface OverlayManagerOptions 1529 * @syscap SystemCapability.ArkUI.ArkUI.Full 1530 * @crossplatform 1531 * @atomicservice 1532 * @since 15 1533 */ 1534export interface OverlayManagerOptions { 1535 /** 1536 * the render property of overlay node. 1537 * 1538 * @type { ?boolean } 1539 * @default true 1540 * @syscap SystemCapability.ArkUI.ArkUI.Full 1541 * @crossplatform 1542 * @atomicservice 1543 * @since 15 1544 */ 1545 renderRootOverlay?: boolean; 1546} 1547 1548/** 1549 * Register callbacks to observe ArkUI behavior. 1550 * 1551 * @syscap SystemCapability.ArkUI.ArkUI.Full 1552 * @crossplatform 1553 * @since 11 1554 */ 1555/** 1556 * Register callbacks to observe ArkUI behavior. 1557 * 1558 * @syscap SystemCapability.ArkUI.ArkUI.Full 1559 * @crossplatform 1560 * @atomicservice 1561 * @since 12 1562 */ 1563export class UIObserver { 1564 /** 1565 * Registers a callback function to be called when the navigation destination is updated. 1566 * 1567 * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'. 1568 * @param { object } options - Specify the id of observed navigation. 1569 * @param { Callback<observer.NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated. 1570 * @syscap SystemCapability.ArkUI.ArkUI.Full 1571 * @crossplatform 1572 * @since 11 1573 */ 1574 /** 1575 * Registers a callback function to be called when the navigation destination is updated. 1576 * 1577 * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'. 1578 * @param { object } options - The options object. 1579 * @param { Callback<observer.NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated. 1580 * @syscap SystemCapability.ArkUI.ArkUI.Full 1581 * @crossplatform 1582 * @atomicservice 1583 * @since 12 1584 */ 1585 on(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callback: Callback<observer.NavDestinationInfo>): void; 1586 1587 /** 1588 * Removes a callback function that was previously registered with `on()`. 1589 * 1590 * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. 1591 * @param { object } options - Specify the id of observed navigation. 1592 * @param { Callback<observer.NavDestinationInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and 1593 * navigation ID will be removed. 1594 * @syscap SystemCapability.ArkUI.ArkUI.Full 1595 * @crossplatform 1596 * @since 11 1597 */ 1598 /** 1599 * Removes a callback function that was previously registered with `on()`. 1600 * 1601 * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. 1602 * @param { object } options - The options object. 1603 * @param { Callback<observer.NavDestinationInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and 1604 * navigation ID will be removed. 1605 * @syscap SystemCapability.ArkUI.ArkUI.Full 1606 * @crossplatform 1607 * @atomicservice 1608 * @since 12 1609 */ 1610 off(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callback?: Callback<observer.NavDestinationInfo>): void; 1611 1612 /** 1613 * Registers a callback function to be called when the navigation destination is updated. 1614 * 1615 * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'. 1616 * @param { Callback<observer.NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated. 1617 * @syscap SystemCapability.ArkUI.ArkUI.Full 1618 * @crossplatform 1619 * @since 11 1620 */ 1621 /** 1622 * Registers a callback function to be called when the navigation destination is updated. 1623 * 1624 * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'. 1625 * @param { Callback<observer.NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated. 1626 * @syscap SystemCapability.ArkUI.ArkUI.Full 1627 * @crossplatform 1628 * @atomicservice 1629 * @since 12 1630 */ 1631 on(type: 'navDestinationUpdate', callback: Callback<observer.NavDestinationInfo>): void; 1632 1633 /** 1634 * Removes a callback function that was previously registered with `on()`. 1635 * 1636 * @param { 'navDestinationUpdate'} type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. 1637 * @param { Callback<observer.NavDestinationInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1638 * will be removed. 1639 * @syscap SystemCapability.ArkUI.ArkUI.Full 1640 * @crossplatform 1641 * @since 11 1642 */ 1643 /** 1644 * Removes a callback function that was previously registered with `on()`. 1645 * 1646 * @param { 'navDestinationUpdate'} type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. 1647 * @param { Callback<observer.NavDestinationInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1648 * will be removed. 1649 * @syscap SystemCapability.ArkUI.ArkUI.Full 1650 * @crossplatform 1651 * @atomicservice 1652 * @since 12 1653 */ 1654 off(type: 'navDestinationUpdate', callback?: Callback<observer.NavDestinationInfo>): void; 1655 1656 /** 1657 * Registers a callback function to be called when the scroll event start or stop. 1658 * 1659 * @param { 'scrollEvent' } type - The type of event to listen for. Must be 'scrollEvent'. 1660 * @param { observer.ObserverOptions } options - The options object. 1661 * @param { Callback<observer.ScrollEventInfo> } callback - The callback function to be called when the scroll event start or stop. 1662 * @syscap SystemCapability.ArkUI.ArkUI.Full 1663 * @crossplatform 1664 * @atomicservice 1665 * @since 12 1666 */ 1667 on(type: 'scrollEvent', options: observer.ObserverOptions, callback: Callback<observer.ScrollEventInfo>): void; 1668 1669 /** 1670 * Removes a callback function that was previously registered with `on()`. 1671 * 1672 * @param { 'scrollEvent' } type - The type of event to remove the listener for. Must be 'scrollEvent'. 1673 * @param { observer.ObserverOptions } options - The options object. 1674 * @param { Callback<observer.ScrollEventInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and 1675 * scroll ID will be removed. 1676 * @syscap SystemCapability.ArkUI.ArkUI.Full 1677 * @crossplatform 1678 * @atomicservice 1679 * @since 12 1680 */ 1681 off(type: 'scrollEvent', options: observer.ObserverOptions, callback?: Callback<observer.ScrollEventInfo>): void; 1682 1683 /** 1684 * Registers a callback function to be called when the scroll event start or stop. 1685 * 1686 * @param { 'scrollEvent' } type - The type of event to listen for. Must be 'scrollEvent'. 1687 * @param { Callback<observer.ScrollEventInfo> } callback - The callback function to be called when the scroll event start or stop. 1688 * @syscap SystemCapability.ArkUI.ArkUI.Full 1689 * @crossplatform 1690 * @atomicservice 1691 * @since 12 1692 */ 1693 on(type: 'scrollEvent', callback: Callback<observer.ScrollEventInfo>): void; 1694 1695 /** 1696 * Removes a callback function that was previously registered with `on()`. 1697 * 1698 * @param { 'scrollEvent'} type - The type of event to remove the listener for. Must be 'scrollEvent'. 1699 * @param { Callback<observer.ScrollEventInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1700 * will be removed. 1701 * @syscap SystemCapability.ArkUI.ArkUI.Full 1702 * @crossplatform 1703 * @atomicservice 1704 * @since 12 1705 */ 1706 off(type: 'scrollEvent', callback?: Callback<observer.ScrollEventInfo>): void; 1707 1708 /** 1709 * Registers a callback function to be called when the router page in a ui context is updated. 1710 * 1711 * @param { 'routerPageUpdate' } type - The type of event to listen for. Must be 'routerPageUpdate'. 1712 * @param { Callback<observer.RouterPageInfo> } callback - The callback function to be called when the router page is updated. 1713 * @syscap SystemCapability.ArkUI.ArkUI.Full 1714 * @crossplatform 1715 * @since 11 1716 */ 1717 /** 1718 * Registers a callback function to be called when the router page in a ui context is updated. 1719 * 1720 * @param { 'routerPageUpdate' } type - The type of event to listen for. Must be 'routerPageUpdate'. 1721 * @param { Callback<observer.RouterPageInfo> } callback - The callback function to be called when the router page is updated. 1722 * @syscap SystemCapability.ArkUI.ArkUI.Full 1723 * @crossplatform 1724 * @atomicservice 1725 * @since 12 1726 */ 1727 on(type: 'routerPageUpdate', callback: Callback<observer.RouterPageInfo>): void; 1728 1729 /** 1730 * Removes a callback function that was previously registered with `on()`. 1731 * 1732 * @param { 'routerPageUpdate' } type - The type of event to remove the listener for. Must be 'routerPageUpdate'. 1733 * @param { Callback<observer.RouterPageInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1734 * will be removed. 1735 * @syscap SystemCapability.ArkUI.ArkUI.Full 1736 * @crossplatform 1737 * @since 11 1738 */ 1739 /** 1740 * Removes a callback function that was previously registered with `on()`. 1741 * 1742 * @param { 'routerPageUpdate' } type - The type of event to remove the listener for. Must be 'routerPageUpdate'. 1743 * @param { Callback<observer.RouterPageInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1744 * will be removed. 1745 * @syscap SystemCapability.ArkUI.ArkUI.Full 1746 * @crossplatform 1747 * @atomicservice 1748 * @since 12 1749 */ 1750 off(type: 'routerPageUpdate', callback?: Callback<observer.RouterPageInfo>): void; 1751 1752 /** 1753 * Registers a callback function to be called when the screen density in a ui context is updated. 1754 * 1755 * @param { 'densityUpdate' } type - The type of event to listen for. Must be 'densityUpdate'. 1756 * @param { Callback<observer.DensityInfo> } callback - The callback function to be called when the screen density is updated. 1757 * @syscap SystemCapability.ArkUI.ArkUI.Full 1758 * @crossplatform 1759 * @atomicservice 1760 * @since 12 1761 */ 1762 on(type: 'densityUpdate', callback: Callback<observer.DensityInfo>): void; 1763 1764 /** 1765 * Removes a callback function that was previously registered with `on()`. 1766 * 1767 * @param { 'densityUpdate' } type - The type of event to remove the listener for. Must be 'densityUpdate'. 1768 * @param { Callback<observer.DensityInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1769 * will be removed. 1770 * @syscap SystemCapability.ArkUI.ArkUI.Full 1771 * @crossplatform 1772 * @atomicservice 1773 * @since 12 1774 */ 1775 off(type: 'densityUpdate', callback?: Callback<observer.DensityInfo>): void; 1776 1777 /** 1778 * Registers a callback function to be called when the draw command will be drawn. 1779 * 1780 * @param { 'willDraw' } type - The type of event to listen for. Must be 'willDraw'. 1781 * @param { Callback<void> } callback - The callback function to be called when the draw command will be drawn. 1782 * @syscap SystemCapability.ArkUI.ArkUI.Full 1783 * @crossplatform 1784 * @atomicservice 1785 * @since 12 1786 */ 1787 on(type: 'willDraw', callback: Callback<void>): void; 1788 1789 /** 1790 * Removes a callback function that was previously registered with `on()`. 1791 * 1792 * @param { 'willDraw' } type - The type of event to remove the listener for. Must be 'willDraw'. 1793 * @param { Callback<void> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1794 * will be removed. 1795 * @syscap SystemCapability.ArkUI.ArkUI.Full 1796 * @crossplatform 1797 * @atomicservice 1798 * @since 12 1799 */ 1800 off(type: 'willDraw', callback?: Callback<void>): void; 1801 1802 /** 1803 * Registers a callback function to be called when the layout is done. 1804 * 1805 * @param { 'didLayout' } type - The type of event to listen for. Must be 'didLayout'. 1806 * @param { Callback<void> } callback - The callback function to be called when the layout is done. 1807 * @syscap SystemCapability.ArkUI.ArkUI.Full 1808 * @crossplatform 1809 * @atomicservice 1810 * @since 12 1811 */ 1812 on(type: 'didLayout', callback: Callback<void>): void; 1813 1814 /** 1815 * Removes a callback function that was previously registered with `on()`. 1816 * 1817 * @param { 'didLayout' } type - The type of event to remove the listener for. Must be 'didLayout'. 1818 * @param { Callback<void> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type 1819 * will be removed. 1820 * @syscap SystemCapability.ArkUI.ArkUI.Full 1821 * @crossplatform 1822 * @atomicservice 1823 * @since 12 1824 */ 1825 off(type: 'didLayout', callback?: Callback<void>): void; 1826 1827 /** 1828 * Registers a callback function to be called when the navigation switched to a new navDestination. 1829 * 1830 * @param { 'navDestinationSwitch' } type - The type of event to listen for. Must be 'navDestinationSwitch'. 1831 * @param { Callback<observer.NavDestinationSwitchInfo> } callback - The callback function to be called when 1832 * the navigation switched to a new navDestination. 1833 * @syscap SystemCapability.ArkUI.ArkUI.Full 1834 * @crossplatform 1835 * @atomicservice 1836 * @since 12 1837 */ 1838 on( 1839 type: 'navDestinationSwitch', 1840 callback: Callback<observer.NavDestinationSwitchInfo> 1841 ): void; 1842 1843 /** 1844 * Removes a callback function that was previously registered with `on()`. 1845 * 1846 * @param { 'navDestinationSwitch' } type - The type of event to remove the listener for. Must be 'navDestinationSwitch'. 1847 * @param { Callback<observer.NavDestinationSwitchInfo> } [callback] - The callback function to remove. If not provided, 1848 * all callbacks for the given event type will be removed. 1849 * @syscap SystemCapability.ArkUI.ArkUI.Full 1850 * @crossplatform 1851 * @atomicservice 1852 * @since 12 1853 */ 1854 off( 1855 type: 'navDestinationSwitch', 1856 callback?: Callback<observer.NavDestinationSwitchInfo> 1857 ): void; 1858 1859 /** 1860 * Registers a callback function to be called when the navigation switched to a new navDestination. 1861 * 1862 * @param { 'navDestinationSwitch' } type - The type of event to listen for. Must be 'navDestinationSwitch'. 1863 * @param { observer.NavDestinationSwitchObserverOptions } observerOptions - Options. 1864 * @param { Callback<observer.NavDestinationSwitchInfo> } callback - The callback function to be called when the 1865 * navigation switched to a new navDestination. 1866 * @syscap SystemCapability.ArkUI.ArkUI.Full 1867 * @crossplatform 1868 * @atomicservice 1869 * @since 12 1870 */ 1871 on( 1872 type: 'navDestinationSwitch', 1873 observerOptions: observer.NavDestinationSwitchObserverOptions, 1874 callback: Callback<observer.NavDestinationSwitchInfo> 1875 ): void; 1876 1877 /** 1878 * Removes a callback function that was previously registered with `on()`. 1879 * 1880 * @param { 'navDestinationSwitch' } type - The type of event to remove the listener for. Must be 'navDestinationSwitch'. 1881 * @param { observer.NavDestinationSwitchObserverOptions } observerOptions - Options. 1882 * @param { Callback<observer.NavDestinationSwitchInfo> } [callback] - The callback function to remove. If not provided, 1883 * all callbacks for the given event type will be removed. 1884 * @syscap SystemCapability.ArkUI.ArkUI.Full 1885 * @crossplatform 1886 * @atomicservice 1887 * @since 12 1888 */ 1889 off( 1890 type: 'navDestinationSwitch', 1891 observerOptions: observer.NavDestinationSwitchObserverOptions, 1892 callback?: Callback<observer.NavDestinationSwitchInfo> 1893 ): void; 1894 1895 /** 1896 * Registers a callback function to be called before clickEvent is called. 1897 * 1898 * @param { 'willClick' } type - The type of event to listen for. 1899 * @param { ClickEventListenerCallback } callback - The callback function to be called 1900 * when the clickEvent will be trigger or after. 1901 * @syscap SystemCapability.ArkUI.ArkUI.Full 1902 * @crossplatform 1903 * @atomicservice 1904 * @since 12 1905 */ 1906 on(type: 'willClick', callback: ClickEventListenerCallback): void; 1907 1908 /** 1909 * Removes a callback function to be called before clickEvent is called. 1910 * 1911 * @param { 'willClick' } type - The type of event to remove the listener for. 1912 * @param { ClickEventListenerCallback } [callback] - The callback function to remove. If not provided, 1913 * all callbacks for the given event type will be removed. 1914 * @syscap SystemCapability.ArkUI.ArkUI.Full 1915 * @crossplatform 1916 * @atomicservice 1917 * @since 12 1918 */ 1919 off(type: 'willClick', callback?: ClickEventListenerCallback): void; 1920 1921 /** 1922 * Registers a callback function to be called after clickEvent is called. 1923 * 1924 * @param { 'didClick' } type - The type of event to listen for. 1925 * @param { ClickEventListenerCallback } callback - The callback function to be called 1926 * when the clickEvent will be trigger or after. 1927 * @syscap SystemCapability.ArkUI.ArkUI.Full 1928 * @crossplatform 1929 * @atomicservice 1930 * @since 12 1931 */ 1932 on(type: 'didClick', callback: ClickEventListenerCallback): void; 1933 1934 /** 1935 * Removes a callback function to be called after clickEvent is called. 1936 * 1937 * @param { 'didClick' } type - The type of event to remove the listener for. 1938 * @param { ClickEventListenerCallback } [callback] - The callback function to remove. If not provided, 1939 * all callbacks for the given event type will be removed. 1940 * @syscap SystemCapability.ArkUI.ArkUI.Full 1941 * @crossplatform 1942 * @atomicservice 1943 * @since 12 1944 */ 1945 off(type: 'didClick', callback?: ClickEventListenerCallback): void; 1946 1947 /** 1948 * Registers a callback function to be called before tapGesture is called. 1949 * 1950 * @param { 'willClick' } type - The type of event to listen for. 1951 * @param { GestureEventListenerCallback } callback - The callback function to be called 1952 * when the clickEvent will be trigger or after. 1953 * @syscap SystemCapability.ArkUI.ArkUI.Full 1954 * @crossplatform 1955 * @atomicservice 1956 * @since 12 1957 */ 1958 on(type: 'willClick', callback: GestureEventListenerCallback): void; 1959 1960 /** 1961 * Removes a callback function to be called before tapGesture is called. 1962 * 1963 * @param { 'willClick' } type - The type of event to remove the listener for. 1964 * @param { GestureEventListenerCallback } [callback] - The callback function to remove. If not provided, 1965 * all callbacks for the given event type will be removed. 1966 * @syscap SystemCapability.ArkUI.ArkUI.Full 1967 * @crossplatform 1968 * @atomicservice 1969 * @since 12 1970 */ 1971 off(type: 'willClick', callback?: GestureEventListenerCallback): void; 1972 1973 /** 1974 * Registers a callback function to be called after tapGesture is called. 1975 * 1976 * @param { 'didClick' } type - The type of event to listen for. 1977 * @param { GestureEventListenerCallback } callback - The callback function to be called 1978 * when the clickEvent will be trigger or after. 1979 * @syscap SystemCapability.ArkUI.ArkUI.Full 1980 * @crossplatform 1981 * @atomicservice 1982 * @since 12 1983 */ 1984 on(type: 'didClick', callback: GestureEventListenerCallback): void; 1985 1986 /** 1987 * Removes a callback function to be called after tapGesture is called. 1988 * 1989 * @param { 'didClick' } type - The type of event to remove the listener for. 1990 * @param { GestureEventListenerCallback } [callback] - The callback function to remove. If not provided, 1991 * all callbacks for the given event type will be removed. 1992 * @syscap SystemCapability.ArkUI.ArkUI.Full 1993 * @crossplatform 1994 * @atomicservice 1995 * @since 12 1996 */ 1997 off(type: 'didClick', callback?: GestureEventListenerCallback): void; 1998 1999 /** 2000 * Registers a callback function to be called when the tabContent is showed or hidden. 2001 * 2002 * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'. 2003 * @param { observer.ObserverOptions } options - The options object. 2004 * @param { Callback<observer.TabContentInfo> } callback - The callback function to be called 2005 * when the tabContent show or hide. 2006 * @syscap SystemCapability.ArkUI.ArkUI.Full 2007 * @crossplatform 2008 * @atomicservice 2009 * @since 12 2010 */ 2011 on(type: 'tabContentUpdate', options: observer.ObserverOptions, callback: Callback<observer.TabContentInfo>): void; 2012 2013 /** 2014 * Removes a callback function that was previously registered with `on()`. 2015 * 2016 * @param { 'tabContentUpdate' } type - The type of event to remove the listener for. Must be 'tabContentUpdate'. 2017 * @param { observer.ObserverOptions } options - The options object. 2018 * @param { Callback<observer.TabContentInfo> } callback - The callback function to remove. If not provided, 2019 * all callbacks for the given event type and Tabs ID will be removed. 2020 * @syscap SystemCapability.ArkUI.ArkUI.Full 2021 * @crossplatform 2022 * @atomicservice 2023 * @since 12 2024 */ 2025 off(type: 'tabContentUpdate', options: observer.ObserverOptions, callback?: Callback<observer.TabContentInfo>): void; 2026 2027 /** 2028 * Registers a callback function to be called when the tabContent is showed or hidden. 2029 * 2030 * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'. 2031 * @param { Callback<observer.TabContentInfo> } callback - The callback function to be called 2032 * when the tabContent is showed or hidden. 2033 * @syscap SystemCapability.ArkUI.ArkUI.Full 2034 * @crossplatform 2035 * @atomicservice 2036 * @since 12 2037 */ 2038 on(type: 'tabContentUpdate', callback: Callback<observer.TabContentInfo>): void; 2039 2040 /** 2041 * Removes a callback function that was previously registered with `on()`. 2042 * 2043 * @param { 'tabContentUpdate'} type - The type of event to remove the listener for. Must be 'tabContentUpdate'. 2044 * @param { Callback<observer.TabContentInfo> } callback - The callback function to remove. If not provided, 2045 * all callbacks for the given event type and Tabs ID will be removed. 2046 * @syscap SystemCapability.ArkUI.ArkUI.Full 2047 * @crossplatform 2048 * @atomicservice 2049 * @since 12 2050 */ 2051 off(type: 'tabContentUpdate', callback?: Callback<observer.TabContentInfo>): void; 2052} 2053 2054/** 2055 * class ComponentUtils 2056 * @syscap SystemCapability.ArkUI.ArkUI.Full 2057 * @crossplatform 2058 * @since 10 2059 */ 2060/** 2061 * class ComponentUtils 2062 * @syscap SystemCapability.ArkUI.ArkUI.Full 2063 * @crossplatform 2064 * @atomicservice 2065 * @since 11 2066 */ 2067export class ComponentUtils { 2068 /** 2069 * Provide the ability to obtain the coordinates and size of component drawing areas. 2070 * 2071 * @param { string } id - ID of the component whose attributes are to be obtained. 2072 * @returns { componentUtils.ComponentInfo } the object of ComponentInfo. 2073 * @throws { BusinessError } 100001 - UI execution context not found. 2074 * @syscap SystemCapability.ArkUI.ArkUI.Full 2075 * @since 10 2076 */ 2077 /** 2078 * Provide the ability to obtain the coordinates and size of component drawing areas. 2079 * 2080 * @param { string } id - ID of the component whose attributes are to be obtained. 2081 * @returns { componentUtils.ComponentInfo } the object of ComponentInfo. 2082 * @throws { BusinessError } 100001 - UI execution context not found. 2083 * @syscap SystemCapability.ArkUI.ArkUI.Full 2084 * @atomicservice 2085 * @since 11 2086 */ 2087 getRectangleById(id: string): componentUtils.ComponentInfo; 2088} 2089 2090/** 2091 * class OverlayManager 2092 * @syscap SystemCapability.ArkUI.ArkUI.Full 2093 * @crossplatform 2094 * @atomicservice 2095 * @since 12 2096 */ 2097export class OverlayManager { 2098 /** 2099 * Add the ComponentContent to the OverlayManager. 2100 * 2101 * @param { ComponentContent } content - The content will be added to the OverlayManager. 2102 * @param { number } [ index ] - The index at which to add the ComponentContent. 2103 * @syscap SystemCapability.ArkUI.ArkUI.Full 2104 * @crossplatform 2105 * @atomicservice 2106 * @since 12 2107 */ 2108 addComponentContent(content: ComponentContent, index?: number): void; 2109 2110 /** 2111 * Add the ComponentContent to the OverlayManager with order. 2112 * 2113 * @param { ComponentContent } content - The content will be added to the OverlayManager. 2114 * @param { LevelOrder } [ levelOrder ] - The display order of the ComponentContent. 2115 * @syscap SystemCapability.ArkUI.ArkUI.Full 2116 * @crossplatform 2117 * @atomicservice 2118 * @since 18 2119 */ 2120 addComponentContentWithOrder(content: ComponentContent, levelOrder?: LevelOrder): void; 2121 2122 /** 2123 * Remove the ComponentContent from the OverlayManager. 2124 * 2125 * @param { ComponentContent } content - The content will be removed from the OverlayManager. 2126 * @syscap SystemCapability.ArkUI.ArkUI.Full 2127 * @crossplatform 2128 * @atomicservice 2129 * @since 12 2130 */ 2131 removeComponentContent(content: ComponentContent): void; 2132 2133 /** 2134 * Show the ComponentContent. 2135 * 2136 * @param { ComponentContent } content - The content will be shown. 2137 * @syscap SystemCapability.ArkUI.ArkUI.Full 2138 * @crossplatform 2139 * @atomicservice 2140 * @since 12 2141 */ 2142 showComponentContent(content: ComponentContent): void; 2143 2144 /** 2145 * Hide the ComponentContent. 2146 * 2147 * @param { ComponentContent } content - The content will be hidden. 2148 * @syscap SystemCapability.ArkUI.ArkUI.Full 2149 * @crossplatform 2150 * @atomicservice 2151 * @since 12 2152 */ 2153 hideComponentContent(content: ComponentContent): void; 2154 2155 /** 2156 * Show all ComponentContents on the OverlayManager. 2157 * 2158 * @syscap SystemCapability.ArkUI.ArkUI.Full 2159 * @crossplatform 2160 * @atomicservice 2161 * @since 12 2162 */ 2163 showAllComponentContents(): void; 2164 2165 /** 2166 * Hide all ComponentContents on the OverlayManager. 2167 * 2168 * @syscap SystemCapability.ArkUI.ArkUI.Full 2169 * @crossplatform 2170 * @atomicservice 2171 * @since 12 2172 */ 2173 hideAllComponentContents(): void; 2174} 2175 2176/** 2177 * interface AtomicServiceBar 2178 * @interface AtomicServiceBar 2179 * @syscap SystemCapability.ArkUI.ArkUI.Full 2180 * @crossplatform 2181 * @since 11 2182 */ 2183/** 2184 * interface AtomicServiceBar 2185 * @interface AtomicServiceBar 2186 * @syscap SystemCapability.ArkUI.ArkUI.Full 2187 * @crossplatform 2188 * @atomicservice 2189 * @since 12 2190 */ 2191export interface AtomicServiceBar { 2192 /** 2193 * Set the visibility of the bar, except the icon. 2194 * 2195 * @param { boolean } visible - whether this bar is visible. 2196 * @syscap SystemCapability.ArkUI.ArkUI.Full 2197 * @atomicservice 2198 * @since 11 2199 */ 2200 setVisible(visible: boolean): void; 2201 2202 /** 2203 * Set the background color of the bar. 2204 * 2205 * @param { Nullable< Color | number | string> } color - the color to set, undefined indicates using default. 2206 * @syscap SystemCapability.ArkUI.ArkUI.Full 2207 * @since 11 2208 */ 2209 /** 2210 * Set the background color of the bar. 2211 * 2212 * @param { Nullable< Color | number | string> } color - the color to set, undefined indicates using default. 2213 * @syscap SystemCapability.ArkUI.ArkUI.Full 2214 * @atomicservice 2215 * @since 12 2216 */ 2217 setBackgroundColor(color: Nullable< Color | number | string>): void; 2218 2219 /** 2220 * Set the title of the bar. 2221 * 2222 * @param { string } content - the content of the bar. 2223 * @syscap SystemCapability.ArkUI.ArkUI.Full 2224 * @since 11 2225 */ 2226 /** 2227 * Set the title of the bar. 2228 * 2229 * @param { string } content - the content of the bar. 2230 * @syscap SystemCapability.ArkUI.ArkUI.Full 2231 * @atomicservice 2232 * @since 12 2233 */ 2234 setTitleContent(content: string): void; 2235 2236 /** 2237 * Set the font style of the bar's title. 2238 * 2239 * @param { FontStyle } font - the font style of the bar's title. 2240 * @syscap SystemCapability.ArkUI.ArkUI.Full 2241 * @since 11 2242 */ 2243 /** 2244 * Set the font style of the bar's title. 2245 * 2246 * @param { FontStyle } font - the font style of the bar's title. 2247 * @syscap SystemCapability.ArkUI.ArkUI.Full 2248 * @atomicservice 2249 * @since 12 2250 */ 2251 setTitleFontStyle(font: FontStyle): void; 2252 2253 /** 2254 * Set the color of the icon on the bar. 2255 * 2256 * @param { Nullable< Color | number | string> } color - the color to set to icon, undefined indicates using default. 2257 * @syscap SystemCapability.ArkUI.ArkUI.Full 2258 * @since 11 2259 */ 2260 /** 2261 * Set the color of the icon on the bar. 2262 * 2263 * @param { Nullable< Color | number | string> } color - the color to set to icon, undefined indicates using default. 2264 * @syscap SystemCapability.ArkUI.ArkUI.Full 2265 * @atomicservice 2266 * @since 12 2267 */ 2268 setIconColor(color: Nullable< Color | number | string>): void; 2269 2270 /** 2271 * Get size and position of the bar. 2272 * 2273 * @returns { Frame } The size and position of bar in vp relative to window. 2274 * @syscap SystemCapability.ArkUI.ArkUI.Full 2275 * @crossplatform 2276 * @atomicservice 2277 * @since 15 2278 */ 2279 getBarRect(): Frame; 2280} 2281 2282/** 2283 * Represents a dynamic synchronization scene. 2284 * 2285 * @syscap SystemCapability.ArkUI.ArkUI.Full 2286 * @atomicservice 2287 * @since 12 2288 */ 2289export class DynamicSyncScene { 2290 /** 2291 * Sets the FrameRateRange of the DynamicSyncScene. 2292 * 2293 * @param { ExpectedFrameRateRange } range - The range of frameRate. 2294 * @syscap SystemCapability.ArkUI.ArkUI.Full 2295 * @atomicservice 2296 * @since 12 2297 */ 2298 setFrameRateRange(range: ExpectedFrameRateRange): void; 2299 2300 /** 2301 * Gets the FrameRateRange of the DynamicSyncScene. 2302 * 2303 * @returns { ExpectedFrameRateRange } The range of frameRate. 2304 * @syscap SystemCapability.ArkUI.ArkUI.Full 2305 * @atomicservice 2306 * @since 12 2307 */ 2308 getFrameRateRange(): ExpectedFrameRateRange; 2309} 2310 2311/** 2312 * Represents a dynamic synchronization scene of Swiper. 2313 * 2314 * @extends DynamicSyncScene 2315 * @syscap SystemCapability.ArkUI.ArkUI.Full 2316 * @atomicservice 2317 * @since 12 2318 */ 2319export class SwiperDynamicSyncScene extends DynamicSyncScene { 2320 /** 2321 * Type of the SwiperDynamicSyncSceneType. 2322 * @type { SwiperDynamicSyncSceneType } 2323 * @readonly 2324 * @syscap SystemCapability.ArkUI.ArkUI.Full 2325 * @atomicservice 2326 * @since 12 2327 */ 2328 readonly type: SwiperDynamicSyncSceneType; 2329} 2330 2331/** 2332 * Represents a dynamic synchronization scene of Marquee. 2333 * 2334 * @extends DynamicSyncScene 2335 * @syscap SystemCapability.ArkUI.ArkUI.Full 2336 * @atomicservice 2337 * @since 14 2338 */ 2339export class MarqueeDynamicSyncScene extends DynamicSyncScene { 2340 /** 2341 * Type of the MarqueeDynamicSyncSceneType. 2342 * @type { MarqueeDynamicSyncSceneType } 2343 * @readonly 2344 * @syscap SystemCapability.ArkUI.ArkUI.Full 2345 * @atomicservice 2346 * @since 14 2347 */ 2348 readonly type: MarqueeDynamicSyncSceneType; 2349} 2350 2351/** 2352 * class DragController 2353 * @syscap SystemCapability.ArkUI.ArkUI.Full 2354 * @since 11 2355 */ 2356/** 2357 * class DragController 2358 * @syscap SystemCapability.ArkUI.ArkUI.Full 2359 * @atomicservice 2360 * @since 12 2361 */ 2362/** 2363 * class DragController 2364 * @syscap SystemCapability.ArkUI.ArkUI.Full 2365 * @crossplatform 2366 * @atomicservice 2367 * @since 18 2368 */ 2369export class DragController { 2370 /** 2371 * Execute a drag event. 2372 * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. 2373 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2374 * @param { AsyncCallback<{ event: DragEvent, extraParams: string }> } callback - Callback that contains 2375 * the drag event information. 2376 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2377 * <br> 1. Mandatory parameters are left unspecified. 2378 * <br> 2. Incorrect parameters types. 2379 * <br> 3. Parameter verification failed. 2380 * @throws { BusinessError } 100001 - Internal handling failed. 2381 * @syscap SystemCapability.ArkUI.ArkUI.Full 2382 * @since 11 2383 */ 2384 /** 2385 * Execute a drag event. 2386 * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. 2387 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2388 * @param { AsyncCallback<dragController.DragEventParam> } callback - Callback that contains 2389 * the drag event information. 2390 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2391 * <br> 1. Mandatory parameters are left unspecified. 2392 * <br> 2. Incorrect parameters types. 2393 * <br> 3. Parameter verification failed. 2394 * @throws { BusinessError } 100001 - Internal handling failed. 2395 * @syscap SystemCapability.ArkUI.ArkUI.Full 2396 * @atomicservice 2397 * @since 12 2398 */ 2399 /** 2400 * Execute a drag event. 2401 * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. 2402 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2403 * @param { AsyncCallback<dragController.DragEventParam> } callback - Callback that contains 2404 * the drag event information. 2405 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2406 * <br> 1. Mandatory parameters are left unspecified. 2407 * <br> 2. Incorrect parameters types. 2408 * <br> 3. Parameter verification failed. 2409 * @throws { BusinessError } 100001 - Internal handling failed. 2410 * @syscap SystemCapability.ArkUI.ArkUI.Full 2411 * @crossplatform 2412 * @atomicservice 2413 * @since 18 2414 */ 2415 executeDrag(custom: CustomBuilder | DragItemInfo, dragInfo: dragController.DragInfo, 2416 callback: AsyncCallback<dragController.DragEventParam>): void; 2417 2418 /** 2419 * Execute a drag event. 2420 * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. 2421 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2422 * @returns { Promise<{ event: DragEvent, extraParams: string }> } A Promise with the drag event information. 2423 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2424 * <br> 1. Mandatory parameters are left unspecified. 2425 * <br> 2. Incorrect parameters types. 2426 * <br> 3. Parameter verification failed. 2427 * @throws { BusinessError } 100001 - Internal handling failed. 2428 * @syscap SystemCapability.ArkUI.ArkUI.Full 2429 * @since 11 2430 */ 2431 /** 2432 * Execute a drag event. 2433 * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. 2434 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2435 * @returns { Promise<dragController.DragEventParam> } A Promise with the drag event information. 2436 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2437 * <br> 1. Mandatory parameters are left unspecified. 2438 * <br> 2. Incorrect parameters types. 2439 * <br> 3. Parameter verification failed. 2440 * @throws { BusinessError } 100001 - Internal handling failed. 2441 * @syscap SystemCapability.ArkUI.ArkUI.Full 2442 * @atomicservice 2443 * @since 12 2444 */ 2445 /** 2446 * Execute a drag event. 2447 * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. 2448 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2449 * @returns { Promise<dragController.DragEventParam> } A Promise with the drag event information. 2450 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2451 * <br> 1. Mandatory parameters are left unspecified. 2452 * <br> 2. Incorrect parameters types. 2453 * <br> 3. Parameter verification failed. 2454 * @throws { BusinessError } 100001 - Internal handling failed. 2455 * @syscap SystemCapability.ArkUI.ArkUI.Full 2456 * @crossplatform 2457 * @atomicservice 2458 * @since 18 2459 */ 2460 executeDrag(custom: CustomBuilder | DragItemInfo, dragInfo: dragController.DragInfo) 2461 : Promise<dragController.DragEventParam>; 2462 2463 /** 2464 * Create one drag action object, which can be used for starting drag later or monitoring the drag status after drag started. 2465 * @param { Array<CustomBuilder | DragItemInfo> } customArray - Objects used for prompts displayed when the objects are dragged. 2466 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2467 * @returns { dragController.DragAction } one drag action object 2468 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2469 * <br> 1. Mandatory parameters are left unspecified. 2470 * <br> 2. Incorrect parameters types. 2471 * <br> 3. Parameter verification failed. 2472 * @throws { BusinessError } 100001 - Internal handling failed. 2473 * @syscap SystemCapability.ArkUI.ArkUI.Full 2474 * @since 11 2475 */ 2476 /** 2477 * Create one drag action object, which can be used for starting drag later or monitoring the drag status after drag started. 2478 * @param { Array<CustomBuilder | DragItemInfo> } customArray - Objects used for prompts displayed when the objects are dragged. 2479 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2480 * @returns { dragController.DragAction } one drag action object 2481 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2482 * <br> 1. Mandatory parameters are left unspecified. 2483 * <br> 2. Incorrect parameters types. 2484 * <br> 3. Parameter verification failed. 2485 * @throws { BusinessError } 100001 - Internal handling failed. 2486 * @syscap SystemCapability.ArkUI.ArkUI.Full 2487 * @atomicservice 2488 * @since 12 2489 */ 2490 /** 2491 * Create one drag action object, which can be used for starting drag later or monitoring the drag status after drag started. 2492 * @param { Array<CustomBuilder | DragItemInfo> } customArray - Objects used for prompts displayed when the objects are dragged. 2493 * @param { dragController.DragInfo } dragInfo - Information about the drag event. 2494 * @returns { dragController.DragAction } one drag action object 2495 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2496 * <br> 1. Mandatory parameters are left unspecified. 2497 * <br> 2. Incorrect parameters types. 2498 * <br> 3. Parameter verification failed. 2499 * @throws { BusinessError } 100001 - Internal handling failed. 2500 * @syscap SystemCapability.ArkUI.ArkUI.Full 2501 * @crossplatform 2502 * @atomicservice 2503 * @since 18 2504 */ 2505 createDragAction(customArray: Array<CustomBuilder | DragItemInfo>, dragInfo: dragController.DragInfo): dragController.DragAction; 2506 2507 /** 2508 * Get a drag preview object, which provides the functions of setting color or updating animation and has no effect in OnDrop and OnDragEnd callback. 2509 * @returns { dragController.DragPreview } A drag preview object. 2510 * @syscap SystemCapability.ArkUI.ArkUI.Full 2511 * @since 11 2512 */ 2513 /** 2514 * Get a drag preview object. 2515 * @returns { dragController.DragPreview } A drag preview object. 2516 * @syscap SystemCapability.ArkUI.ArkUI.Full 2517 * @atomicservice 2518 * @since 12 2519 */ 2520 /** 2521 * Get a drag preview object. 2522 * @returns { dragController.DragPreview } A drag preview object. 2523 * @syscap SystemCapability.ArkUI.ArkUI.Full 2524 * @crossplatform 2525 * @atomicservice 2526 * @since 18 2527 */ 2528 getDragPreview(): dragController.DragPreview; 2529 2530 /** 2531 * Enable drag event strict reporting for drag enter and leave notification in nested situation. 2532 * For example, the parent and child both register the onDragEnter/onDragLeave events, if this 2533 * flag is enabled, the parent will be notified with leave event, and the child will notified with 2534 * enter event at the same time, when user drag action is passing through the parent and enter the 2535 * scope of the child. 2536 * Please be noted, the default value of the flag is false, it means, for the same situation, the 2537 * parent will not receive the leave notification, just the child can get the enter event, which is 2538 * not fully strict. 2539 * @param { boolean } enable - Indicating enable drag event strict reporting or not. 2540 * @syscap SystemCapability.ArkUI.ArkUI.Full 2541 * @atomicservice 2542 * @since 12 2543 */ 2544 setDragEventStrictReportingEnabled(enable: boolean): void; 2545 2546 /** 2547 * Notify the drag start request to specific pending or continue. 2548 * @param { dragController.DragStartRequestStatus } requestStatus - Status about the drag start behavior. 2549 * @syscap SystemCapability.ArkUI.ArkUI.Full 2550 * @atomicservice 2551 * @since 18 2552 */ 2553 notifyDragStartRequest(requestStatus: dragController.DragStartRequestStatus): void; 2554 2555 /** 2556 * Cancel the UDMF data sync process by passing in the data key as the identify, can only be used after the drop. 2557 * 2558 * @param { string } key - The data key returned by startDataLoading method. 2559 * @throws { BusinessError } 401 - Parameter error. 2560 * @throws { BusinessError } 190004 - Operation failed. 2561 * @syscap SystemCapability.ArkUI.ArkUI.Full 2562 * @atomicservice 2563 * @since 15 2564 */ 2565 cancelDataLoading(key: string): void; 2566} 2567 2568/** 2569 * class MeasureUtils 2570 * @syscap SystemCapability.ArkUI.ArkUI.Full 2571 * @crossplatform 2572 * @atomicservice 2573 * @since 12 2574 */ 2575export class MeasureUtils { 2576 /** 2577 * Obtains the width of the specified text in a single line layout. 2578 * 2579 * @param { MeasureOptions } options - Options. 2580 * @returns { number } 2581 * @syscap SystemCapability.ArkUI.ArkUI.Full 2582 * @crossplatform 2583 * @atomicservice 2584 * @since 12 2585 */ 2586 measureText(options: MeasureOptions): number; 2587 2588 /** 2589 * Obtains the width and height of the specified text in a single line layout. 2590 * 2591 * @param { MeasureOptions } options - Options of measure area occupied by text. 2592 * @returns { SizeOptions } width and height for text to display 2593 * @syscap SystemCapability.ArkUI.ArkUI.Full 2594 * @crossplatform 2595 * @atomicservice 2596 * @since 12 2597 */ 2598 measureTextSize(options: MeasureOptions): SizeOptions; 2599} 2600 2601/** 2602 * class FocusController 2603 * @syscap SystemCapability.ArkUI.ArkUI.Full 2604 * @atomicservice 2605 * @since 12 2606 */ 2607 export class FocusController { 2608 /** 2609 * clear focus to the root container. 2610 * @syscap SystemCapability.ArkUI.ArkUI.Full 2611 * @atomicservice 2612 * @since 12 2613 */ 2614 clearFocus(): void; 2615 2616 /** 2617 * request focus to the specific component. 2618 * @param { string } key - the inspector key of the component. 2619 * @throws { BusinessError } 150001 - the component cannot be focused. 2620 * @throws { BusinessError } 150002 - This component has an unfocusable ancestor. 2621 * @throws { BusinessError } 150003 - the component is not on tree or does not exist. 2622 * @syscap SystemCapability.ArkUI.ArkUI.Full 2623 * @atomicservice 2624 * @since 12 2625 */ 2626 requestFocus(key: string): void; 2627 2628 /** 2629 * Activate focus style. 2630 * @param { boolean } isActive - activate/deactivate the focus style. 2631 * @param { boolean } [autoInactive] - deactivate the focus style when touch event or mouse event triggers, the default value is true. 2632 * @syscap SystemCapability.ArkUI.ArkUI.Full 2633 * @crossplatform 2634 * @atomicservice 2635 * @since 14 2636 */ 2637 activate(isActive: boolean, autoInactive?: boolean): void; 2638 2639 /** 2640 * Set whether to enable autofocus transfer. 2641 * @param { boolean } isAutoFocusTransfer - A Boolean value that indicates whether autofocus transfer is enabled. 2642 * @syscap SystemCapability.ArkUI.ArkUI.Full 2643 * @crossplatform 2644 * @atomicservice 2645 * @since 14 2646 */ 2647 setAutoFocusTransfer(isAutoFocusTransfer: boolean): void; 2648 2649 /** 2650 * Set the priority of key event processing when component cannot handle the key event.. 2651 * @param { KeyProcessingMode } mode - Key processing mode. 2652 * @syscap SystemCapability.ArkUI.ArkUI.Full 2653 * @crossplatform 2654 * @atomicservice 2655 * @since 15 2656 */ 2657 setKeyProcessingMode(mode: KeyProcessingMode): void; 2658} 2659 2660/** 2661 * Pointer style. 2662 * 2663 * @typedef {pointer.PointerStyle} PointerStyle 2664 * @syscap SystemCapability.MultimodalInput.Input.Pointer 2665 * @atomicservice 2666 * @since 12 2667 */ 2668export type PointerStyle = pointer.PointerStyle; 2669 2670/** 2671 * class CursorController 2672 * 2673 * @syscap SystemCapability.ArkUI.ArkUI.Full 2674 * @crossplatform 2675 * @atomicservice 2676 * @since 12 2677 */ 2678export class CursorController { 2679 /** 2680 * Restore default cursor. 2681 * 2682 * @syscap SystemCapability.ArkUI.ArkUI.Full 2683 * @crossplatform 2684 * @atomicservice 2685 * @since 12 2686 */ 2687 restoreDefault(): void; 2688 /** 2689 * Set cursor style. 2690 * 2691 * @param { PointerStyle } value - cursor style enum. 2692 * @syscap SystemCapability.ArkUI.ArkUI.Full 2693 * @crossplatform 2694 * @atomicservice 2695 * @since 12 2696 */ 2697 setCursor(value: PointerStyle): void; 2698} 2699 2700/** 2701 * class ContextMenuController 2702 * 2703 * @syscap SystemCapability.ArkUI.ArkUI.Full 2704 * @crossplatform 2705 * @atomicservice 2706 * @since 12 2707 */ 2708export class ContextMenuController { 2709 /** 2710 * Close context menu. 2711 * 2712 * @syscap SystemCapability.ArkUI.ArkUI.Full 2713 * @crossplatform 2714 * @atomicservice 2715 * @since 12 2716 */ 2717 close(): void; 2718} 2719 2720/** 2721 * Class FrameCallback 2722 * 2723 * @syscap SystemCapability.ArkUI.ArkUI.Full 2724 * @crossplatform 2725 * @atomicservice 2726 * @since 12 2727 */ 2728export abstract class FrameCallback { 2729 /** 2730 * Call when a new display frame is being rendered. 2731 * 2732 * @param { number } frameTimeInNano - The frame time in nanoseconds. 2733 * @syscap SystemCapability.ArkUI.ArkUI.Full 2734 * @crossplatform 2735 * @atomicservice 2736 * @since 12 2737 */ 2738 onFrame(frameTimeInNano: number): void; 2739 2740 /** 2741 * Called at the end of the next idle frame. If there is no next frame, will request one automatically. 2742 * 2743 * @param { number } timeLeftInNano - The remaining time from the deadline for this frame. 2744 * @syscap SystemCapability.ArkUI.ArkUI.Full 2745 * @crossplatform 2746 * @atomicservice 2747 * @since 12 2748 */ 2749 onIdle(timeLeftInNano: number): void; 2750} 2751 2752/** 2753 * The base context of an ability or an application. It allows access to 2754 * application-specific resources. 2755 * 2756 * @typedef { common.Context } Context 2757 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2758 * @StageModelOnly 2759 * @crossplatform 2760 * @atomicservice 2761 * @since 12 2762 */ 2763export type Context = common.Context; 2764 2765/** 2766 * class ComponentSnapshot 2767 * @syscap SystemCapability.ArkUI.ArkUI.Full 2768 * @atomicservice 2769 * @since 12 2770 */ 2771export class ComponentSnapshot { 2772 /** 2773 * Get a component snapshot by component id. 2774 * 2775 * @param { string } id - Target component ID, set by developer through .id attribute. 2776 * @param { AsyncCallback<image.PixelMap> } callback - Callback that contains the snapshot in PixelMap format. 2777 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2778 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2779 * <br> 1. Mandatory parameters are left unspecified. 2780 * <br> 2. Incorrect parameters types. 2781 * <br> 3. Parameter verification failed. 2782 * @throws { BusinessError } 100001 - Invalid ID. 2783 * @syscap SystemCapability.ArkUI.ArkUI.Full 2784 * @crossplatform 2785 * @atomicservice 2786 * @since 12 2787 */ 2788 get(id: string, callback: AsyncCallback<image.PixelMap>, options?: componentSnapshot.SnapshotOptions): void; 2789 2790 /** 2791 * Get a component snapshot by component id. 2792 * 2793 * @param { string } id - Target component ID, set by developer through .id attribute. 2794 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2795 * @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format. 2796 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2797 * <br> 1. Mandatory parameters are left unspecified. 2798 * <br> 2. Incorrect parameters types. 2799 * <br> 3. Parameter verification failed. 2800 * @throws { BusinessError } 100001 - Invalid ID. 2801 * @syscap SystemCapability.ArkUI.ArkUI.Full 2802 * @crossplatform 2803 * @atomicservice 2804 * @since 12 2805 */ 2806 get(id: string, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap>; 2807 2808 /** 2809 * Generate a snapshot from a custom component builder. 2810 * 2811 * @param { CustomBuilder } builder - Builder function of a custom component. 2812 * @param { AsyncCallback<image.PixelMap> } callback - Callback that contains the snapshot in PixelMap format. 2813 * @param { number } [delay] - Defines the delay time to render the snapshot. 2814 * @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot. 2815 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2816 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2817 * <br> 1. Mandatory parameters are left unspecified. 2818 * <br> 2. Incorrect parameters types. 2819 * <br> 3. Parameter verification failed. 2820 * @throws { BusinessError } 100001 - The builder is not a valid build function. 2821 * @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for 2822 * the ready state is required when the checkImageStatus option is enabled. 2823 * @syscap SystemCapability.ArkUI.ArkUI.Full 2824 * @crossplatform 2825 * @atomicservice 2826 * @since 12 2827 */ 2828 createFromBuilder(builder: CustomBuilder, callback: AsyncCallback<image.PixelMap>, 2829 delay?: number, checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): void; 2830 2831 /** 2832 * Generate a snapshot from a custom component builder. 2833 * 2834 * @param { CustomBuilder } builder - Builder function of a custom component. 2835 * @param { number } [delay] - Defines the delay time to render the snapshot. 2836 * @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot. 2837 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2838 * @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format. 2839 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2840 * <br> 1. Mandatory parameters are left unspecified. 2841 * <br> 2. Incorrect parameters types. 2842 * <br> 3. Parameter verification failed. 2843 * @throws { BusinessError } 100001 - The builder is not a valid build function. 2844 * @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for 2845 * the ready state is required when the checkImageStatus option is enabled. 2846 * @syscap SystemCapability.ArkUI.ArkUI.Full 2847 * @crossplatform 2848 * @atomicservice 2849 * @since 12 2850 */ 2851 createFromBuilder(builder: CustomBuilder, delay?: number, 2852 checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap>; 2853 2854 /** 2855 * Take a screenshot of the specified component in synchronous mode, 2856 * this mode will block the main thread, please use it with caution, the maximum 2857 * waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown. 2858 * 2859 * @param { string } id - Target component ID, set by developer through .id attribute. 2860 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2861 * @returns { image.PixelMap } The snapshot result in PixelMap format. 2862 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2863 * <br> 1. Mandatory parameters are left unspecified. 2864 * <br> 2. Incorrect parameters types. 2865 * <br> 3. Parameter verification failed. 2866 * @throws { BusinessError } 100001 - Invalid ID. 2867 * @throws { BusinessError } 160002 - Timeout. 2868 * @syscap SystemCapability.ArkUI.ArkUI.Full 2869 * @crossplatform 2870 * @atomicservice 2871 * @since 12 2872 */ 2873 getSync(id: string, options?: componentSnapshot.SnapshotOptions): image.PixelMap; 2874 2875 /** 2876 * Get a component snapshot by uniqueId. 2877 * 2878 * @param { number } uniqueId - The uniqueId of the node, can get through getUniqueId. 2879 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2880 * @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format. 2881 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2882 * <br> 1. Mandatory parameters are left unspecified. 2883 * <br> 2. Incorrect parameters types. 2884 * <br> 3. Parameter verification failed. 2885 * @throws { BusinessError } 100001 - Invalid ID. 2886 * @syscap SystemCapability.ArkUI.ArkUI.Full 2887 * @crossplatform 2888 * @atomicservice 2889 * @since 15 2890 */ 2891 getWithUniqueId(uniqueId: number, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap>; 2892 2893 /** 2894 * Take a screenshot of the specified component in synchronous mode, 2895 * this mode will block the main thread, please use it with caution, the maximum 2896 * waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown. 2897 * 2898 * @param { number } uniqueId - The uniqueId of the node, can get through getUniqueId. 2899 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2900 * @returns { image.PixelMap } The snapshot result in PixelMap format. 2901 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2902 * <br> 1. Mandatory parameters are left unspecified. 2903 * <br> 2. Incorrect parameters types. 2904 * <br> 3. Parameter verification failed. 2905 * @throws { BusinessError } 100001 - Invalid ID. 2906 * @throws { BusinessError } 160002 - Timeout. 2907 * @syscap SystemCapability.ArkUI.ArkUI.Full 2908 * @crossplatform 2909 * @atomicservice 2910 * @since 15 2911 */ 2912 getSyncWithUniqueId(uniqueId: number, options?: componentSnapshot.SnapshotOptions): image.PixelMap; 2913 2914 /** 2915 * Generate a snapshot from a custom component content. 2916 * 2917 * @param { ComponentContent<T> } content - The content to be taken snapshot. 2918 * @param { number } [delay] - Defines the delay time to render the snapshot. 2919 * @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot. 2920 * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. 2921 * @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format. 2922 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2923 * <br> 1. Mandatory parameters are left unspecified. 2924 * <br> 2. Incorrect parameters types. 2925 * <br> 3. Parameter verification failed. 2926 * @throws { BusinessError } 100001 - The builder is not a valid build function. 2927 * @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for 2928 * the ready state is required when the checkImageStatus option is enabled. 2929 * @syscap SystemCapability.ArkUI.ArkUI.Full 2930 * @crossplatform 2931 * @atomicservice 2932 * @since 18 2933 */ 2934 createFromComponent<T extends Object>(content: ComponentContent<T>, delay?: number, 2935 checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap>; 2936} 2937 2938/** 2939 * class UIContext 2940 * 2941 * @syscap SystemCapability.ArkUI.ArkUI.Full 2942 * @crossplatform 2943 * @since 10 2944 */ 2945/** 2946 * class UIContext 2947 * 2948 * @syscap SystemCapability.ArkUI.ArkUI.Full 2949 * @crossplatform 2950 * @atomicservice 2951 * @since 11 2952 */ 2953export class UIContext { 2954 /** 2955 * get object font. 2956 * 2957 * @returns { Font } object Font. 2958 * @syscap SystemCapability.ArkUI.ArkUI.Full 2959 * @crossplatform 2960 * @since 10 2961 */ 2962 /** 2963 * get object font. 2964 * 2965 * @returns { Font } object Font. 2966 * @syscap SystemCapability.ArkUI.ArkUI.Full 2967 * @crossplatform 2968 * @atomicservice 2969 * @since 11 2970 */ 2971 getFont(): Font; 2972 2973 /** 2974 * get object mediaQuery. 2975 * 2976 * @returns { MediaQuery } object MediaQuery. 2977 * @syscap SystemCapability.ArkUI.ArkUI.Full 2978 * @crossplatform 2979 * @since 10 2980 */ 2981 /** 2982 * get object mediaQuery. 2983 * 2984 * @returns { MediaQuery } object MediaQuery. 2985 * @syscap SystemCapability.ArkUI.ArkUI.Full 2986 * @crossplatform 2987 * @atomicservice 2988 * @since 11 2989 */ 2990 getMediaQuery(): MediaQuery; 2991 2992 /** 2993 * get object UIInspector. 2994 * @returns { UIInspector } object UIInspector. 2995 * @syscap SystemCapability.ArkUI.ArkUI.Full 2996 * @crossplatform 2997 * @since 10 2998 */ 2999 /** 3000 * get object UIInspector. 3001 * @returns { UIInspector } object UIInspector. 3002 * @syscap SystemCapability.ArkUI.ArkUI.Full 3003 * @crossplatform 3004 * @atomicservice 3005 * @since 11 3006 */ 3007 getUIInspector(): UIInspector; 3008 3009 /** 3010 * get the filtered attributes of the component tree. 3011 * @param { Array<string> } [filters] - the list of filters used to filter out component tree to be obtained. 3012 * @returns { string } the specified attributes of the component tree in json string. 3013 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3014 * <br> 1. Mandatory parameters are left unspecified. 3015 * <br> 2. Incorrect parameters types. 3016 * <br> 3. Parameter verification failed. 3017 * @syscap SystemCapability.ArkUI.ArkUI.Full 3018 * @crossplatform 3019 * @atomicservice 3020 * @since 12 3021 */ 3022 getFilteredInspectorTree(filters?: Array<string>): string; 3023 3024 /** 3025 * get the filtered attributes of the component tree with the specified id and depth 3026 * @param { string } id - ID of the specified component tree to be obtained. 3027 * @param { number } depth - depth of the component tree to be obtained. 3028 * @param { Array<string> } [filters] - the list of filters used to filter out component tree to be obtained. 3029 * @returns { string } the specified attributes of the component tree in json string. 3030 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3031 * <br> 1. Mandatory parameters are left unspecified. 3032 * <br> 2. Incorrect parameters types. 3033 * <br> 3. Parameter verification failed. 3034 * @syscap SystemCapability.ArkUI.ArkUI.Full 3035 * @crossplatform 3036 * @atomicservice 3037 * @since 12 3038 */ 3039 getFilteredInspectorTreeById(id: string, depth: number, filters?: Array<string>): string; 3040 3041 /** 3042 * get object router. 3043 * 3044 * @returns { Router } object Router. 3045 * @syscap SystemCapability.ArkUI.ArkUI.Full 3046 * @crossplatform 3047 * @since 10 3048 */ 3049 /** 3050 * get object router. 3051 * 3052 * @returns { Router } object Router. 3053 * @syscap SystemCapability.ArkUI.ArkUI.Full 3054 * @crossplatform 3055 * @atomicservice 3056 * @since 11 3057 */ 3058 getRouter(): Router; 3059 3060 /** 3061 * get object PromptAction. 3062 * 3063 * @returns { PromptAction } object PromptAction. 3064 * @syscap SystemCapability.ArkUI.ArkUI.Full 3065 * @crossplatform 3066 * @since 10 3067 */ 3068 /** 3069 * get object PromptAction. 3070 * 3071 * @returns { PromptAction } object PromptAction. 3072 * @syscap SystemCapability.ArkUI.ArkUI.Full 3073 * @crossplatform 3074 * @atomicservice 3075 * @since 11 3076 */ 3077 getPromptAction(): PromptAction; 3078 3079 /** 3080 * get object ComponentUtils. 3081 * @returns { ComponentUtils } object ComponentUtils. 3082 * @syscap SystemCapability.ArkUI.ArkUI.Full 3083 * @crossplatform 3084 * @since 10 3085 */ 3086 /** 3087 * get object ComponentUtils. 3088 * @returns { ComponentUtils } object ComponentUtils. 3089 * @syscap SystemCapability.ArkUI.ArkUI.Full 3090 * @crossplatform 3091 * @atomicservice 3092 * @since 11 3093 */ 3094 getComponentUtils(): ComponentUtils; 3095 3096 /** 3097 * Get the UI observer. 3098 * 3099 * @returns { UIObserver } The UI observer. 3100 * @syscap SystemCapability.ArkUI.ArkUI.Full 3101 * @crossplatform 3102 * @since 11 3103 */ 3104 /** 3105 * Get the UI observer. 3106 * 3107 * @returns { UIObserver } The UI observer. 3108 * @syscap SystemCapability.ArkUI.ArkUI.Full 3109 * @crossplatform 3110 * @atomicservice 3111 * @since 12 3112 */ 3113 getUIObserver(): UIObserver; 3114 3115 /** 3116 * Get object OverlayManager. 3117 * 3118 * @returns { OverlayManager } object OverlayManager. 3119 * @syscap SystemCapability.ArkUI.ArkUI.Full 3120 * @crossplatform 3121 * @atomicservice 3122 * @since 12 3123 */ 3124 getOverlayManager(): OverlayManager; 3125 3126 /** 3127 * Init OverlayManager. 3128 * 3129 * @param { OverlayManagerOptions } options - Options. 3130 * @returns { boolean } Returns true if it is called first and before getting an OverlayManager instance; returns false otherwise. 3131 * @syscap SystemCapability.ArkUI.ArkUI.Full 3132 * @crossplatform 3133 * @atomicservice 3134 * @since 15 3135 */ 3136 setOverlayManagerOptions(options: OverlayManagerOptions): boolean; 3137 3138 /** 3139 * Get object OverlayManagerOptions. 3140 * 3141 * @returns { OverlayManagerOptions } object OverlayManagerOptions. 3142 * @syscap SystemCapability.ArkUI.ArkUI.Full 3143 * @crossplatform 3144 * @atomicservice 3145 * @since 15 3146 */ 3147 getOverlayManagerOptions(): OverlayManagerOptions; 3148 3149 /** 3150 * Create an animator object for custom animation. 3151 * 3152 * @param { AnimatorOptions } options - Options. 3153 * @returns { AnimatorResult } 3154 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3155 * <br> 1. Mandatory parameters are left unspecified. 3156 * <br> 2. Incorrect parameters types. 3157 * <br> 3. Parameter verification failed. 3158 * @syscap SystemCapability.ArkUI.ArkUI.Full 3159 * @crossplatform 3160 * @since 10 3161 */ 3162 /** 3163 * Create an animator object for custom animation. 3164 * 3165 * @param { AnimatorOptions } options - Options. 3166 * @returns { AnimatorResult } 3167 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3168 * <br> 1. Mandatory parameters are left unspecified. 3169 * <br> 2. Incorrect parameters types. 3170 * <br> 3. Parameter verification failed. 3171 * @syscap SystemCapability.ArkUI.ArkUI.Full 3172 * @crossplatform 3173 * @atomicservice 3174 * @since 11 3175 */ 3176 createAnimator(options: AnimatorOptions): AnimatorResult; 3177 3178 /** 3179 * Create an animator object for custom animation. 3180 * 3181 * @param { AnimatorOptions | SimpleAnimatorOptions } options - Options. 3182 * @returns { AnimatorResult } 3183 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3184 * <br> 1. Mandatory parameters are left unspecified. 3185 * <br> 2. Incorrect parameters types. 3186 * <br> 3. Parameter verification failed. 3187 * @syscap SystemCapability.ArkUI.ArkUI.Full 3188 * @crossplatform 3189 * @atomicservice 3190 * @since 18 3191 */ 3192 createAnimator(options: AnimatorOptions | SimpleAnimatorOptions): AnimatorResult; 3193 3194 /** 3195 * Defining animation function 3196 * 3197 * @param { AnimateParam } value - parameters for animation. 3198 * @param { function } event - the closure base on which, the system will create animation automatically 3199 * @syscap SystemCapability.ArkUI.ArkUI.Full 3200 * @crossplatform 3201 * @since 10 3202 */ 3203 /** 3204 * Defining animation function 3205 * 3206 * @param { AnimateParam } value - parameters for animation. 3207 * @param { function } event - the closure base on which, the system will create animation automatically 3208 * @syscap SystemCapability.ArkUI.ArkUI.Full 3209 * @crossplatform 3210 * @atomicservice 3211 * @since 11 3212 */ 3213 animateTo(value: AnimateParam, event: () => void): void; 3214 3215 /** 3216 * alertDialog display. 3217 * 3218 * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions } options - Options. 3219 * @syscap SystemCapability.ArkUI.ArkUI.Full 3220 * @crossplatform 3221 * @since 10 3222 */ 3223 /** 3224 * alertDialog display. 3225 * 3226 * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions } options - Options. 3227 * @syscap SystemCapability.ArkUI.ArkUI.Full 3228 * @crossplatform 3229 * @atomicservice 3230 * @since 11 3231 */ 3232 showAlertDialog(options: AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions): void; 3233 3234 /** 3235 * actionSheet display. 3236 * 3237 * @param { ActionSheetOptions } value - Options. 3238 * @syscap SystemCapability.ArkUI.ArkUI.Full 3239 * @crossplatform 3240 * @since 10 3241 */ 3242 /** 3243 * actionSheet display. 3244 * 3245 * @param { ActionSheetOptions } value - Options. 3246 * @syscap SystemCapability.ArkUI.ArkUI.Full 3247 * @crossplatform 3248 * @atomicservice 3249 * @since 11 3250 */ 3251 showActionSheet(value: ActionSheetOptions): void; 3252 3253 /** 3254 * datePickerDialog display. 3255 * 3256 * @param { DatePickerDialogOptions } options - Options. 3257 * @syscap SystemCapability.ArkUI.ArkUI.Full 3258 * @crossplatform 3259 * @since 10 3260 */ 3261 /** 3262 * datePickerDialog display. 3263 * 3264 * @param { DatePickerDialogOptions } options - Options. 3265 * @syscap SystemCapability.ArkUI.ArkUI.Full 3266 * @crossplatform 3267 * @atomicservice 3268 * @since 11 3269 */ 3270 showDatePickerDialog(options: DatePickerDialogOptions): void; 3271 3272 /** 3273 * timePickerDialog display. 3274 * 3275 * @param { TimePickerDialogOptions } options - Options. 3276 * @syscap SystemCapability.ArkUI.ArkUI.Full 3277 * @crossplatform 3278 * @since 10 3279 */ 3280 /** 3281 * timePickerDialog display. 3282 * 3283 * @param { TimePickerDialogOptions } options - Options. 3284 * @syscap SystemCapability.ArkUI.ArkUI.Full 3285 * @crossplatform 3286 * @atomicservice 3287 * @since 11 3288 */ 3289 showTimePickerDialog(options: TimePickerDialogOptions): void; 3290 3291 /** 3292 * textPickerDialog display. 3293 * 3294 * @param { TextPickerDialogOptions } options - Options. 3295 * @syscap SystemCapability.ArkUI.ArkUI.Full 3296 * @crossplatform 3297 * @since 10 3298 */ 3299 /** 3300 * textPickerDialog display. 3301 * 3302 * @param { TextPickerDialogOptions } options - Options. 3303 * @syscap SystemCapability.ArkUI.ArkUI.Full 3304 * @crossplatform 3305 * @atomicservice 3306 * @since 11 3307 */ 3308 showTextPickerDialog(options: TextPickerDialogOptions): void; 3309 3310 /** 3311 * Run custom functions inside the UIContext scope. 3312 * 3313 * @param { function } callback - The function called through UIContext. 3314 * @syscap SystemCapability.ArkUI.ArkUI.Full 3315 * @crossplatform 3316 * @since 10 3317 */ 3318 /** 3319 * Run custom functions inside the UIContext scope. 3320 * 3321 * @param { function } callback - The function called through UIContext. 3322 * @syscap SystemCapability.ArkUI.ArkUI.Full 3323 * @crossplatform 3324 * @atomicservice 3325 * @since 11 3326 */ 3327 runScopedTask(callback: () => void): void; 3328 3329 /** 3330 * Set KeyboardAvoidMode. The default mode is KeyboardAvoidMode.OFFSET 3331 * 3332 * @param { KeyboardAvoidMode } value - The mode of keyboard avoid. 3333 * @syscap SystemCapability.ArkUI.ArkUI.Full 3334 * @crossplatform 3335 * @atomicservice 3336 * @since 11 3337 */ 3338 setKeyboardAvoidMode(value: KeyboardAvoidMode): void; 3339 3340 /** 3341 * Get KeyboardAvoidMode. 3342 * @returns { KeyboardAvoidMode } The mode of keyboard avoid. 3343 * @syscap SystemCapability.ArkUI.ArkUI.Full 3344 * @crossplatform 3345 * @atomicservice 3346 * @since 11 3347 */ 3348 getKeyboardAvoidMode(): KeyboardAvoidMode; 3349 3350 /** 3351 * Set the pixel round mode of the system. The default mode is PixelRoundMode.PIXEL_ROUND_ON_LAYOUT_FINISH. 3352 * 3353 * @param { PixelRoundMode } mode - The mode of pixel round. 3354 * @syscap SystemCapability.ArkUI.ArkUI.Full 3355 * @crossplatform 3356 * @atomicservice 3357 * @since 18 3358 */ 3359 setPixelRoundMode(mode: PixelRoundMode): void; 3360 3361 /** 3362 * Get the pixel round mode of the system. 3363 * 3364 * @returns { PixelRoundMode } the mode of pixel round. 3365 * @syscap SystemCapability.ArkUI.ArkUI.Full 3366 * @crossplatform 3367 * @atomicservice 3368 * @since 18 3369 */ 3370 getPixelRoundMode(): PixelRoundMode; 3371 3372 /** 3373 * Dispach keyboard event to the frameNode with inspector key. 3374 * 3375 * @param { number | string } node - The uniqueId or inspector key of the target FrameNode. 3376 * @returns { boolean } Returns whether the key event is consumed. 3377 * @syscap SystemCapability.ArkUI.ArkUI.Full 3378 * @crossplatform 3379 * @atomicservice 3380 * @since 15 3381 */ 3382 dispatchKeyEvent(node: number | string, event: KeyEvent): boolean; 3383 3384 /** 3385 * Get AtomicServiceBar. 3386 * @returns { Nullable<AtomicServiceBar> } The atomic service bar. 3387 * @syscap SystemCapability.ArkUI.ArkUI.Full 3388 * @crossplatform 3389 * @atomicservice 3390 * @since 11 3391 */ 3392 getAtomicServiceBar(): Nullable<AtomicServiceBar>; 3393 3394 /** 3395 * Get DragController. 3396 * @returns { DragController } the DragController 3397 * @syscap SystemCapability.ArkUI.ArkUI.Full 3398 * @since 11 3399 */ 3400 /** 3401 * Get DragController. 3402 * @returns { DragController } the DragController 3403 * @syscap SystemCapability.ArkUI.ArkUI.Full 3404 * @atomicservice 3405 * @since 12 3406 */ 3407 /** 3408 * Get DragController. 3409 * @returns { DragController } the DragController 3410 * @syscap SystemCapability.ArkUI.ArkUI.Full 3411 * @crossplatform 3412 * @atomicservice 3413 * @since 18 3414 */ 3415 getDragController(): DragController; 3416 3417 /** 3418 * Get MeasureUtils. 3419 * @returns { MeasureUtils } the MeasureUtils 3420 * @syscap SystemCapability.ArkUI.ArkUI.Full 3421 * @crossplatform 3422 * @atomicservice 3423 * @since 12 3424 */ 3425 getMeasureUtils(): MeasureUtils; 3426 3427 /** 3428 * Defining keyframe animation function. 3429 * 3430 * @param { KeyframeAnimateParam } param - overall animation parameters 3431 * @param { Array<KeyframeState> } keyframes - all keyframe states 3432 * @syscap SystemCapability.ArkUI.ArkUI.Full 3433 * @crossplatform 3434 * @since 11 3435 */ 3436 /** 3437 * Defining keyframe animation function. 3438 * 3439 * @param { KeyframeAnimateParam } param - overall animation parameters 3440 * @param { Array<KeyframeState> } keyframes - all keyframe states 3441 * @syscap SystemCapability.ArkUI.ArkUI.Full 3442 * @crossplatform 3443 * @atomicservice 3444 * @since 12 3445 */ 3446 keyframeAnimateTo(param: KeyframeAnimateParam, keyframes: Array<KeyframeState>): void; 3447 3448 /** 3449 * Get FocusController. 3450 * @returns { FocusController } the FocusController 3451 * @syscap SystemCapability.ArkUI.ArkUI.Full 3452 * @atomicservice 3453 * @since 12 3454 */ 3455 getFocusController(): FocusController; 3456 3457 /** 3458 * Define animation functions for immediate distribution. 3459 * 3460 * @param { AnimateParam } param - Set animation effect parameters. 3461 * @param { Callback<void> } event - Specify the closure function that displays dynamic effects, 3462 * and the system will automatically insert transition animations for state changes caused by the closure function. 3463 * @syscap SystemCapability.ArkUI.ArkUI.Full 3464 * @systemapi 3465 * @since 12 3466 */ 3467 animateToImmediately(param: AnimateParam, event: Callback<void>): void; 3468 3469 /** 3470 * Get FrameNode by id. 3471 * 3472 * @param { string } id - The id of FrameNode. 3473 * @returns { FrameNode | null } The instance of FrameNode. 3474 * @syscap SystemCapability.ArkUI.ArkUI.Full 3475 * @crossplatform 3476 * @atomicservice 3477 * @since 12 3478 */ 3479 getFrameNodeById(id: string): FrameNode | null; 3480 3481 /** 3482 * Get the FrameNode attached to current window by id. 3483 * 3484 * @param { string } id - The id of FrameNode. 3485 * @returns { FrameNode | null } The instance of FrameNode. 3486 * @syscap SystemCapability.ArkUI.ArkUI.Full 3487 * @crossplatform 3488 * @atomicservice 3489 * @since 12 3490 */ 3491 getAttachedFrameNodeById(id: string): FrameNode | null; 3492 3493 /** 3494 * Get FrameNode by uniqueId. 3495 * 3496 * @param { number } id - The uniqueId of the FrameNode. 3497 * @returns { FrameNode | null } - The FrameNode with the target uniqueId, or null if the frameNode is not existed. 3498 * @syscap SystemCapability.ArkUI.ArkUI.Full 3499 * @crossplatform 3500 * @atomicservice 3501 * @since 12 3502 */ 3503 getFrameNodeByUniqueId(id: number): FrameNode | null; 3504 3505 /** 3506 * Get page information of the frameNode with uniqueId. 3507 * 3508 * @param { number } id - The uniqueId of the target FrameNode. 3509 * @returns { PageInfo } - The page information of the frameNode with the target uniqueId, includes 3510 * navDestination and router page information. If the frame node does not have navDestination and 3511 * router page information, it will return an empty object. 3512 * @syscap SystemCapability.ArkUI.ArkUI.Full 3513 * @crossplatform 3514 * @atomicservice 3515 * @since 12 3516 */ 3517 getPageInfoByUniqueId(id: number): PageInfo; 3518 3519 /** 3520 * Get navigation information of the frameNode with uniqueId. 3521 * 3522 * @param { number } id - The uniqueId of the target FrameNode. 3523 * @returns { observer.NavigationInfo | undefined } - The navigation information of the frameNode with the 3524 * target uniqueId, or undefined if the frameNode is not existed or does not have navigation information. 3525 * @syscap SystemCapability.ArkUI.ArkUI.Full 3526 * @crossplatform 3527 * @atomicservice 3528 * @since 12 3529 */ 3530 getNavigationInfoByUniqueId(id: number): observer.NavigationInfo | undefined; 3531 3532 /** 3533 * Dynamic dimming. 3534 * 3535 * @param { string } id - The id of FrameNode. 3536 * @param { number } value - Compared to the original level of dimming.value range [0,1], 3537 * set values less than 0 to 0 and values greater than 1 to 1. 3538 * @syscap SystemCapability.ArkUI.ArkUI.Full 3539 * @systemapi 3540 * @since 12 3541 */ 3542 setDynamicDimming(id: string, value: number): void; 3543 3544 /** 3545 * Get object cursor controller. 3546 * 3547 * @returns { CursorController } object cursor controller. 3548 * @syscap SystemCapability.ArkUI.ArkUI.Full 3549 * @crossplatform 3550 * @atomicservice 3551 * @since 12 3552 */ 3553 getCursorController(): CursorController; 3554 3555 /** 3556 * Get object context menu controller. 3557 * 3558 * @returns { ContextMenuController } object context menu controller. 3559 * @syscap SystemCapability.ArkUI.ArkUI.Full 3560 * @crossplatform 3561 * @atomicservice 3562 * @since 12 3563 */ 3564 getContextMenuController(): ContextMenuController; 3565 3566 /** 3567 * Get ComponentSnapshot. 3568 * @returns { ComponentSnapshot } the ComponentSnapshot 3569 * @syscap SystemCapability.ArkUI.ArkUI.Full 3570 * @atomicservice 3571 * @since 12 3572 */ 3573 getComponentSnapshot(): ComponentSnapshot; 3574 3575 /** 3576 * Converts a value in vp units to a value in px. 3577 * @param { number } value 3578 * @returns { number } 3579 * @syscap SystemCapability.ArkUI.ArkUI.Full 3580 * @atomicservice 3581 * @since 12 3582 */ 3583 vp2px(value: number): number; 3584 3585 /** 3586 * Converts a value in px units to a value in vp. 3587 * @param { number } value 3588 * @returns { number } 3589 * @syscap SystemCapability.ArkUI.ArkUI.Full 3590 * @atomicservice 3591 * @since 12 3592 */ 3593 px2vp(value: number): number; 3594 3595 /** 3596 * Converts a value in fp units to a value in px. 3597 * @param { number } value 3598 * @returns { number } 3599 * @syscap SystemCapability.ArkUI.ArkUI.Full 3600 * @atomicservice 3601 * @since 12 3602 */ 3603 fp2px(value: number): number; 3604 3605 /** 3606 * Converts a value in px units to a value in fp. 3607 * @param { number } value 3608 * @returns { number } 3609 * @syscap SystemCapability.ArkUI.ArkUI.Full 3610 * @atomicservice 3611 * @since 12 3612 */ 3613 px2fp(value: number): number; 3614 3615 /** 3616 * Converts a value in lpx units to a value in px. 3617 * @param { number } value 3618 * @returns { number } 3619 * @syscap SystemCapability.ArkUI.ArkUI.Full 3620 * @atomicservice 3621 * @since 12 3622 */ 3623 lpx2px(value: number): number; 3624 3625 /** 3626 * Converts a value in px units to a value in lpx. 3627 * @param { number } value 3628 * @returns { number } 3629 * @syscap SystemCapability.ArkUI.ArkUI.Full 3630 * @atomicservice 3631 * @since 12 3632 */ 3633 px2lpx(value: number): number; 3634 3635 /** 3636 * Get current LocalStorage shared from stage. 3637 * 3638 * @returns { LocalStorage | undefined } 3639 * @syscap SystemCapability.ArkUI.ArkUI.Full 3640 * @stagemodelonly 3641 * @crossplatform 3642 * @atomicservice 3643 * @since 12 3644 */ 3645 getSharedLocalStorage(): LocalStorage | undefined; 3646 3647 /** 3648 * Obtains context of the ability. 3649 * 3650 * @returns { Context | undefined } 3651 * @syscap SystemCapability.ArkUI.ArkUI.Full 3652 * @stagemodelonly 3653 * @crossplatform 3654 * @atomicservice 3655 * @since 12 3656 */ 3657 getHostContext(): Context | undefined; 3658 3659 /** 3660 * Get the name of current window. 3661 * 3662 * @returns { string | undefined } The name of current window, or undefined if the window doesn't exist. 3663 * @syscap SystemCapability.ArkUI.ArkUI.Full 3664 * @crossplatform 3665 * @atomicservice 3666 * @since 12 3667 */ 3668 getWindowName(): string | undefined; 3669 3670 /** 3671 * Get the width breakpoint of current window. 3672 * 3673 * @returns { WidthBreakpoint } The width breakpoint of current window. 3674 * @syscap SystemCapability.ArkUI.ArkUI.Full 3675 * @atomicservice 3676 * @since 13 3677 */ 3678 getWindowWidthBreakpoint(): WidthBreakpoint; 3679 3680 /** 3681 * Get the height breakpoint of current window. 3682 * 3683 * @returns { HeightBreakpoint } The height breakpoint of current window. 3684 * @syscap SystemCapability.ArkUI.ArkUI.Full 3685 * @atomicservice 3686 * @since 13 3687 */ 3688 getWindowHeightBreakpoint(): HeightBreakpoint; 3689 3690 /** 3691 * Open the BindSheet. 3692 * 3693 * @param { ComponentContent<T> } bindSheetContent - The content of BindSheet. 3694 * @param { SheetOptions } sheetOptions - The options of sheet. 3695 * @param { number } targetId - The uniqueId of the FrameNode to which BindSheet is attached. 3696 * @returns { Promise<void> } The promise returned by the function. 3697 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3698 * <br> 1. Mandatory parameters are left unspecified. 3699 * <br> 2. Incorrect parameters types. 3700 * <br> 3. Parameter verification failed. 3701 * @throws { BusinessError } 120001 - The bindSheetContent is incorrect. 3702 * @throws { BusinessError } 120002 - The bindSheetContent already exists. 3703 * @throws { BusinessError } 120004 - The targetId does not exist. 3704 * @throws { BusinessError } 120005 - The node of targetId is not in the component tree. 3705 * @throws { BusinessError } 120006 - The node of targetId is not a child of the page node or NavDestination node. 3706 * @syscap SystemCapability.ArkUI.ArkUI.Full 3707 * @crossplatform 3708 * @atomicservice 3709 * @since 12 3710 */ 3711 openBindSheet<T extends Object>(bindSheetContent: ComponentContent<T>, sheetOptions?: SheetOptions, targetId?: number): Promise<void>; 3712 3713 /** 3714 * Update the BindSheet with sheetOptions. 3715 * 3716 * @param { ComponentContent<T> } bindSheetContent - The content of BindSheet. 3717 * @param { SheetOptions } sheetOptions - The update options of sheet. 3718 * @param { boolean } partialUpdate - If true, only the specified properties in the sheetOptions are updated, 3719 * otherwise the rest of the properties are overwritten with the default values. 3720 * Default value is false. 3721 * @returns { Promise<void> } The promise returned by the function. 3722 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3723 * <br> 1. Mandatory parameters are left unspecified. 3724 * <br> 2. Incorrect parameters types. 3725 * <br> 3. Parameter verification failed. 3726 * @throws { BusinessError } 120001 - The bindSheetContent is incorrect. 3727 * @throws { BusinessError } 120003 - The bindSheetContent cannot be found. 3728 * @syscap SystemCapability.ArkUI.ArkUI.Full 3729 * @crossplatform 3730 * @atomicservice 3731 * @since 12 3732 */ 3733 updateBindSheet<T extends Object>(bindSheetContent: ComponentContent<T>, sheetOptions: SheetOptions, partialUpdate?: boolean): Promise<void>; 3734 3735 /** 3736 * Close the BindSheet. 3737 * 3738 * @param { ComponentContent<T> } bindSheetContent - The content of BindSheet. 3739 * @returns { Promise<void> } The promise returned by the function. 3740 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3741 * <br> 1. Mandatory parameters are left unspecified. 3742 * <br> 2. Incorrect parameters types. 3743 * <br> 3. Parameter verification failed. 3744 * @throws { BusinessError } 120001 - The bindSheetContent is incorrect. 3745 * @throws { BusinessError } 120003 - The bindSheetContent cannot be found. 3746 * @syscap SystemCapability.ArkUI.ArkUI.Full 3747 * @crossplatform 3748 * @atomicservice 3749 * @since 12 3750 */ 3751 closeBindSheet<T extends Object>(bindSheetContent: ComponentContent<T>): Promise<void>; 3752 3753 /** 3754 * Post a frame callback to run on the next frame. 3755 * 3756 * @param { FrameCallback } frameCallback - The frame callback to run on the next frame. 3757 * @syscap SystemCapability.ArkUI.ArkUI.Full 3758 * @atomicservice 3759 * @since 12 3760 */ 3761 postFrameCallback(frameCallback: FrameCallback): void; 3762 3763 /** 3764 * Post a frame callback to run on the next frame after the specified delay. 3765 * 3766 * @param { FrameCallback } frameCallback - The frame callback to run on the next frame. 3767 * @param { number } delayTime - The delay time in milliseconds, 3768 * @syscap SystemCapability.ArkUI.ArkUI.Full 3769 * @atomicservice 3770 * @since 12 3771 */ 3772 postDelayedFrameCallback(frameCallback: FrameCallback, delayTime: number): void; 3773 3774 /** 3775 * Require DynamicSyncScene by id. 3776 * 3777 * @param { string } id - The id of DynamicSyncScene. 3778 * @returns { Array<DynamicSyncScene>} The instance of SwiperDynamicSyncScene. 3779 * @syscap SystemCapability.ArkUI.ArkUI.Full 3780 * @atomicservice 3781 * @since 12 3782 */ 3783 requireDynamicSyncScene(id: string): Array<DynamicSyncScene>; 3784 3785 /** 3786 * Clear the cache generated by using $r/$rawfile to retrieve resources. This cache is used to accelerate the process 3787 * of repeatedly loading resources. Clearing this cache may slow down the loading speed of resources during page overload. 3788 * 3789 * @throws { BusinessError } 202 - The caller is not a system application. 3790 * @syscap SystemCapability.ArkUI.ArkUI.Full 3791 * @systemapi 3792 * @atomicservice 3793 * @since 12 3794 */ 3795 /** 3796 * Clear the cache generated by using $r/$rawfile to retrieve resources. This cache is used to accelerate the process 3797 * of repeatedly loading resources. Clearing this cache may slow down the loading speed of resources during page overload. 3798 * 3799 * @throws { BusinessError } 202 - The caller is not a system application. 3800 * @syscap SystemCapability.ArkUI.ArkUI.Full 3801 * @systemapi 3802 * @since 13 3803 */ 3804 clearResourceCache(): void; 3805 3806 /** 3807 * Checks whether current font scale follows the system. 3808 * 3809 * @returns { boolean } Returns true if current font scale follows the system; returns false otherwise. 3810 * @syscap SystemCapability.ArkUI.ArkUI.Full 3811 * @crossplatform 3812 * @atomicservice 3813 * @since 13 3814 */ 3815 isFollowingSystemFontScale(): boolean; 3816 3817 /** 3818 * Get the max font scale. 3819 * 3820 * @returns { number } The max font scale. 3821 * @syscap SystemCapability.ArkUI.ArkUI.Full 3822 * @crossplatform 3823 * @atomicservice 3824 * @since 13 3825 */ 3826 getMaxFontScale(): number; 3827 3828 /** 3829 * Bind tabs to scrollable container component to automatically hide tab bar. 3830 * 3831 * @param { TabsController } tabsController - The controller of the tabs. 3832 * @param { Scroller } scroller - The controller of the scrollable container component. 3833 * @syscap SystemCapability.ArkUI.ArkUI.Full 3834 * @crossplatform 3835 * @atomicservice 3836 * @since 13 3837 */ 3838 bindTabsToScrollable(tabsController: TabsController, scroller: Scroller): void; 3839 3840 /** 3841 * Unbind tabs from scrollable container component. 3842 * 3843 * @param { TabsController } tabsController - The controller of the tabs. 3844 * @param { Scroller } scroller - The controller of the scrollable container component. 3845 * @syscap SystemCapability.ArkUI.ArkUI.Full 3846 * @crossplatform 3847 * @atomicservice 3848 * @since 13 3849 */ 3850 unbindTabsFromScrollable(tabsController: TabsController, scroller: Scroller): void; 3851 3852 /** 3853 * Bind tabs to nested scrollable container components to automatically hide tab bar. 3854 * 3855 * @param { TabsController } tabsController - The controller of the tabs. 3856 * @param { Scroller } parentScroller - The controller of the parent scrollable container component. 3857 * @param { Scroller } childScroller - The controller of the child scrollable container component. 3858 * @syscap SystemCapability.ArkUI.ArkUI.Full 3859 * @crossplatform 3860 * @atomicservice 3861 * @since 13 3862 */ 3863 bindTabsToNestedScrollable(tabsController: TabsController, parentScroller: Scroller, childScroller: Scroller): void; 3864 3865 /** 3866 * Unbind tabs from nested scrollable container components. 3867 * 3868 * @param { TabsController } tabsController - The controller of the tabs. 3869 * @param { Scroller } parentScroller - The controller of the parent scrollable container component. 3870 * @param { Scroller } childScroller - The controller of the child scrollable container component. 3871 * @syscap SystemCapability.ArkUI.ArkUI.Full 3872 * @crossplatform 3873 * @atomicservice 3874 * @since 13 3875 */ 3876 unbindTabsFromNestedScrollable(tabsController: TabsController, parentScroller: Scroller, childScroller: Scroller): void; 3877 3878 /** 3879 * whether to enable or disable swipe to back event. 3880 * 3881 * @param { Optional<boolean> } enabled - enable or disable swipe to back event. 3882 * @syscap SystemCapability.ArkUI.ArkUI.Circle 3883 * @atomicservice 3884 * @since 18 3885 */ 3886 enableSwipeBack(enabled: Optional<boolean>): void; 3887 3888 /** 3889 * Sets the component freezing flag based on the component id to prevent the 3890 * UI component from marking and updating dirty areas. 3891 * @param { string } id - Id of the frame node. 3892 * @param { boolean } isFrozen - whether the component is frozen. 3893 * @throws { BusinessError } 202 - The caller is not a system application. 3894 * @syscap SystemCapability.ArkUI.ArkUI.Full 3895 * @systemapi 3896 * @since 18 3897 */ 3898 freezeUINode(id: string, isFrozen: boolean): void; 3899 3900 /** 3901 * Sets the component freezing flag based on the component uniqueId to prevent the 3902 * UI component from marking and updating dirty areas. 3903 * @param { number } uniqueId - Unique Id of the frame node. 3904 * @param { boolean } isFrozen - whether the component is frozen. 3905 * @throws { BusinessError } 202 - The caller is not a system application. 3906 * @syscap SystemCapability.ArkUI.ArkUI.Full 3907 * @systemapi 3908 * @since 18 3909 */ 3910 freezeUINode(uniqueId: number, isFrozen: boolean): void; 3911 3912 /** 3913 * Get object text menu controller. 3914 * 3915 * @returns { TextMenuController } object text menu controller. 3916 * @syscap SystemCapability.ArkUI.ArkUI.Full 3917 * @crossplatform 3918 * @atomicservice 3919 * @since 16 3920 */ 3921 getTextMenuController(): TextMenuController; 3922 3923 /** 3924 * Create a UI instance singleton without window and get its UIContext object. 3925 * 3926 * @param { common.UIAbilityContext | common.ExtensionContext } context - UIAbilityContext or ExtensionContext. 3927 * @returns { UIContext | undefined } object UIContext, or undefined when failed. 3928 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3929 * <br> 1. The number of parameters is incorrect. 3930 * <br> 2. Invalid parameter type of context. 3931 * @throws { BusinessError } 100001 - Internal error. 3932 * @static 3933 * @syscap SystemCapability.ArkUI.ArkUI.Full 3934 * @atomicservice 3935 * @since 17 3936 */ 3937 static createUIContextWithoutWindow(context: common.UIAbilityContext | common.ExtensionContext) : UIContext | undefined; 3938 3939 /** 3940 * Destroy the UI instance singleton without window. 3941 * 3942 * @static 3943 * @syscap SystemCapability.ArkUI.ArkUI.Full 3944 * @atomicservice 3945 * @since 17 3946 */ 3947 static destroyUIContextWithoutWindow(): void; 3948} 3949 3950/** 3951 * Enum of KeyBoardAvoidMethodType 3952 * 3953 * @enum { number } KeyBoardAvoidMethodType 3954 * @syscap SystemCapability.ArkUI.ArkUI.Full 3955 * @crossplatform 3956 * @atomicservice 3957 * @since 11 3958 */ 3959 3960export const enum KeyboardAvoidMode { 3961 /** 3962 * Default Type, offset the whole page when keyBoard height changed. 3963 * @syscap SystemCapability.ArkUI.ArkUI.Full 3964 * @crossplatform 3965 * @atomicservice 3966 * @since 11 3967 */ 3968 OFFSET = 0, 3969 3970 /** 3971 * Resize Type, resize the page when keyBoard height changed. 3972 * @syscap SystemCapability.ArkUI.ArkUI.Full 3973 * @crossplatform 3974 * @atomicservice 3975 * @since 11 3976 */ 3977 RESIZE = 1, 3978 3979 /** 3980 * Offset Type, offset the whole page when caret position or keyboard height changed. 3981 * @syscap SystemCapability.ArkUI.ArkUI.Full 3982 * @crossplatform 3983 * @atomicservice 3984 * @since 14 3985 */ 3986 OFFSET_WITH_CARET = 2, 3987 3988 /** 3989 * Resize Type, resize the whole page when when caret position or keyboard height changed. 3990 * @syscap SystemCapability.ArkUI.ArkUI.Full 3991 * @crossplatform 3992 * @atomicservice 3993 * @since 14 3994 */ 3995 RESIZE_WITH_CARET = 3, 3996 3997 /** 3998 * None Type, nothing to do when keyboard height changed. 3999 * @syscap SystemCapability.ArkUI.ArkUI.Full 4000 * @crossplatform 4001 * @atomicservice 4002 * @since 14 4003 */ 4004 NONE = 4, 4005} 4006 4007/** 4008 * Enum of SwiperDynamicSyncSceneType 4009 * 4010 * @enum { number } SwiperDynamicSyncSceneType 4011 * @syscap SystemCapability.ArkUI.ArkUI.Full 4012 * @atomicservice 4013 * @since 12 4014 */ 4015export const enum SwiperDynamicSyncSceneType { 4016 /** 4017 * Scene type is GESTURE. 4018 * 4019 * @syscap SystemCapability.ArkUI.ArkUI.Full 4020 * @atomicservice 4021 * @since 12 4022 */ 4023 GESTURE = 0, 4024 4025 /** 4026 * Scene type is ANIMATION. 4027 * 4028 * @syscap SystemCapability.ArkUI.ArkUI.Full 4029 * @atomicservice 4030 * @since 12 4031 */ 4032 ANIMATION = 1 4033} 4034 4035/** 4036 * Enum of scene type for Marquee 4037 * 4038 * @enum { number } MarqueeDynamicSyncSceneType 4039 * @syscap SystemCapability.ArkUI.ArkUI.Full 4040 * @atomicservice 4041 * @since 14 4042 */ 4043export const enum MarqueeDynamicSyncSceneType { 4044 /** 4045 * Scene type is ANIMATION. 4046 * 4047 * @syscap SystemCapability.ArkUI.ArkUI.Full 4048 * @atomicservice 4049 * @since 14 4050 */ 4051 ANIMATION = 1 4052} 4053 4054/** 4055 * class TextMenuController 4056 * 4057 * @syscap SystemCapability.ArkUI.ArkUI.Full 4058 * @crossplatform 4059 * @atomicservice 4060 * @since 16 4061 */ 4062export class TextMenuController { 4063 /** 4064 * Set text menu options. 4065 * 4066 * @syscap SystemCapability.ArkUI.ArkUI.Full 4067 * @crossplatform 4068 * @atomicservice 4069 * @since 16 4070 */ 4071 setMenuOptions(options: TextMenuOptions): void; 4072} 4073