/* * Copyright (c) 2021-2023 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 */ /** * Declare the jump method. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Declare the jump method. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Declare the jump method. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare enum RouteType { /** * The page is not redirected. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * The page is not redirected. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * The page is not redirected. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ None, /** * Go to the next page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Go to the next page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Go to the next page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ Push, /** * Redirect to a specified page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Redirect to a specified page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Redirect to a specified page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ Pop, } /** * Declare the sliding effect of transition. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Declare the sliding effect of transition. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Declare the sliding effect of transition. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare enum SlideEffect { /** * Swipe left. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Swipe left. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Swipe left. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ Left, /** * Swipe right. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Swipe right. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Swipe right. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ Right, /** * Swipe top. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Swipe top. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Swipe top. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ Top, /** * Swipe bottom. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Swipe bottom. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Swipe bottom. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ Bottom, /** * Swipe start. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ START = 5, /** * Swipe end. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ END = 6, } /** * Provides interfaces for common transitions. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Provides interfaces for common transitions. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides interfaces for common transitions. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare class CommonTransition { /** * Called when a transition method is required. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when a transition method is required. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when a transition method is required. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ constructor(); /** * Called when the slide in effect of the transition is set. * * @param { SlideEffect } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the slide in effect of the transition is set. * * @param { SlideEffect } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when the slide in effect of the transition is set. * * @param { SlideEffect } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ slide(value: SlideEffect): T; /** * Called when the translation effect of page transition is set. * * @param { object } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the translation effect of page transition is set. * * @param { object } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when the translation effect of page transition is set. * * @param { object } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Called when the translation effect of page transition is set. * * Anonymous Object Rectification. * @param { TranslateOptions } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ translate(value: TranslateOptions): T; /** * Called when setting the zoom effect of page transition. * * @param { object } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when setting the zoom effect of page transition. * * @param { object } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when setting the zoom effect of page transition. * * @param { object } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Called when setting the zoom effect of page transition. * * Anonymous Object Rectification. * @param { ScaleOptions } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ scale(value: ScaleOptions): T; /** * Called when the transparency value of the starting point of entry or the ending point of exit is set. * * @param { number } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the transparency value of the starting point of entry or the ending point of exit is set. * * @param { number } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when the transparency value of the starting point of entry or the ending point of exit is set. * * @param { number } value * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ opacity(value: number): T; } /** * Defines pageTransition constructor parameters. * * @interface PageTransitionOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Defines pageTransition constructor parameters. * * @interface PageTransitionOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defines pageTransition constructor parameters. * * @interface PageTransitionOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare interface PageTransitionOptions { /** * RouteType in which the pageTransition can work. * @type { ?RouteType } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * RouteType in which the pageTransition can work. * @type { ?RouteType } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * RouteType in which the pageTransition can work. * @type { ?RouteType } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ type?: RouteType; /** * PageTransition animation duration, in ms. * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * PageTransition animation duration, in ms. * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * PageTransition animation duration, in ms. * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ duration?: number; /** * PageTransition animation curve. * @type { ?(Curve | string) } * @default Curve.Linear * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * PageTransition animation curve. * @type { ?(Curve | string | ICurve) } * @default Curve.Linear * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * PageTransition animation curve. * @type { ?(Curve | string | ICurve) } * @default Curve.Linear * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ curve?: Curve | string | ICurve; /** * PageTransition animation delay time, in ms. * @type { ?number } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * PageTransition animation delay time, in ms. * @type { ?number } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * PageTransition animation delay time, in ms. * @type { ?number } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ delay?: number; } /** * Callback used to report page trasition events. * * @typedef { function } PageTransitionCallback * @param { RouteType } type - transition route type * @param { number } progress - transition progess * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ declare type PageTransitionCallback = (type: RouteType, progress: number) => void; /** * Provides an interface for page rotation mode. * * @extends CommonTransition * @interface PageTransitionEnterInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Provides an interface to set transition style when a page enters. * * @extends CommonTransition * @interface PageTransitionEnterInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides an interface to set transition style when a page enters. * * @extends CommonTransition * @interface PageTransitionEnterInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ interface PageTransitionEnterInterface extends CommonTransition { /** * Called when page Jump animation is used. * * @param { PageTransitionOptions } value * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when page Jump animation is used. * * @param { PageTransitionOptions } value - pageTransition options * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when page Jump animation is used. * * @param { PageTransitionOptions } value - pageTransition options * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ (value: PageTransitionOptions): PageTransitionEnterInterface; /** * Called when the incoming parameter is the normalized progress of the current incoming animation. * * @param { function } event * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called frame by frame to customize pageTransition animation when the page enters. * The incoming parameter is the normalized progress of the current incoming animation. * * @param { function } event - animation callback frame by frame * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called frame by frame to customize pageTransition animation when the page enters. * The incoming parameter is the normalized progress of the current incoming animation. * * @param { function } event - animation callback frame by frame * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Called frame by frame to customize pageTransition animation when the page enters. * The incoming parameter is the normalized progress of the current incoming animation. * * Anonymous Object Rectification. * @param { PageTransitionCallback } event - animation callback frame by frame * @returns { PageTransitionEnterInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ onEnter(event: PageTransitionCallback): PageTransitionEnterInterface; } /** * Provide an interface to exit the transition. * * @extends CommonTransition * @interface PageTransitionExitInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Provide an interface to set transition style when a page exits. * * @extends CommonTransition * @interface PageTransitionExitInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provide an interface to set transition style when a page exits. * * @extends CommonTransition * @interface PageTransitionExitInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ interface PageTransitionExitInterface extends CommonTransition { /** * Called when the transition is delayed. * * @param { PageTransitionOptions } value * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when page Jump animation is used. * * @param { PageTransitionOptions } value - pageTransition options * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when page Jump animation is used. * * @param { PageTransitionOptions } value - pageTransition options * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ (value: PageTransitionOptions): PageTransitionExitInterface; /** * Called when the input parameter is the normalized progress of the current exit animation. * * @param { function } event * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called frame by frame to customize pageTransition animation when the page exits. * The input parameter is the normalized progress of the current exit animation. * * @param { function } event * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called frame by frame to customize pageTransition animation when the page exits. * The input parameter is the normalized progress of the current exit animation. * * @param { function } event * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Called frame by frame to customize pageTransition animation when the page exits. * The input parameter is the normalized progress of the current exit animation. * * Anonymous Object Rectification. * @param { PageTransitionCallback } event * @returns { PageTransitionExitInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ onExit(event: PageTransitionCallback): PageTransitionExitInterface; } /** * Defines PageTransitionEnter Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Defines PageTransitionEnter Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defines PageTransitionEnter Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare const PageTransitionEnter: PageTransitionEnterInterface; /** * Defines PageTransitionExit Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Defines PageTransitionExit Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defines PageTransitionExit Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare const PageTransitionExit: PageTransitionExitInterface;