/*
* Copyright (c) 2021-2025 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
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
declare namespace curves {
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
export enum Curve {
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Linear,
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Ease,
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
EaseIn,
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
EaseOut,
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
EaseInOut,
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
FastOutSlowIn,
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
LinearOutSlowIn,
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
FastOutLinearIn,
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
ExtremeDeceleration,
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Sharp,
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Rhythm,
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Smooth,
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Friction,
}
/**
* Interface for curve object.
*
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Interface for curve object.
*
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Interface for curve object.
*
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Interface for curve object.
*
* @interface ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
export interface ICurve {
/**
* Get curve value by fraction.
*
* @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1].
* Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used.
* @returns { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Get curve value by fraction.
*
* @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1].
* Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used.
* @returns { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Implements calculation.
*
* @param { number } fraction - Current normalized time.
Value range: [0, 1].
*
**NOTE**:
*
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**.
*
**NOTE**:
*
A value less than 1 evaluates to the value **1**.
*
**NOTE**:
*
If fraction is 0, the return value 0 corresponds to the animation start point; any other return value means
*
that the animation jumps at the start point.If fraction is 1, the return value 1 corresponds to the animation
*
end point; any other return value means that the end value of the animation is not the value of the state
*
variable, which will result in an effect of transition from that end value to the value of the state variable.
*
**NOTE**:
*
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**.
*
**NOTE**:
*
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the value 1 is used.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the value 1 is used.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the value 1 is used.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the default value **0.55** is used.
*
**NOTE**:
*
A value less than 0 evaluates to the default value **0.825**.
*
**NOTE**
*
A value less than 0 evaluates to the default value **0**.
*
The spring animation curve is physics-based. Its duration depends on the **springMotion** parameters and
* the previous velocity, rather than the **duration** parameter in animation, animateTo, or pageTransition.
* The time cannot be normalized. Therefore, the interpolation cannot be obtained using
* the **interpolate** function of the curve.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the default value **0.15** is used.
*
**NOTE**
*
A value less than 0 evaluates to the default value **0.86**.
*
**NOTE**:
*
A value less than 0 evaluates to the default value **0.25**.
*
To apply custom settings for a spring animation, you are advised to use **springMotion**.
*
When using **responsiveSpringMotion**, you are advised to retain the default settings.
*
The duration of the responsive spring animation depends on the **responsiveSpringMotion** parameters and the
* previous velocity, rather than the duration parameter in animation, animateTo, or pageTransition.
*
In addition, the interpolation cannot be obtained using the **interpolate** function of the curve.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the value **1** is used.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the value **1** is used.
*
**NOTE**:
*
If this parameter is set to a value less than or equal to 0, the value **1** is used.
*