/* * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file * @kit ArkUI */ import font from './@ohos.font'; import mediaQuery from './@ohos.mediaquery'; import type inspector from './@ohos.arkui.inspector'; import promptAction, { LevelOrder } from './@ohos.promptAction'; import router from './@ohos.router'; import type componentUtils from './@ohos.arkui.componentUtils'; /*** if arkts 1.1 */ import { ComponentContent, FrameNode, Frame } from './@ohos.arkui.node'; import type { AnimatorOptions, AnimatorResult } from './@ohos.animator'; import type observer from './@ohos.arkui.observer'; /*** endif */ import { SimpleAnimatorOptions } from './@ohos.animator'; import type { Callback, AsyncCallback } from './@ohos.base'; import { MeasureOptions } from './@ohos.measure'; import type componentSnapshot from './@ohos.arkui.componentSnapshot'; import type dragController from './@ohos.arkui.dragController'; import image from './@ohos.multimedia.image'; import type common from './@ohos.app.ability.common'; import type pointer from './@ohos.multimodalInput.pointer'; /*** if arkts 1.2 */ import { ComponentContent, FrameNode, Frame } from '@ohos.arkui.node'; import type observer from '@ohos.arkui.observer'; import { AnimatorOptions, AnimatorResult } from './@ohos.animator'; import { ClickEvent, ExpectedFrameRateRange, DragItemInfo, AnimateParam, KeyframeAnimateParam, KeyframeState, SheetOptions, PopupCommonOptions, MenuOptions, KeyEvent, Optional } from './arkui/component/common'; import { CustomBuilder } from './arkui/component/builder'; import { GestureEvent, GestureRecognizer } from './arkui/component/gesture'; import { ResourceStr, SizeOptions, VoidCallback } from './arkui/component/units'; import { Nullable, Color, FontStyle, WidthBreakpoint, HeightBreakpoint, PixelRoundMode } from './arkui/component/enums'; import { TimePickerDialogOptions } from './arkui/component/timePicker'; import { AlertDialogParamWithConfirm, AlertDialogParamWithButtons, AlertDialogParamWithOptions } from './arkui/component/alertDialog'; import { ActionSheetOptions } from './arkui/component/actionSheet'; import { TextPickerDialogOptions } from './arkui/component/textPicker'; import { LocalStorage } from './arkui/stateManagement/storages/localStorage'; import { DatePickerDialogOptions } from './arkui/component/datePicker'; import { TabsController } from './arkui/component/tabs'; import { Scroller } from './arkui/component/scroll'; import { KeyProcessingMode } from './arkui/component/focus'; import { TextMenuOptions } from './arkui/component/textCommon'; /*** endif */ /** * class Font * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class Font * *

NOTE: *
You must first use getFont() in UIContext to obtain a Font instance, * and then call the APIs using the obtained instance. *

* * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ export declare class Font { /** * Register a customized font in the FontManager. * * @param { font.FontOptions } options - FontOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Register a customized font in the FontManager. * * @param { font.FontOptions } options - FontOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ registerFont(options: font.FontOptions): void; /** * Gets a list of fonts supported by system. * @returns { Array } A list of font names * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Gets a list of fonts supported by system. * *

NOTE: *
This API takes effect only on 2-in-1 devices. *

* * @returns { Array } A list of font names * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getSystemFontList(): Array; /** * Get font details according to the font name. * @param { string } fontName - font name * @returns { font.FontInfo } Returns the font info * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Get font details according to the font name. * @param { string } fontName - font name * @returns { font.FontInfo } Returns the font info * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getFontByName(fontName: string): font.FontInfo; } /** * class MediaQuery * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class MediaQuery * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ export declare class MediaQuery { /** * Sets the media query criteria and returns the corresponding listening handle * * @param { string } condition - media conditions * @returns { mediaQuery.MediaQueryListener } the corresponding listening handle * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the media query criteria and returns the corresponding listening handle * * @param { string } condition - media conditions * @returns { mediaQuery.MediaQueryListener } the corresponding listening handle * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ matchMediaSync(condition: string): mediaQuery.MediaQueryListener; } /** * class UIInspector * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class UIInspector * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ export declare class UIInspector { /** * Sets the component after layout or draw criteria and returns the corresponding listening handle * @param { string } id - component id. * @returns { inspector.ComponentObserver } create listener for observer component event. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the component after layout or draw criteria and returns the corresponding listening handle * @param { string } id - component id. * @returns { inspector.ComponentObserver } create listener for observer component event. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ createComponentObserver(id: string): inspector.ComponentObserver; } /** * class Router * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class Router * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * class Router * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class Router { /** * Navigates to a specified page in the application. * * @param { router.RouterOptions } options - Page routing parameters. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a specified page in the application. * * @param { router.RouterOptions } options - Page routing parameters. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushUrl(options: router.RouterOptions, callback: AsyncCallback): void; /** * Navigates to a specified page in the application. This API uses a promise to return the result. * * @param { router.RouterOptions } options - Page routing parameters. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a specified page in the application. This API uses a promise to return the result. * * @param { router.RouterOptions } options - Page routing parameters. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushUrl(options: router.RouterOptions): Promise; /** * Navigates to a specified page in the application. * * @param { router.RouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a specified page in the application. * * @param { router.RouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushUrl(options: router.RouterOptions, mode: router.RouterMode, callback: AsyncCallback): void; /** * Navigates to a specified page in the application. This API uses a promise to return the result. * * @param { router.RouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a specified page in the application. This API uses a promise to return the result. * * @param { router.RouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100002 - Uri error. The URI of the page to redirect is incorrect or does not exist * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushUrl(options: router.RouterOptions, mode: router.RouterMode): Promise; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @param { AsyncCallback } callback - the callback of replaceUrl. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @param { AsyncCallback } callback - the callback of replaceUrl. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceUrl(options: router.RouterOptions, callback: AsyncCallback): void; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceUrl(options: router.RouterOptions): Promise; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @param { AsyncCallback } callback - the callback of replaceUrl. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @param { AsyncCallback } callback - the callback of replaceUrl. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceUrl(options: router.RouterOptions, mode: router.RouterMode, callback: AsyncCallback): void; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * * @param { router.RouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. * @throws { BusinessError } 200002 - Uri error. The URI of the page to be used for replacement is incorrect or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceUrl(options: router.RouterOptions, mode: router.RouterMode): Promise; /** * Returns to the previous page or a specified page. * * @param { router.RouterOptions } options - Description of the page. *
The **url** parameter indicates the URL of the page to return to. *
If the specified page does not exist in the page stack, the application does not respond. *
If no URL is set, the application returns to the previous page, and the page is not rebuilt. *
The page in the page stack is not reclaimed. It will be reclaimed after being popped up. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Returns to the previous page or a specified page. * * @param { router.RouterOptions } options - Description of the page. *
The **url** parameter indicates the URL of the page to return to. *
If the specified page does not exist in the page stack, the application does not respond. *
If no URL is set, the application returns to the previous page, and the page is not rebuilt. *
The page in the page stack is not reclaimed. It will be reclaimed after being popped up. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ back(options?: router.RouterOptions): void; /** * Returns to the specified page. * * @param { number } index - Index of the target page to navigate to. * @param { Object } [params] - Parameters carried when returning to the page. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ back(index: number, params?: Object): void; /** * Clears all historical pages and retains only the current page at the top of the stack. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Clears all historical pages and retains only the current page at the top of the stack. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ clear(): void; /** * Obtains the number of pages in the current stack. * * @returns { string } Number of pages in the stack. The maximum value is 32. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Obtains the number of pages in the current stack. * * @returns { string } Number of pages in the stack. The maximum value is 32. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getLength(): string; /** * Obtains information about the current page state. * * @returns { router.RouterState } Page routing state. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Obtains information about the current page state. * * @returns { router.RouterState } Page routing state. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getState(): router.RouterState; /** * Obtains page information by index. * * @param { number } index - Index of page. * @returns { router.RouterState | undefined } Page state. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getStateByIndex(index: number): router.RouterState | undefined; /** * Obtains page information by url. * * @param { string } url - URL of page. * @returns { Array } Page state. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getStateByUrl(url: string): Array; /** * Pop up alert dialog to ask whether to back. * * @param { router.EnableAlertOptions } options - Options. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Pop up alert dialog to ask whether to back. * * @param { router.EnableAlertOptions } options - Options. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showAlertBeforeBackPage(options: router.EnableAlertOptions): void; /** * Hide alert before back page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Hide alert before back page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ hideAlertBeforeBackPage(): void; /** * Obtains information about the current page params. * * @returns { Object } Page params. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Obtains information about the current page params. * * @returns { Object } Page params. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getParams(): Object; /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushNamedRoute(options: router.NamedRouterOptions, callback: AsyncCallback): void; /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushNamedRoute(options: router.NamedRouterOptions): Promise; /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode, callback: AsyncCallback): void; /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Navigates to a page using the named route. This API uses a promise to return the result. * @param { router.NamedRouterOptions } options - Page routing parameters. * @param { router.RouterMode } mode - Routing mode. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 100003 - Page stack error. Too many pages are pushed. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ pushNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode): Promise; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @param { AsyncCallback } callback - the callback of replaceNamedRoute. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @param { AsyncCallback } callback - the callback of replaceNamedRoute. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceNamedRoute(options: router.NamedRouterOptions, callback: AsyncCallback): void; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - if the number of parameters is less than 1 or the type of the url parameter is not string. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceNamedRoute(options: router.NamedRouterOptions): Promise; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @param { AsyncCallback } callback - the callback of replaceNamedRoute. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @param { AsyncCallback } callback - the callback of replaceNamedRoute. * @throws { BusinessError } 401 - if the number of parameters is less than 1 or the type of the url parameter is not string. * @throws { BusinessError } 100001 - The UI execution context is not found. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode, callback: AsyncCallback): void; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. * @param { router.NamedRouterOptions } options - Options. * @param { router.RouterMode } mode - RouterMode. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Failed to get the delegate. This error code is thrown only in the standard system. * @throws { BusinessError } 100004 - Named route error. The named route does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ replaceNamedRoute(options: router.NamedRouterOptions, mode: router.RouterMode): Promise; } /** * Defines the custom builder with id. * * @typedef { function } CustomBuilderWithId * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ declare type CustomBuilderWithId = (id: number) => void; /** * Defines the target info. * * @interface TargetInfo * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ export interface TargetInfo { /** * ID of target node. * * @type { string | number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ id: string | number; /** * Unique ID that generated by framework. This ID used to constrain range of target. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ componentId?: number; } /** * class PromptAction * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class PromptAction * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ export declare class PromptAction { /** * Displays the notification text. * * @param { promptAction.ShowToastOptions } options - Options. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Shows a toast in the given settings. * * @param { promptAction.ShowToastOptions } options - Toast options. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showToast(options: promptAction.ShowToastOptions): void; /** * Displays the notification text. * * @param { promptAction.ShowToastOptions } options - Options. * @returns { Promise } return the toast id that will be used by closeToast. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ openToast(options: promptAction.ShowToastOptions): Promise; /** * Close the notification text. * * @param { number } toastId - the toast id that returned by openToast. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @throws { BusinessError } 103401 - Cannot find the toast. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ closeToast(toastId: number): void; /** * Displays the dialog box. * * @param { promptAction.ShowDialogOptions } options - Options. * @param { AsyncCallback } callback - the callback of showDialog. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Displays the dialog box. * * @param { promptAction.ShowDialogOptions } options - Options. * @param { AsyncCallback } callback - the callback of showDialog. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Shows a dialog box in the given settings. This API uses an asynchronous callback to return the result. * * @param { promptAction.ShowDialogOptions } options - Dialog box options. * @param { AsyncCallback } callback - Callback used to return the dialog * box response result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ showDialog(options: promptAction.ShowDialogOptions, callback: AsyncCallback): void; /** * Displays the dialog box. * * @param { promptAction.ShowDialogOptions } options - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Shows a dialog box. This API uses a promise to return the result. * * @param { promptAction.ShowDialogOptions } options - Dialog box options. * @returns { Promise } Promise used to return the dialog * box response result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showDialog(options: promptAction.ShowDialogOptions): Promise; /** * Shows an action menu in the given settings. This API uses an asynchronous callback to return the result. * * @param { promptAction.ActionMenuOptions } options - Action menu options. * @param { promptAction.ActionMenuSuccessResponse } callback - Callback used to return the action menu * response result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @deprecated since 11 * @useinstead showActionMenu */ showActionMenu(options: promptAction.ActionMenuOptions, callback: promptAction.ActionMenuSuccessResponse): void; /** * Shows an action menu in the given settings. This API uses an asynchronous callback to return the result. * * @param { promptAction.ActionMenuOptions } options - Action menu options. * @param { AsyncCallback } callback - Callback used to return the action * menu response result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showActionMenu(options: promptAction.ActionMenuOptions, callback: AsyncCallback): void; /** * Displays the menu. * * @param { promptAction.ActionMenuOptions } options - Options. * @returns { Promise } callback - the callback of showActionMenu. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Shows an action menu in the given settings. This API uses an asynchronous callback to return the result. * * @param { promptAction.ActionMenuOptions } options - Action menu options. * @returns { Promise } callback - Promise used to return the action * menu response result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showActionMenu(options: promptAction.ActionMenuOptions): Promise; /** * Open the custom dialog with frameNode. * * @param { ComponentContent } dialogContent - the content of custom dialog. * @param { promptAction.BaseDialogOptions } options - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - Dialog content error. The ComponentContent is incorrect. * @throws { BusinessError } 103302 - Dialog content already exist. The ComponentContent has already been opened. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ openCustomDialog(dialogContent: ComponentContent, options?: promptAction.BaseDialogOptions): Promise; /** * Open the custom dialog with frameNode and controller. * * isModal = true and showInSubWindow = true cannot be used at the same time. * * @param { ComponentContent } dialogContent - the content of custom dialog. * @param { promptAction.DialogController } controller - Dialog controller. * @param { promptAction.BaseDialogOptions } [options] - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - Dialog content error. The ComponentContent is incorrect. * @throws { BusinessError } 103302 - Dialog content already exist. The ComponentContent has already been opened. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ openCustomDialogWithController(dialogContent: ComponentContent, controller: promptAction.DialogController, options?: promptAction.BaseDialogOptions): Promise; /** * Update the custom dialog with frameNode. * * @param { ComponentContent } dialogContent - the content of custom dialog. * @param { promptAction.BaseDialogOptions } options - Options. * only alignment, offset, autoCancel, and maskColor can be updated. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - Dialog content error. The ComponentContent is incorrect. * @throws { BusinessError } 103303 - Dialog content not found. The ComponentContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ updateCustomDialog(dialogContent: ComponentContent, options: promptAction.BaseDialogOptions): Promise; /** * Closes a custom dialog box corresponding to dialogContent. This API uses a promise to return the result. * * @param { ComponentContent } dialogContent - Content of the custom dialog box. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - Dialog content error. The ComponentContent is incorrect. * @throws { BusinessError } 103303 - Dialog content not found. The ComponentContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ closeCustomDialog(dialogContent: ComponentContent): Promise; /** * Open the custom dialog. * * isModal = true and showInSubWindow = true cannot be used at the same time. * * @param { promptAction.CustomDialogOptions } options - Options. * @returns { Promise } return the dialog id that will be used by closeCustomDialog. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ openCustomDialog(options: promptAction.CustomDialogOptions): Promise; /** * Present the custom dialog with controller. * * isModal = true and showInSubWindow = true cannot be used at the same time. * * @param { CustomBuilder | CustomBuilderWithId } builder - Dialog builder. * @param { promptAction.DialogController } [controller] - Dialog controller. * @param { promptAction.DialogOptions } [options] - Options. * @returns { Promise } return the dialog id that will be used by closeCustomDialog. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ presentCustomDialog(builder: CustomBuilder | CustomBuilderWithId, controller?: promptAction.DialogController, options?: promptAction.DialogOptions): Promise; /** * Close the custom dialog. * * @param { number } dialogId - the dialog id that returned by openCustomDialog. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ closeCustomDialog(dialogId: number): void; /** * Get order value of top dialog. * * @returns { LevelOrder } the display order. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ getTopOrder(): LevelOrder; /** * Get order value of bottom dialog. * * @returns { LevelOrder } the display order. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ getBottomOrder(): LevelOrder; /** * Open popup with frameNode. * * @param { ComponentContent } content - The content of popup. * @param { TargetInfo } target - The target of popup. * @param { PopupCommonOptions } [options] - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - The ComponentContent is incorrect. * @throws { BusinessError } 103302 - The ComponentContent already exists. * @throws { BusinessError } 103304 - The targetId does not exist. * @throws { BusinessError } 103305 - The node of targetId is not in the component tree. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ openPopup(content: ComponentContent, target: TargetInfo, options?: PopupCommonOptions): Promise; /** * Update popup with frameNode. * * @param { ComponentContent } content - The content of popup. * @param { PopupCommonOptions } options - Options. * @param { boolean } [partialUpdate] - If true, only the specified properties in the options are updated, * otherwise the rest of the properties are overwritten with the default values. * Default value is false. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - The ComponentContent is incorrect. * @throws { BusinessError } 103303 - The ComponentContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ updatePopup(content: ComponentContent, options: PopupCommonOptions, partialUpdate?: boolean): Promise; /** * Close popup with frameNode. * * @param { ComponentContent } content - The content of popup. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - The ComponentContent is incorrect. * @throws { BusinessError } 103303 - The ComponentContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ closePopup(content: ComponentContent): Promise; /** * Open menu with frameNode. * * @param { ComponentContent } content - The content of menu. * @param { TargetInfo } target - The target of menu. * @param { MenuOptions } [options] - Options. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - The ComponentContent is incorrect. * @throws { BusinessError } 103302 - The ComponentContent already exists. * @throws { BusinessError } 103304 - The targetId does not exist. * @throws { BusinessError } 103305 - The node of targetId is not in the component tree. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ openMenu(content: ComponentContent, target: TargetInfo, options?: MenuOptions): Promise; /** * Update menu with frameNode. * * @param { ComponentContent } content - The content of menu. * @param { MenuOptions } options - Options. * @param { boolean } [partialUpdate] - If true, only the specified properties in the MenuOptions are updated, * otherwise the rest of the properties are overwritten with the default values. * Default value is false. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - The ComponentContent is incorrect. * @throws { BusinessError } 103303 - The ComponentContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ updateMenu(content: ComponentContent, options: MenuOptions, partialUpdate?: boolean): Promise; /** * Close menu with frameNode. * * @param { ComponentContent } content - The content of menu. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 103301 - The ComponentContent is incorrect. * @throws { BusinessError } 103303 - The ComponentContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ closeMenu(content: ComponentContent): Promise; } /** * Defines the callback type used in UIObserver watch click event. * The value of event indicates the information of ClickEvent. * The value of node indicates the frameNode which will receive the event. * * @typedef { function } ClickEventListenerCallback * @param { ClickEvent } event - the information of ClickEvent * @param { FrameNode } [node] - the information of frameNode * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ declare type ClickEventListenerCallback = (event: ClickEvent, node?: FrameNode) => void; /** * Defines the callback type used in UIObserver watch pan event. * The value of event indicates the information of pan event. * The value of node indicates the frameNode which will receive the event. * * @typedef { function } PanListenerCallback * @param { GestureEvent } event - the information of pan event * @param { GestureRecognizer } current - the information of panRecognizer * @param { FrameNode } [node] - the information of frameNode * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ declare type PanListenerCallback = (event: GestureEvent, current: GestureRecognizer, node?: FrameNode) => void; /** * Defines the callback type used in UIObserver watch gesture. * The value of event indicates the information of gesture. * The value of node indicates the frameNode which will receive the event. * * @typedef { function } GestureEventListenerCallback * @param { GestureEvent } event - the information of GestureEvent * @param { FrameNode } [node] - the information of frameNode * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ declare type GestureEventListenerCallback = (event: GestureEvent, node?: FrameNode) => void; /** * Defines the type can be used for identiting the node, for the string type, it's the inspector id * set through .id attribute, and for the number type, it's the unique ID got from the FrameNode by * getUniqueID method. * * @typedef { string | number } NodeIdentity * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export declare type NodeIdentity = string | number; /** * Defines the callback type used in UIObserver to monitor one specific node's render state. * * @typedef { function } NodeRenderStateChangeCallback * @param { NodeRenderState } state - the node's render state * @param { FrameNode } [node] - the information of frameNode * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export declare type NodeRenderStateChangeCallback = (state: NodeRenderState, node?: FrameNode) => void; /** * Defines the callback type used in UIObserver to monitor specific gesture triggered information. * * @typedef { function } GestureListenerCallback * @param { GestureTriggerInfo } info - the gesture details triggered with user interaction * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export declare type GestureListenerCallback = (info: GestureTriggerInfo) => void; /** * Defines the PageInfo type. * The value of routerPageInfo indicates the information of the router page, or undefined if the * frameNode does not have router page information. And the value of navDestinationInfo indicates * the information of the navDestination, or undefined if the frameNode does not have navDestination * information. * * @interface PageInfo * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export interface PageInfo { /** * the property of router page information. * * @type { ?observer.RouterPageInfo } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ routerPageInfo?: observer.RouterPageInfo; /** * the property of navDestination information. * * @type { ?observer.NavDestinationInfo } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ navDestinationInfo?: observer.NavDestinationInfo; } /** * the property of OverlayManager. * * @interface OverlayManagerOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ export interface OverlayManagerOptions { /** * the render property of overlay node. * * @type { ?boolean } * @default true * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ renderRootOverlay?: boolean; /** * Set whether support backPressed event or not. * * @type { ?boolean } * @default false * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 19 */ /** * Set whether support backPressed event or not. * * @type { ?boolean } * @default false * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 * @arkts 1.1&1.2 */ enableBackPressedEvent?: boolean; } /** * Register callbacks to observe ArkUI behavior. * In the following API examples, you must first use getUIObserver() in UIContext to obtain a UIObserver instance, and * then call the APIs using the obtained instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Register callbacks to observe ArkUI behavior. * In the following API examples, you must first use getUIObserver() in UIContext to obtain a UIObserver instance, and * then call the APIs using the obtained instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ /** * Register callbacks to observe ArkUI behavior. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 * @arkts 1.1&1.2 */ export declare class UIObserver { /** * Subscribes to status changes of this **NavDestination** component. * * @param { 'navDestinationUpdate' } type - Event type. * The value is fixed at **'navDestinationUpdate'**, which indicates the state change event *
of the **NavDestination** component. * @param { object } options - ID of the target **NavDestination** component. * @param { Callback } callback - Callback used to return the current *
state of the **NavDestination** component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Subscribes to status changes of this **NavDestination** component. * * @param { 'navDestinationUpdate' } type - Event type. * The value is fixed at **'navDestinationUpdate'**, which indicates the state change event *
of the **NavDestination** component. * @param { object } options - ID of the target **NavDestination** component. * @param { Callback } callback - Callback used to return the current *
state of the **NavDestination** component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ on(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callback: Callback): void; /** * Registers a callback function to be called when the navigation destination is updated. * * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'. * @param { observer.NavDestinationSwitchObserverOptions } options - The options object. * @param { Callback } callback - The callback function to be called when the navigation destination is updated. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ on( type: 'navDestinationUpdate', options: observer.NavDestinationSwitchObserverOptions, callback: Callback ): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. * @param { object } options - Specify the id of observed navigation. * @param { Callback } callback - The callback function to remove. If not provided, all callbacks for the given event type and * navigation ID will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. * @param { object } options - The options object. * @param { Callback } callback - The callback function to remove. If not provided, all callbacks for the given event type and * navigation ID will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ off(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callback?: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. * @param { observer.NavDestinationSwitchObserverOptions } options - The options object. * @param { Callback } callback - The callback function to remove. If not provided, all callbacks for the given event type and * navigation ID will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ off( type: 'navDestinationUpdate', options: observer.NavDestinationSwitchObserverOptions, callback?: Callback ): void; /** * Subscribes to status changes of this **NavDestination** component. * * @param { 'navDestinationUpdate' } type - Event type. * The value is fixed at **'navDestinationUpdate'**, which indicates the state change event of *
the **NavDestination** component. * @param { Callback } callback - Callback used to return the current state of * which indicates the state change event of the **NavDestination** component. * @param { Callback } callback - Callback used to return the current state of *
the **NavDestination** component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'navDestinationUpdate', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationUpdate'} type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationUpdate'} type - The type of event to remove the listener for. Must be 'navDestinationUpdate'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'navDestinationUpdate', callback?: Callback): void; /** * Registers a callback function to be called when the navigation destination is updated. * * @param { 'navDestinationUpdateByUniqueId' } type - The type of event to listen for. Must be 'navDestinationUpdateByUniqueId'. * @param { number } navigationUniqueId - The uniqueId of the navigation. * @param { Callback } callback - The callback function to be called when the navigation destination is updated. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ on(type: 'navDestinationUpdateByUniqueId', navigationUniqueId: number, callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationUpdateByUniqueId'} type - The type of event to remove the listener for. Must be 'navDestinationUpdateByUniqueId'. * @param { number } navigationUniqueId - The uniqueId of the navigation. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ off(type: 'navDestinationUpdateByUniqueId', navigationUniqueId: number, callback?: Callback): void; /** * Registers a callback function to be called when the scroll event start or stop. * * @param { 'scrollEvent' } type - The type of event to listen for. Must be 'scrollEvent'. * @param { observer.ObserverOptions } options - The options object. * @param { Callback } callback - The callback function to be called when the scroll event start or stop. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'scrollEvent', options: observer.ObserverOptions, callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'scrollEvent' } type - The type of event to remove the listener for. Must be 'scrollEvent'. * @param { observer.ObserverOptions } options - The options object. * @param { Callback } callback - The callback function to remove. If not provided, all callbacks for the given event type and * scroll ID will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'scrollEvent', options: observer.ObserverOptions, callback?: Callback): void; /** * Registers a callback function to be called when the scroll event start or stop. * * @param { 'scrollEvent' } type - The type of event to listen for. Must be 'scrollEvent'. * @param { Callback } callback - The callback function to be called when the scroll event start or stop. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'scrollEvent', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'scrollEvent'} type - The type of event to remove the listener for. Must be 'scrollEvent'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'scrollEvent', callback?: Callback): void; /** * Unsubscribes to state changes of the page in the router. * * @param { 'routerPageUpdate' } type - Event type. *
The value is fixed at 'routerPageUpdate', which indicates the state change event of the page in the router. * @param { Callback } callback - Callback to be unregistered. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Unsubscribes to state changes of the page in the router. * * @param { 'routerPageUpdate' } type - Event type. *
The value is fixed at 'routerPageUpdate', which indicates the state change event of the page in the router. * @param { Callback } callback - Callback to be unregistered. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'routerPageUpdate', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'routerPageUpdate' } type - The type of event to remove the listener for. Must be 'routerPageUpdate'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Removes a callback function that was previously registered with `on()`. * * @param { 'routerPageUpdate' } type - The type of event to remove the listener for. Must be 'routerPageUpdate'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'routerPageUpdate', callback?: Callback): void; /** * Registers a callback function to be called when the screen density in a ui context is updated. * * @param { 'densityUpdate' } type - The type of event to listen for. Must be 'densityUpdate'. * @param { Callback } callback - The callback function to be called when the screen density is updated. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'densityUpdate', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'densityUpdate' } type - The type of event to remove the listener for. Must be 'densityUpdate'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'densityUpdate', callback?: Callback): void; /** * Registers a callback function to be called when the draw command will be drawn. * * @param { 'willDraw' } type - The type of event to listen for. Must be 'willDraw'. * @param { Callback } callback - The callback function to be called when the draw command will be drawn. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'willDraw', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'willDraw' } type - The type of event to remove the listener for. Must be 'willDraw'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'willDraw', callback?: Callback): void; /** * Registers a callback function to be called when the layout is done. * * @param { 'didLayout' } type - The type of event to listen for. Must be 'didLayout'. * @param { Callback } callback - The callback function to be called when the layout is done. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'didLayout', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'didLayout' } type - The type of event to remove the listener for. Must be 'didLayout'. * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type * will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'didLayout', callback?: Callback): void; /** * Registers a callback function to be called when the navigation switched to a new navDestination. * * @param { 'navDestinationSwitch' } type - The type of event to listen for. Must be 'navDestinationSwitch'. * @param { Callback } callback - The callback function to be called when * the navigation switched to a new navDestination. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on( type: 'navDestinationSwitch', callback: Callback ): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationSwitch' } type - The type of event to remove the listener for. Must be 'navDestinationSwitch'. * @param { Callback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off( type: 'navDestinationSwitch', callback?: Callback ): void; /** * Registers a callback function to be called when the navigation switched to a new navDestination. * * @param { 'navDestinationSwitch' } type - The type of event to listen for. Must be 'navDestinationSwitch'. * @param { observer.NavDestinationSwitchObserverOptions } observerOptions - Options. * @param { Callback } callback - The callback function to be called when the * navigation switched to a new navDestination. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on( type: 'navDestinationSwitch', observerOptions: observer.NavDestinationSwitchObserverOptions, callback: Callback ): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'navDestinationSwitch' } type - The type of event to remove the listener for. Must be 'navDestinationSwitch'. * @param { observer.NavDestinationSwitchObserverOptions } observerOptions - Options. * @param { Callback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off( type: 'navDestinationSwitch', observerOptions: observer.NavDestinationSwitchObserverOptions, callback?: Callback ): void; /** * Registers a callback function to be called before clickEvent is called. * * @param { 'willClick' } type - The type of event to listen for. * @param { ClickEventListenerCallback } callback - The callback function to be called * when the clickEvent will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'willClick', callback: ClickEventListenerCallback): void; /** * Removes a callback function to be called before clickEvent is called. * * @param { 'willClick' } type - The type of event to remove the listener for. * @param { ClickEventListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'willClick', callback?: ClickEventListenerCallback): void; /** * Registers a callback function to be called after clickEvent is called. * * @param { 'didClick' } type - The type of event to listen for. * @param { ClickEventListenerCallback } callback - The callback function to be called * when the clickEvent will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'didClick', callback: ClickEventListenerCallback): void; /** * Removes a callback function to be called after clickEvent is called. * * @param { 'didClick' } type - The type of event to remove the listener for. * @param { ClickEventListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'didClick', callback?: ClickEventListenerCallback): void; /** * Registers a callback function to be called before tapGesture is called. * * @param { 'willClick' } type - The type of event to listen for. * @param { GestureEventListenerCallback } callback - The callback function to be called * when the clickEvent will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'willClick', callback: GestureEventListenerCallback): void; /** * Removes a callback function to be called before tapGesture is called. * * @param { 'willClick' } type - The type of event to remove the listener for. * @param { GestureEventListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'willClick', callback?: GestureEventListenerCallback): void; /** * Registers a callback function to be called after tapGesture is called. * * @param { 'didClick' } type - The type of event to listen for. * @param { GestureEventListenerCallback } callback - The callback function to be called * when the clickEvent will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'didClick', callback: GestureEventListenerCallback): void; /** * Removes a callback function to be called after tapGesture is called. * * @param { 'didClick' } type - The type of event to remove the listener for. * @param { GestureEventListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'didClick', callback?: GestureEventListenerCallback): void; /** * Registers a callback function to be called before panGesture onActionStart is called. * * @param { 'beforePanStart' } type - The type of event to listen for. * @param { PanListenerCallback } callback - The callback function to be called * when the panGesture will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'beforePanStart', callback: PanListenerCallback): void; /** * Removes a callback function to be called before panGesture onActionStart is called. * * @param { 'beforePanStart' } type - The type of event to remove the listener for. * @param { PanListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'beforePanStart', callback?: PanListenerCallback): void; /** * Registers a callback function to be called before panGesture onActionEnd is called. * * @param { 'beforePanEnd' } type - The type of event to listen for. * @param { PanListenerCallback } callback - The callback function to be called * when the panGesture will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'beforePanEnd', callback: PanListenerCallback): void; /** * Removes a callback function to be called before panGesture onActionEnd is called. * * @param { 'beforePanEnd' } type - The type of event to remove the listener for. * @param { PanListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'beforePanEnd', callback?: PanListenerCallback): void; /** * Registers a callback function to be called after panGesture onActionStart is called. * * @param { 'afterPanStart' } type - The type of event to listen for. * @param { PanListenerCallback } callback - The callback function to be called * when the panGesture will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'afterPanStart', callback: PanListenerCallback): void; /** * Removes a callback function to be called after panGesture onActionStart is called. * * @param { 'afterPanStart' } type - The type of event to remove the listener for. * @param { PanListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'afterPanStart', callback?: PanListenerCallback): void; /** * Registers a callback function to be called after panGesture onActionEnd is called. * * @param { 'afterPanEnd' } type - The type of event to listen for. * @param { PanListenerCallback } callback - The callback function to be called * when the panGesture will be trigger or after. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'afterPanEnd', callback: PanListenerCallback): void; /** * Removes a callback function to be called after panGesture onActionEnd is called. * * @param { 'afterPanEnd' } type - The type of event to remove the listener for. * @param { PanListenerCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'19','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'afterPanEnd', callback?: PanListenerCallback): void; /** * Registers a callback function to be called when the tabContent is showed or hidden. * * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'. * @param { observer.ObserverOptions } options - The options object. * @param { Callback } callback - The callback function to be called * when the tabContent show or hide. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'tabContentUpdate', options: observer.ObserverOptions, callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'tabContentUpdate' } type - The type of event to remove the listener for. Must be 'tabContentUpdate'. * @param { observer.ObserverOptions } options - The options object. * @param { Callback } callback - The callback function to remove. If not provided, * all callbacks for the given event type and Tabs ID will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'tabContentUpdate', options: observer.ObserverOptions, callback?: Callback): void; /** * Registers a callback function to be called when the tabContent is showed or hidden. * * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'. * @param { Callback } callback - The callback function to be called * when the tabContent is showed or hidden. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ on(type: 'tabContentUpdate', callback: Callback): void; /** * Removes a callback function that was previously registered with `on()`. * * @param { 'tabContentUpdate'} type - The type of event to remove the listener for. Must be 'tabContentUpdate'. * @param { Callback } callback - The callback function to remove. If not provided, * all callbacks for the given event type and Tabs ID will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ off(type: 'tabContentUpdate', callback?: Callback): void; /** * Registers a callback function to be called when the specific node's render state changed. * This callback will be executed once immediately when the register is successful. * [Notes]: * 1. Be aware of the limit on the number of nodes: * For performance considerations, the system has imposed a limit on the number of * nodes that can be registered for monitoring in a single UI instance, exception will be thrown * if overmuch. Please use this interface with caution. * 2. Understanding scenarios where notifications may not occur: * In general, within container components that have view or page switching functionality, * when a view or page within the screen is moved outside the screen, the components previously * within the screen should be removed from the render tree and should receive a RENDER_OUT * notification. However, this is not always the case, as some scenarios involve views or components * being moved outside the screen's display range without triggering a RENDER_OUT notification. * For example, some components with caching capabilities may affect this behavior, and swiper is one * such component. The cacheCount property of the swiper component allows you to force, via its second * parameter isShow, that even if the current page is moved outside the display range, it remains in the * render tree. This can be useful in scenarios where multiple pages are displayed on the screen simultaneously. * Another example is scrolling components like list or scroll, where their internal content remains in the * render tree even if it is scrolled outside the screen's display range, provided that lazyForEach/Repeat is * not used. As a result, there will be no changes to the render state. Once you understand the principles * behind the triggers for render state changes, these scenarios will become easier to comprehend. * * @param { 'nodeRenderState' } type - The type of event to listen for. * @param { NodeIdentity } nodeIdentity - The identity of the target node * @param { NodeRenderStateChangeCallback } callback - The callback function to be called * when the clickEvent will be trigger or after. * @throws { BusinessError } 161001 - The count of nodes monitoring render state is over the limitation. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ on(type: 'nodeRenderState', nodeIdentity: NodeIdentity, callback: NodeRenderStateChangeCallback): void; /** * Removes a callback function to be called before tapGesture is called. * * @param { 'nodeRenderState' } type - The type of event to remove the listener for. * @param { NodeIdentity } nodeIdentity - The identity of the target node * @param { NodeRenderStateChangeCallback } [callback] - The callback function to remove. If not provided, * all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ off(type: 'nodeRenderState', nodeIdentity: NodeIdentity, callback?: NodeRenderStateChangeCallback): void; /** * Registers a callback to monitor the gesture trigger information. * * @param { GestureListenerType } type - The type of gesture to monitor. * @param { GestureObserverConfigs } option - The options when bind the global listener. * @param { GestureListenerCallback } callback - The callback function to be called when any gesture's state * is updated. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ addGlobalGestureListener(type: GestureListenerType, option: GestureObserverConfigs, callback: GestureListenerCallback): void; /** * Removes a callback function for one gesture listener type. * * @param { GestureListenerType } type - The type of event to remove the listener for. * @param { GestureListenerCallback } [callback] - The callback function to be removed. If not provided, * all callbacks for the given gesture type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ removeGlobalGestureListener(type: GestureListenerType, callback?: GestureListenerCallback): void; } /** * class ComponentUtils * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class ComponentUtils * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ export declare class ComponentUtils { /** * Provide the ability to obtain the coordinates and size of component drawing areas. * * @param { string } id - ID of the component whose attributes are to be obtained. * @returns { componentUtils.ComponentInfo } the object of ComponentInfo. * @throws { BusinessError } 100001 - UI execution context not found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Provide the ability to obtain the coordinates and size of component drawing areas. * * @param { string } id - ID of the component whose attributes are to be obtained. * @returns { componentUtils.ComponentInfo } the object of ComponentInfo. * @throws { BusinessError } 100001 - UI execution context not found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getRectangleById(id: string): componentUtils.ComponentInfo; } /** * class OverlayManager * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class OverlayManager { /** * Adds a specified ComponentContent node to the OverlayManager. * * @param { ComponentContent } content - Content to add to the new node on the OverlayManager. *

NOTE: *
By default, the new node is centered on the page and stacked according to its stacking level. *

* * @param { number } [ index ] - Stacking level of the new node on the OverlayManager. *

NOTE: *
If the value is greater than or equal to 0, a larger value indicates a higher stacking level; for those that * have the same index, the one that is added at a later time has a higher stacking level. If the value is less than * 0 or is null or undefined, the ComponentContent node is added at the highest level by default. If the same * ComponentContent node is added multiple times, only the last added one is retained. *

* * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ addComponentContent(content: ComponentContent, index?: number): void; /** * Creates a floating layer node with the specified display order. * This API allows you to define the stacking order of the nodes when they are created. * * @param { ComponentContent } content - Content to add to the new node on the OverlayManager. *

NOTE: *
By default, the new node is centered on the page and stacked according to its stacking level. *

* * @param { LevelOrder } [ levelOrder ] - The display order of the ComponentContDisplay order of the new floating * layer node, default is LevelOrder.clamp(0) * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ addComponentContentWithOrder(content: ComponentContent, levelOrder?: LevelOrder): void; /** * Removes a specified ComponentContent node from the OverlayManager * * @param { ComponentContent } content - Content to remove from the OverlayManager. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ removeComponentContent(content: ComponentContent): void; /** * Show the ComponentContent. * * @param { ComponentContent } content - The content will be shown. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ showComponentContent(content: ComponentContent): void; /** * Hide the ComponentContent. * * @param { ComponentContent } content - The content will be hidden. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ hideComponentContent(content: ComponentContent): void; /** * Show all ComponentContents on the OverlayManager. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ showAllComponentContents(): void; /** * Hide all ComponentContents on the OverlayManager. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ hideAllComponentContents(): void; } /** * interface AtomicServiceBar * @interface AtomicServiceBar * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * interface AtomicServiceBar * @interface AtomicServiceBar * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export interface AtomicServiceBar { /** * Set the visibility of the bar, except the icon. * * @param { boolean } visible - whether this bar is visible. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ setVisible(visible: boolean): void; /** * Set the background color of the bar. * * @param { Nullable< Color | number | string> } color - the color to set, undefined indicates using default. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Set the background color of the bar. * * @param { Nullable< Color | number | string> } color - the color to set, undefined indicates using default. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setBackgroundColor(color: Nullable< Color | number | string>): void; /** * Set the title of the bar. * * @param { string } content - the content of the bar. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Set the title of the bar. * * @param { string } content - the content of the bar. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setTitleContent(content: string): void; /** * Set the font style of the bar's title. * * @param { FontStyle } font - the font style of the bar's title. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Set the font style of the bar's title. * * @param { FontStyle } font - the font style of the bar's title. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setTitleFontStyle(font: FontStyle): void; /** * Set the color of the icon on the bar. * * @param { Nullable< Color | number | string> } color - the color to set to icon, undefined indicates using default. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Set the color of the icon on the bar. * * @param { Nullable< Color | number | string> } color - the color to set to icon, undefined indicates using default. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setIconColor(color: Nullable< Color | number | string>): void; /** * Get size and position of the bar. * * @returns { Frame } The size and position of bar in vp relative to window. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ getBarRect(): Frame; } /** * The information when one gesture specific callback is triggered. * * @interface GestureTriggerInfo * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export interface GestureTriggerInfo { /** * The gesture event object. * * @type { GestureEvent } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ event: GestureEvent; /** * The gesture recognizer object. You can obtain the detailed information of the gesture from it, * but please do not keep this object locally, as it might be unavailable when the node is released. * * @type { GestureRecognizer } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ current: GestureRecognizer; /** * The gesture action callback phase. * * @type { GestureActionPhase } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ currentPhase: GestureActionPhase; /** * The node which the gesture is being triggered on. * * @type { ?FrameNode } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ node?: FrameNode; } /** * The observer options for global gesture listener. * * @interface GestureObserverConfigs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export interface GestureObserverConfigs { /** * The gesture callback phases want to monitor. Only the specific action phases can be notified when the gesture is triggered. * If empty array provided, the register will has no any effect. * * @type { Array } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ actionPhases: Array; } /** * Represents a dynamic synchronization scene. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class DynamicSyncScene { /** * Sets the FrameRateRange of the DynamicSyncScene. * * @param { ExpectedFrameRateRange } range - The range of frameRate. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setFrameRateRange(range: ExpectedFrameRateRange): void; /** * Gets the FrameRateRange of the DynamicSyncScene. * * @returns { ExpectedFrameRateRange } The range of frameRate. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getFrameRateRange(): ExpectedFrameRateRange; } /** * Represents a dynamic synchronization scene of Swiper. * * @extends DynamicSyncScene * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class SwiperDynamicSyncScene extends DynamicSyncScene { /** * Type of the SwiperDynamicSyncSceneType. * @type { SwiperDynamicSyncSceneType } * @readonly * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ readonly type: SwiperDynamicSyncSceneType; } /** * Represents a dynamic synchronization scene of Marquee. * * @extends DynamicSyncScene * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ export declare class MarqueeDynamicSyncScene extends DynamicSyncScene { /** * Type of the MarqueeDynamicSyncSceneType. * @type { MarqueeDynamicSyncSceneType } * @readonly * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ readonly type: MarqueeDynamicSyncSceneType; } /** * class DragController * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * class DragController * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ /** * class DragController * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ export declare class DragController { /** * Execute a drag event. * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @param { AsyncCallback<{ event: DragEvent, extraParams: string }> } callback - Callback that contains * the drag event information. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Execute a drag event. * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @param { AsyncCallback } callback - Callback that contains * the drag event information. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ /** * Execute a drag event. * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @param { AsyncCallback } callback - Callback that contains * the drag event information. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ executeDrag(custom: CustomBuilder | DragItemInfo, dragInfo: dragController.DragInfo, callback: AsyncCallback): void; /** * Execute a drag event. * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @returns { Promise<{ event: DragEvent, extraParams: string }> } A Promise with the drag event information. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Execute a drag event. * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @returns { Promise } A Promise with the drag event information. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ /** * Execute a drag event. * @param { CustomBuilder | DragItemInfo } custom - Object used for prompts displayed when the object is dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @returns { Promise } A Promise with the drag event information. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ executeDrag(custom: CustomBuilder | DragItemInfo, dragInfo: dragController.DragInfo) : Promise; /** * Create one drag action object, which can be used for starting drag later or monitoring the drag status after drag started. * @param { Array } customArray - Objects used for prompts displayed when the objects are dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @returns { dragController.DragAction } one drag action object * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Create one drag action object, which can be used for starting drag later or monitoring the drag status after drag started. * @param { Array } customArray - Objects used for prompts displayed when the objects are dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @returns { dragController.DragAction } one drag action object * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ /** * Create one drag action object, which can be used for starting drag later or monitoring the drag status after drag started. * @param { Array } customArray - Objects used for prompts displayed when the objects are dragged. * @param { dragController.DragInfo } dragInfo - Information about the drag event. * @returns { dragController.DragAction } one drag action object * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Internal handling failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ createDragAction(customArray: Array, dragInfo: dragController.DragInfo): dragController.DragAction; /** * Get a drag preview object, which provides the functions of setting color or updating animation and has no effect in OnDrop and OnDragEnd callback. * @returns { dragController.DragPreview } A drag preview object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Get a drag preview object. * @returns { dragController.DragPreview } A drag preview object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ /** * Get a drag preview object. * @returns { dragController.DragPreview } A drag preview object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ getDragPreview(): dragController.DragPreview; /** * Enable drag event strict reporting for drag enter and leave notification in nested situation. * For example, the parent and child both register the onDragEnter/onDragLeave events, if this * flag is enabled, the parent will be notified with leave event, and the child will notified with * enter event at the same time, when user drag action is passing through the parent and enter the * scope of the child. * Please be noted, the default value of the flag is false, it means, for the same situation, the * parent will not receive the leave notification, just the child can get the enter event, which is * not fully strict. * @param { boolean } enable - Indicating enable drag event strict reporting or not. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setDragEventStrictReportingEnabled(enable: boolean): void; /** * Notify the drag start request to specific pending or continue. * @param { dragController.DragStartRequestStatus } requestStatus - Status about the drag start behavior. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ notifyDragStartRequest(requestStatus: dragController.DragStartRequestStatus): void; /** * Cancel the UDMF data sync process by passing in the data key as the identify, can only be used after the drop. * * @param { string } key - The data key returned by startDataLoading method. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 190004 - Operation failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ cancelDataLoading(key: string): void; /** * Sets whether to enable the disallow badge icon show. * * Typically, when a component can receive or process data dragged by the user, or when it declares to the * system that data should be processed in COPY way by returning DragBehavior.COPY, the system will display * a plus sign together with the data number on the upper-left corner of the dragged object; if returning * DragBehavior.MOVE to the system to declare that data should be processed in CUT way, the system will only * display the data number on the upper-left corner of the dragged object. * * In some cases, when the system determines or the component explicitly declares that it cannot handle the * data that the user is dragging, the system displays a badge icon in the same way as it does for DragBehavior.MOVE. * So if you want to show the more clearly status, you can call this method on the UI instance in advance to force * the system to display a clear prohibition icon on the upper left corner in such cases, and the user can clearly * know that data cannot be dropped here. * * @param { boolean } enabled - Indicating enable the disallow status showing or not. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 20 */ enableDropDisallowedBadge(enabled: boolean): void; } /** * class MeasureUtils * *

NOTE: *
You must first use getMeasureUtils() in UIContext to obtain a MeasureUtils instance, * and then call the APIs using the obtained instance. *

* * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class MeasureUtils { /** * Obtains the width of the specified text in a single line layout. * * @param { MeasureOptions } options - Options. * @returns { number } - The unit is px. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ measureText(options: MeasureOptions): number; /** * Obtains the width and height of the specified text in a single line layout. * * @param { MeasureOptions } options - Options of measure area occupied by text. * @returns { SizeOptions } width and height for text to display.The return values for text width and height are both in px. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ measureTextSize(options: MeasureOptions): SizeOptions; /** * Get layout info of the styled string. * * @param { StyledString } styledString - The styled string value. * @param { TextLayoutOptions } [options] - The layout options. * @returns { Array } paragraph result * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ getParagraphs(styledString: StyledString, options?: TextLayoutOptions): Array; } /** * class FocusController * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class FocusController { /** * clear focus to the root container. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ clearFocus(): void; /** * request focus to the specific component. * @param { string } key - the inspector key of the component. * @throws { BusinessError } 150001 - the component cannot be focused. * @throws { BusinessError } 150002 - This component has an unfocusable ancestor. * @throws { BusinessError } 150003 - the component is not on tree or does not exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ requestFocus(key: string): void; /** * Activate focus style. * @param { boolean } isActive - activate/deactivate the focus style. * @param { boolean } [autoInactive] - deactivate the focus style when touch event or mouse event triggers, the default value is true. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ activate(isActive: boolean, autoInactive?: boolean): void; /** * Get whether the focus style is active. * @returns { boolean } Whether the focus style is active. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ isActive(): boolean; /** * Set whether to enable autofocus transfer. * @param { boolean } isAutoFocusTransfer - A Boolean value that indicates whether autofocus transfer is enabled. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ setAutoFocusTransfer(isAutoFocusTransfer: boolean): void; /** * Set the priority of key event processing when component cannot handle the key event.. * @param { KeyProcessingMode } mode - Key processing mode. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ setKeyProcessingMode(mode: KeyProcessingMode): void; } /** * Pointer style. * * @typedef {pointer.PointerStyle} PointerStyle * @syscap SystemCapability.MultimodalInput.Input.Pointer * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export type PointerStyle = pointer.PointerStyle; /** * class CursorController * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class CursorController { /** * Restore default cursor. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ restoreDefault(): void; /** * Set cursor style. * * @param { PointerStyle } value - cursor style enum. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setCursor(value: PointerStyle): void; } /** * class ContextMenuController * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class ContextMenuController { /** * Close context menu. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ close(): void; } /** * Class FrameCallback * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ /** * Class FrameCallback * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 * @arkts 1.1&1.2 */ export declare abstract class FrameCallback { /** * Call when a new display frame is being rendered. * * @param { number } frameTimeInNano - The frame time in nanoseconds. * Value range: [0, +∞) * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ onFrame(frameTimeInNano: number): void; /** * Called at the end of the next idle frame. If there is no next frame, will request one automatically. * * @param { number } timeLeftInNano - The remaining time from the deadline for this frame, in nanoseconds. * Value range: [0, +∞) * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ onIdle(timeLeftInNano: number): void; } /** * The base context of an ability or an application. It allows access to * application-specific resources. * * @typedef { common.Context } Context * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export type Context = common.Context; /** * class ComponentSnapshot * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export declare class ComponentSnapshot { /** * Get a component snapshot by component id. * * @param { string } id - Target component ID, set by developer through .id attribute. * @param { AsyncCallback } callback - Callback that contains the snapshot in PixelMap format. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Invalid ID. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ get(id: string, callback: AsyncCallback, options?: componentSnapshot.SnapshotOptions): void; /** * Get a component snapshot by component id. * * @param { string } id - Target component ID, set by developer through .id attribute. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { Promise } A Promise with the snapshot in PixelMap format. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Invalid ID. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ get(id: string, options?: componentSnapshot.SnapshotOptions): Promise; /** * Generate a snapshot from a custom component builder. * * @param { CustomBuilder } builder - Builder function of a custom component. * @param { AsyncCallback } callback - Callback that contains the snapshot in PixelMap format. * @param { number } [delay] - Defines the delay time to render the snapshot. * @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The builder is not a valid build function. * @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for * the ready state is required when the checkImageStatus option is enabled. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback, delay?: number, checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): void; /** * Generate a snapshot from a custom component builder. * * @param { CustomBuilder } builder - Builder function of a custom component. * @param { number } [delay] - Defines the delay time to render the snapshot. * @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { Promise } A Promise with the snapshot in PixelMap format. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The builder is not a valid build function. * @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for * the ready state is required when the checkImageStatus option is enabled. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ createFromBuilder(builder: CustomBuilder, delay?: number, checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): Promise; /** * Take a screenshot of the specified component in synchronous mode, * this mode will block the main thread, please use it with caution, the maximum * waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown. * * @param { string } id - Target component ID, set by developer through .id attribute. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { image.PixelMap } The snapshot result in PixelMap format. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Invalid ID. * @throws { BusinessError } 160002 - Timeout. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getSync(id: string, options?: componentSnapshot.SnapshotOptions): image.PixelMap; /** * Get a component snapshot by uniqueId. * * @param { number } uniqueId - The uniqueId of the node, can get through getUniqueId. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { Promise } A Promise with the snapshot in PixelMap format. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Invalid ID. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ getWithUniqueId(uniqueId: number, options?: componentSnapshot.SnapshotOptions): Promise; /** * Take a screenshot of the specified component in synchronous mode, * this mode will block the main thread, please use it with caution, the maximum * waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown. * * @param { number } uniqueId - The uniqueId of the node, can get through getUniqueId. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { image.PixelMap } The snapshot result in PixelMap format. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - Invalid ID. * @throws { BusinessError } 160002 - Timeout. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ getSyncWithUniqueId(uniqueId: number, options?: componentSnapshot.SnapshotOptions): image.PixelMap; /** * Generate a snapshot from a custom component content. * * @param { ComponentContent } content - The content to be taken snapshot. * @param { number } [delay] - Defines the delay time to render the snapshot. * @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { Promise } A Promise with the snapshot in PixelMap format. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 100001 - The builder is not a valid build function. * @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for * the ready state is required when the checkImageStatus option is enabled. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ createFromComponent(content: ComponentContent, delay?: number, checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): Promise; /** * Get a component snapshot by component range. * * @param { NodeIdentity } start - the start component ID, set by developer through .id attribute or the unique ID * get from FrameNode. * @param { NodeIdentity } end - the end component ID, set by developer through.id attribute or the unique ID * get from FrameNode. * @param { boolean } isStartRect - indicating the snapshot rect to use, true for using the * rect of the start component, false for using the rect of the end component. * @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options. * @returns { Promise } A Promise with the snapshot in PixelMap format. * @throws { BusinessError } 202 - The caller is not a system application. * @throws { BusinessError } 100001 - Invalid ID detected. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 20 */ getWithRange(start: NodeIdentity, end: NodeIdentity, isStartRect: boolean, options?: componentSnapshot.SnapshotOptions): Promise; } /** * class UIContext * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * class UIContext * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * class UIContext * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 * @arkts 1.1&1.2 */ export declare class UIContext { /** * Checks whether the UiContext object ia available. * * @returns { boolean } Returns true if the UIConetxt object is available. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ isAvailable(): boolean; /** * get object font. * * @returns { Font } object Font. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * get object font. * * @returns { Font } object Font. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getFont(): Font; /** * get object mediaQuery. * * @returns { MediaQuery } object MediaQuery. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * get object mediaQuery. * * @returns { MediaQuery } object MediaQuery. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getMediaQuery(): MediaQuery; /** * get object UIInspector. * @returns { UIInspector } object UIInspector. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * get object UIInspector. * @returns { UIInspector } object UIInspector. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getUIInspector(): UIInspector; /** * get the filtered attributes of the component tree. * @param { Array } [filters] - the list of filters used to filter out component tree to be obtained. * @returns { string } the specified attributes of the component tree in json string. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getFilteredInspectorTree(filters?: Array): string; /** * get the filtered attributes of the component tree with the specified id and depth * @param { string } id - ID of the specified component tree to be obtained. * @param { number } depth - depth of the component tree to be obtained. * @param { Array } [filters] - the list of filters used to filter out component tree to be obtained. * @returns { string } the specified attributes of the component tree in json string. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getFilteredInspectorTreeById(id: string, depth: number, filters?: Array): string; /** * Obtains a Router object. * * @returns { Router } Router object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Obtains a Router object. * * @returns { Router } Router object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getRouter(): Router; /** * get object PromptAction. * * @returns { PromptAction } object PromptAction. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Obtains a PromptAction object. * * @returns { PromptAction } PromptAction object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getPromptAction(): PromptAction; /** * get object ComponentUtils. * @returns { ComponentUtils } object ComponentUtils. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * get object ComponentUtils. * @returns { ComponentUtils } object ComponentUtils. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getComponentUtils(): ComponentUtils; /** * Get the UI observer. * * @returns { UIObserver } The UI observer. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Get the UI observer. * * @returns { UIObserver } The UI observer. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getUIObserver(): UIObserver; /** * Obtains the OverlayManager object. * * @returns { OverlayManager } OverlayManager instance obtained. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getOverlayManager(): OverlayManager; /** * Init OverlayManager. * * @param { OverlayManagerOptions } options - Options. * @returns { boolean } Returns true if it is called first and before getting an OverlayManager instance; returns false otherwise. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ setOverlayManagerOptions(options: OverlayManagerOptions): boolean; /** * Get object OverlayManagerOptions. * * @returns { OverlayManagerOptions } object OverlayManagerOptions. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ getOverlayManagerOptions(): OverlayManagerOptions; /** * Create an animator object for custom animation. * * @param { AnimatorOptions } options - Options. * @returns { AnimatorResult } * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Create an animator object for custom animation. * * @param { AnimatorOptions } options - Options. * @returns { AnimatorResult } * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ createAnimator(options: AnimatorOptions): AnimatorResult; /** * Create an animator object for custom animation. * * @param { AnimatorOptions | SimpleAnimatorOptions } options - Options. * @returns { AnimatorResult } * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ createAnimator(options: AnimatorOptions | SimpleAnimatorOptions): AnimatorResult; /** * Defining animation function * * @param { AnimateParam } value - parameters for animation. * @param { function } event - the closure base on which, the system will create animation automatically * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defining animation function * * @param { AnimateParam } value - parameters for animation. * @param { function } event - the closure base on which, the system will create animation automatically * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ animateTo(value: AnimateParam, event: () => void): void; /** * alertDialog display. * * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Shows an alert dialog box. * * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions } options - Shows * an AlertDialog component in the given settings. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showAlertDialog(options: AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions): void; /** * actionSheet display. * * @param { ActionSheetOptions } value - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Shows an action sheet in the given settings. * * @param { ActionSheetOptions } value - Parameters of the action sheet. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showActionSheet(value: ActionSheetOptions): void; /** * datePickerDialog display. * * @param { DatePickerDialogOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * datePickerDialog display. * * @param { DatePickerDialogOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showDatePickerDialog(options: DatePickerDialogOptions): void; /** * timePickerDialog display. * * @param { TimePickerDialogOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * timePickerDialog display. * * @param { TimePickerDialogOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showTimePickerDialog(options: TimePickerDialogOptions): void; /** * textPickerDialog display. * * @param { TextPickerDialogOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * textPickerDialog display. * * @param { TextPickerDialogOptions } options - Options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ showTextPickerDialog(options: TextPickerDialogOptions): void; /** * textPickerDialog display. * * @param { TextPickerDialogOptions | TextPickerDialogOptionsExt } style - Dialog style. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ showTextPickerDialog(style: TextPickerDialogOptions | TextPickerDialogOptionsExt): void; /** * Run custom functions inside the UIContext scope. * * @param { function } callback - The function called through UIContext. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Run custom functions inside the UIContext scope. * * @param { function } callback - The function called through UIContext. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ runScopedTask(callback: () => void): void; /** * Sets the avoidance mode for the virtual keyboard.
* Default mode: **KeyboardAvoidMode.OFFSET**. * * @param { KeyboardAvoidMode } value - The mode of keyboard avoid. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ setKeyboardAvoidMode(value: KeyboardAvoidMode): void; /** * Obtains the avoidance mode of the virtual keyboard. * @returns { KeyboardAvoidMode } The mode of keyboard avoid. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getKeyboardAvoidMode(): KeyboardAvoidMode; /** * Set the pixel round mode of the system. The default mode is PixelRoundMode.PIXEL_ROUND_ON_LAYOUT_FINISH. * * @param { PixelRoundMode } mode - The mode of pixel round. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ setPixelRoundMode(mode: PixelRoundMode): void; /** * Get the pixel round mode of the system. * * @returns { PixelRoundMode } the mode of pixel round. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ getPixelRoundMode(): PixelRoundMode; /** * Dispach keyboard event to the frameNode with inspector key. * * @param { number | string } node - The uniqueId or inspector key of the target FrameNode. * @param { KeyEvent } event - The key event to be sent. * @returns { boolean } Returns whether the key event is consumed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'15','1.2':'20' } * @arkts 1.1&1.2 */ dispatchKeyEvent(node: number | string, event: KeyEvent): boolean; /** * Get AtomicServiceBar. * @returns { Nullable } The atomic service bar. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ getAtomicServiceBar(): Nullable; /** * Get DragController. * @returns { DragController } the DragController * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 11 */ /** * Get DragController. * @returns { DragController } the DragController * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ /** * Get DragController. * @returns { DragController } the DragController * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ getDragController(): DragController; /** * Get MeasureUtils. * @returns { MeasureUtils } the MeasureUtils * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getMeasureUtils(): MeasureUtils; /** * Generates a key frame animation. * * @param { KeyframeAnimateParam } param - Global parameters of the keyframe animation. * @param { Array } keyframes - Array of keyframes. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Generates a key frame animation. * * @param { KeyframeAnimateParam } param - Global parameters of the keyframe animation. * @param { Array } keyframes - Array of keyframes. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ keyframeAnimateTo(param: KeyframeAnimateParam, keyframes: Array): void; /** * Get FocusController. * @returns { FocusController } the FocusController * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getFocusController(): FocusController; /** * Define animation functions for immediate distribution. * * @param { AnimateParam } param - Set animation effect parameters. * @param { Callback } event - Specify the closure function that displays dynamic effects, * and the system will automatically insert transition animations for state changes caused by the closure function. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ animateToImmediately(param: AnimateParam, event: Callback): void; /** * Get FrameNode by id. * * @param { string } id - The id of FrameNode. * @returns { FrameNode | null } The instance of FrameNode. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getFrameNodeById(id: string): FrameNode | null; /** * Get the FrameNode attached to current window by id. * * @param { string } id - The id of FrameNode. * @returns { FrameNode | null } The instance of FrameNode. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getAttachedFrameNodeById(id: string): FrameNode | null; /** * Get FrameNode by uniqueId. * Obtains the entity node, FrameNode, of a component on the component tree using its uniqueId. * The return value depends on the type of component associated with the uniqueId. * 1. If the uniqueId corresponds to a built-in component, the associated FrameNode is returned. * 2. If the uniqueId corresponds to a custom component: If the component has rendered content, its root node is * returned, with the type __Common__; if the component has no rendered content, the FrameNode of its first child * component is returned. * 3. If the uniqueId does not correspond to any component, null is returned. * * @param { number } id - The uniqueId of the FrameNode. * @returns { FrameNode | null } - The FrameNode with the target uniqueId, or null if the frameNode is not existed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getFrameNodeByUniqueId(id: number): FrameNode | null; /** * Get page information of the frameNode with uniqueId. * * @param { number } id - The uniqueId of the target FrameNode. * @returns { PageInfo } - The page information of the frameNode with the target uniqueId, includes * navDestination and router page information. If the frame node does not have navDestination and * router page information, it will return an empty object. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getPageInfoByUniqueId(id: number): PageInfo; /** * Get navigation information of the frameNode with uniqueId. * * @param { number } id - The uniqueId of the target FrameNode. * @returns { observer.NavigationInfo | undefined } - The navigation information of the frameNode with the * target uniqueId, or undefined if the frameNode is not existed or does not have navigation information. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getNavigationInfoByUniqueId(id: number): observer.NavigationInfo | undefined; /** * Dynamic dimming. * * @param { string } id - The id of FrameNode. * @param { number } value - Compared to the original level of dimming.value range [0,1], * set values less than 0 to 0 and values greater than 1 to 1. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ setDynamicDimming(id: string, value: number): void; /** * Get object cursor controller. * * @returns { CursorController } object cursor controller. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getCursorController(): CursorController; /** * Get object context menu controller. * * @returns { ContextMenuController } object context menu controller. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getContextMenuController(): ContextMenuController; /** * Get ComponentSnapshot. * @returns { ComponentSnapshot } the ComponentSnapshot * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getComponentSnapshot(): ComponentSnapshot; /** * Converts a value in vp units to a value in px. * @param { number } value * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ vp2px(value: number): number; /** * Converts a value in px units to a value in vp. * @param { number } value * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ px2vp(value: number): number; /** * Converts a value in fp units to a value in px. * @param { number } value * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ fp2px(value: number): number; /** * Converts a value in px units to a value in fp. * @param { number } value * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ px2fp(value: number): number; /** * Converts a value in lpx units to a value in px. * @param { number } value * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ lpx2px(value: number): number; /** * Converts a value in px units to a value in lpx. * @param { number } value * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ px2lpx(value: number): number; /** * Obtains the LocalStorage instance shared by this stage. * * @returns { LocalStorage | undefined } * @syscap SystemCapability.ArkUI.ArkUI.Full * @stagemodelonly * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getSharedLocalStorage(): LocalStorage | undefined; /** * Obtains context of the ability. * * @returns { Context | undefined } * @syscap SystemCapability.ArkUI.ArkUI.Full * @stagemodelonly * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getHostContext(): Context | undefined; /** * Get the name of current window. * * @returns { string | undefined } The name of current window, or undefined if the window doesn't exist. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ getWindowName(): string | undefined; /** * Get the width breakpoint of current window. * * @returns { WidthBreakpoint } The width breakpoint of current window. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ getWindowWidthBreakpoint(): WidthBreakpoint; /** * Get the height breakpoint of current window. * * @returns { HeightBreakpoint } The height breakpoint of current window. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ getWindowHeightBreakpoint(): HeightBreakpoint; /** * Creates a sheet whose content is as defined in bindSheetContent and displays the sheet. * This API uses a promise to return the result. * * @param { ComponentContent } bindSheetContent - Content to display on the sheet. * @param { SheetOptions } sheetOptions - Style of the sheet. *

**NOTE**: *
1. SheetOptions.uiContext cannot be set. Its value is fixed to the UIContext object of the current instance. *
2.If targetId is not passed in, SheetOptions.preferType cannot be set to POPUP; if POPUP is set, it will be * replaced with CENTER. *
3. If targetId is not passed in, SheetOptions.mode cannot be set to EMBEDDED; the default mode is OVERLAY. *
4. For the default values of other attributes, @see SheetOptions. *

* @param { number } targetId - ID of the component to be bound. If this parameter is not set, no component is bound. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 120001 - The bindSheetContent is incorrect. * @throws { BusinessError } 120002 - The bindSheetContent already exists. * @throws { BusinessError } 120004 - The targetId does not exist. * @throws { BusinessError } 120005 - The node of targetId is not in the component tree. * @throws { BusinessError } 120006 - The node of targetId is not a child of the page node or NavDestination node. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ openBindSheet(bindSheetContent: ComponentContent, sheetOptions?: SheetOptions, targetId?: number): Promise; /** * Update the BindSheet with sheetOptions. * * @param { ComponentContent } bindSheetContent - The content of BindSheet. * @param { SheetOptions } sheetOptions - The update options of sheet. * @param { boolean } partialUpdate - If true, only the specified properties in the sheetOptions are updated, * otherwise the rest of the properties are overwritten with the default values. * Default value is false. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 120001 - The bindSheetContent is incorrect. * @throws { BusinessError } 120003 - The bindSheetContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ updateBindSheet(bindSheetContent: ComponentContent, sheetOptions: SheetOptions, partialUpdate?: boolean): Promise; /** * Closes the sheet corresponding to bindSheetContent. This API uses a promise to return the result. *

**NOTE**: *
Closing a sheet using this API will not invoke the shouldDismiss callback. *

* * @param { ComponentContent } bindSheetContent - Content to display on the sheet. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 120001 - The bindSheetContent is incorrect. * @throws { BusinessError } 120003 - The bindSheetContent cannot be found. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ closeBindSheet(bindSheetContent: ComponentContent): Promise; /** * Post a frame callback to run on the next frame. * * @param { FrameCallback } frameCallback - The frame callback to run on the next frame. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ postFrameCallback(frameCallback: FrameCallback): void; /** * Post a frame callback to run on the next frame after the specified delay. * * @param { FrameCallback } frameCallback - The frame callback to run on the next frame. * @param { number } delayTime - The delay time in milliseconds, * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ postDelayedFrameCallback(frameCallback: FrameCallback, delayTime: number): void; /** * Require DynamicSyncScene by id. * * @param { string } id - The id of DynamicSyncScene. * @returns { Array} The instance of SwiperDynamicSyncScene. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ requireDynamicSyncScene(id: string): Array; /** * Clear the cache generated by using $r/$rawfile to retrieve resources. This cache is used to accelerate the process * of repeatedly loading resources. Clearing this cache may slow down the loading speed of resources during page overload. * * @throws { BusinessError } 202 - The caller is not a system application. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @atomicservice * @since 12 */ /** * Clear the cache generated by using $r/$rawfile to retrieve resources. This cache is used to accelerate the process * of repeatedly loading resources. Clearing this cache may slow down the loading speed of resources during page overload. * * @throws { BusinessError } 202 - The caller is not a system application. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ clearResourceCache(): void; /** * Checks whether current font scale follows the system. * * @returns { boolean } Returns true if current font scale follows the system; returns false otherwise. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ isFollowingSystemFontScale(): boolean; /** * Get the max font scale. * * @returns { number } The max font scale. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ getMaxFontScale(): number; /** * Bind tabs to scrollable container component to automatically hide tab bar. * * @param { TabsController } tabsController - The controller of the tabs. * @param { Scroller } scroller - The controller of the scrollable container component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ bindTabsToScrollable(tabsController: TabsController, scroller: Scroller): void; /** * Unbind tabs from scrollable container component. * * @param { TabsController } tabsController - The controller of the tabs. * @param { Scroller } scroller - The controller of the scrollable container component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ unbindTabsFromScrollable(tabsController: TabsController, scroller: Scroller): void; /** * Bind tabs to nested scrollable container components to automatically hide tab bar. * * @param { TabsController } tabsController - The controller of the tabs. * @param { Scroller } parentScroller - The controller of the parent scrollable container component. * @param { Scroller } childScroller - The controller of the child scrollable container component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ bindTabsToNestedScrollable(tabsController: TabsController, parentScroller: Scroller, childScroller: Scroller): void; /** * Unbind tabs from nested scrollable container components. * * @param { TabsController } tabsController - The controller of the tabs. * @param { Scroller } parentScroller - The controller of the parent scrollable container component. * @param { Scroller } childScroller - The controller of the child scrollable container component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'13','1.2':'20' } * @arkts 1.1&1.2 */ unbindTabsFromNestedScrollable(tabsController: TabsController, parentScroller: Scroller, childScroller: Scroller): void; /** * whether to enable or disable swipe to back event. * * @param { Optional } enabled - enable or disable swipe to back event. * @syscap SystemCapability.ArkUI.ArkUI.Circle * @atomicservice * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ enableSwipeBack(enabled: Optional): void; /** * Sets the component freezing flag based on the component id to prevent the * UI component from marking and updating dirty areas. * @param { string } id - Id of the frame node. * @param { boolean } isFrozen - whether the component is frozen. * @throws { BusinessError } 202 - The caller is not a system application. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ freezeUINode(id: string, isFrozen: boolean): void; /** * Sets the component freezing flag based on the component uniqueId to prevent the * UI component from marking and updating dirty areas. * @param { number } uniqueId - Unique Id of the frame node. * @param { boolean } isFrozen - whether the component is frozen. * @throws { BusinessError } 202 - The caller is not a system application. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since arkts { '1.1':'18','1.2':'20' } * @arkts 1.1&1.2 */ freezeUINode(uniqueId: number, isFrozen: boolean): void; /** * Get object text menu controller. * * @returns { TextMenuController } object text menu controller. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'16','1.2':'20' } * @arkts 1.1&1.2 */ getTextMenuController(): TextMenuController; /** * Set the keyboard appearance config for this input component before attach InputMethod. * * @param { number } uniqueId - The unique id of the input component. * @param { KeyboardAppearanceConfig } config - The config of keyboard. * @throws { BusinessError } 202 - The caller is not a system application. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 20 */ setKeyboardAppearanceConfig(uniqueId: number, config: KeyboardAppearanceConfig): void; /** * Create a UI instance singleton without window and get its UIContext object. * * @param { common.UIAbilityContext | common.ExtensionContext } context - UIAbilityContext or ExtensionContext. * @returns { UIContext | undefined } object UIContext, or undefined when failed. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. The number of parameters is incorrect. *
2. Invalid parameter type of context. * @throws { BusinessError } 100001 - Internal error. * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'17','1.2':'20' } * @arkts 1.1&1.2 */ static createUIContextWithoutWindow(context: common.UIAbilityContext | common.ExtensionContext) : UIContext | undefined; /** * Destroy the UI instance singleton without window. * * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'17','1.2':'20' } * @arkts 1.1&1.2 */ static destroyUIContextWithoutWindow(): void; } /** * Enum of KeyBoardAvoidMethodType * * @enum { number } KeyBoardAvoidMethodType * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ export const enum KeyboardAvoidMode { /** * Offset Type, the layout moves up. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ OFFSET = 0, /** * Resize Type, the layout is resized. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'11','1.2':'20' } * @arkts 1.1&1.2 */ RESIZE = 1, /** * Offset Type, the layout moves up, and this adjustment also occurs if the caret position in the text box changes. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ OFFSET_WITH_CARET = 2, /** * Resize Type, the layout moves up, and this adjustment also occurs if the caret position in the text box changes. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ RESIZE_WITH_CARET = 3, /** * None Type, the layout is not adjusted to avoid the keyboard. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ NONE = 4, } /** * Enum of SwiperDynamicSyncSceneType * * @enum { number } SwiperDynamicSyncSceneType * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ export const enum SwiperDynamicSyncSceneType { /** * Scene type is GESTURE. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ GESTURE = 0, /** * Scene type is ANIMATION. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'12','1.2':'20' } * @arkts 1.1&1.2 */ ANIMATION = 1 } /** * Enum of scene type for Marquee * * @enum { number } MarqueeDynamicSyncSceneType * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ export const enum MarqueeDynamicSyncSceneType { /** * Scene type is ANIMATION. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts { '1.1':'14','1.2':'20' } * @arkts 1.1&1.2 */ ANIMATION = 1 } /** * class TextMenuController * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'16','1.2':'20' } * @arkts 1.1&1.2 */ export declare class TextMenuController { /** * Set text menu options. * * @param { TextMenuOptions } options - the options of the text menu. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts { '1.1':'16','1.2':'20' } * @arkts 1.1&1.2 */ setMenuOptions(options: TextMenuOptions): void; /** * Disable all system service menus, such as translation and ai writer. * True means disable, false means enable. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 20 */ static disableSystemServiceMenuItems(disable: boolean): void; /** * Disable menu action by action id. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 20 */ static disableMenuItems(items: Array): void; } /** * An enumeration type that identifies the current node's rendering state. The UI components used in * the application are automatically managed by the system and controlled for participation in graphical * rendering by either mounting them onto the render tree or removing them from it. Only nodes that * participate in graphical rendering have the potential to be displayed. However, participating in * rendering does not equal to the node's visibility, as there may be many occlusion scenarios in the * actual implementation of the application. Nevertheless, if a node does not participate in rendering, * it will definitely not be visible. * * @enum { number } NodeRenderState * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export const enum NodeRenderState { /** * The node has been mount on to the render tree and will soon be rendered. Generally, after the next frame, * the user will be able to see this node. However, this is not always the case, as in reality, the node may be * occluded by other nodes, meaning it is rendered but not be visible. * When registering a listener for the render state using the UIObserver interface, the system will immediately * trigger the callback once, and the state notified at this time typically represents the current state. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ ABOUT_TO_RENDER_IN = 0, /** * The node has been removed from the render tree and will no longer be rendered shortly. Generally speaking, * after the next frame, the user will no longer be able to see this node. * When registering a listener for the render state using the UIObserver interface, the system will immediately * trigger the callback once, and the state notified at this time typically represents the current state. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ ABOUT_TO_RENDER_OUT = 1 } /** * This is an enumeration type representing the gesture callback phases to be triggered, corresponding to * the action callbacks defined in gesture.d.ts. Therefore, not all gesture types have all the following * phase definitions. For example, SwipeGesture only has one callback named onAction, so it also only has * one enumeration type, which is WILL_START. * * @enum { number } GestureActionPhase * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export const enum GestureActionPhase { /** * The gesture has been successfully recognized by the system, and the action-start/action callback will be * executed immediately. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ WILL_START = 0, /** * This indicates the gesture has been determined to be an end, which usually happens when the user lifts their * fingers, ending the entire interaction, and the action-end callback will be executed immediately. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ WILL_END = 1 } /** * This is an enumeration type indicating what kind of gesture you want to monitor for. * * @enum { number } GestureListenerType * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ export const enum GestureListenerType { /** * The tap gesture. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ TAP = 0, /** * The long press gesture. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ LONG_PRESS = 1, /** * The pan gesture. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ PAN = 2, /** * The pinch gesture. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ PINCH = 3, /** * The swipe gesture. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ SWIPE = 4, /** * The rotation gesture. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ ROTATION = 5 }