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