From 01a6ba6656a895b15e698bc4173f9f8f757ca66d Mon Sep 17 00:00:00 2001 From: chenwenchang Date: Sat, 9 Aug 2025 19:04:08 +0800 Subject: [PATCH] adapt curve for 0702 Signed-off-by: chenwenchang --- api/@ohos.curves.d.ts | 223 ++------------------- api/@ohos.curves.static.d.ets | 360 ++++++++++++++++++++++++++++++++++ 2 files changed, 379 insertions(+), 204 deletions(-) create mode 100644 api/@ohos.curves.static.d.ets diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts index 6e9f42033b..3c0b0007a8 100644 --- a/api/@ohos.curves.d.ts +++ b/api/@ohos.curves.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * 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 @@ -42,17 +42,6 @@ * @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. @@ -78,18 +67,7 @@ declare namespace curves { * @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 { + enum Curve { /** * Linear. Indicates that the animation has the same velocity from start to finish. * @@ -111,16 +89,6 @@ declare namespace curves { * @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, @@ -146,17 +114,6 @@ declare namespace curves { * @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). @@ -179,16 +136,6 @@ declare namespace curves { * @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). @@ -211,16 +158,6 @@ declare namespace curves { * @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). @@ -243,16 +180,6 @@ declare namespace curves { * @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). @@ -275,16 +202,6 @@ declare namespace curves { * @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). @@ -307,16 +224,6 @@ declare namespace curves { * @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). @@ -339,16 +246,6 @@ declare namespace curves { * @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). @@ -371,16 +268,6 @@ declare namespace curves { * @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). @@ -403,16 +290,6 @@ declare namespace curves { * @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). @@ -435,16 +312,6 @@ declare namespace curves { * @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). @@ -467,16 +334,6 @@ declare namespace curves { * @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). @@ -499,16 +356,6 @@ declare namespace curves { * @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, } @@ -536,18 +383,7 @@ declare namespace curves { * @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 { + interface ICurve { /** * Get curve value by fraction. * @@ -580,19 +416,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * 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 - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ interpolate(fraction: number): number; } @@ -622,10 +445,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function initCurve(curve?: Curve): ICurve; + function initCurve(curve?: Curve): ICurve; /** * Initializes the interpolator curve when called. @@ -672,10 +494,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function stepsCurve(count: number, end: boolean): ICurve; + function stepsCurve(count: number, end: boolean): ICurve; /** * Constructs a custom curve when called. @@ -701,10 +522,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function customCurve(interpolate: (fraction: number) => number): ICurve; + function customCurve(interpolate: (fraction: number) => number): ICurve; /** * Constructs a step curve when called. @@ -762,10 +582,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; + function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; /** * Creates a cubic Bezier curve. The curve value must range from 0 to 1. This API is deprecated since API version 9. @@ -838,10 +657,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; /** * Constructs a spring curve when called. @@ -920,10 +738,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; /** * Constructs a responsive spring motion when called. @@ -980,10 +797,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; /** * Constructs an interpolating spring curve when called, the animation duration can not be specified manually, @@ -1034,10 +850,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; } export default curves; diff --git a/api/@ohos.curves.static.d.ets b/api/@ohos.curves.static.d.ets new file mode 100644 index 0000000000..7f4359f97e --- /dev/null +++ b/api/@ohos.curves.static.d.ets @@ -0,0 +1,360 @@ +'use static' +/* + * Copyright (c) 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 + * @arkts 1.2 + */ + +/** + * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. + * + * @namespace curves + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare namespace curves { + + /** + * enum Curve. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export enum Curve { + + /** + * Linear. Indicates that the animation has the same velocity from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + 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 20 + */ + 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 20 + */ + 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 20 + */ + 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 20 + */ + EaseInOut, + + /** + * FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutSlowIn, + + /** + * LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LinearOutSlowIn, + + /** + * FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutLinearIn, + + /** + * ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ExtremeDeceleration, + + /** + * Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Sharp, + + /** + * Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Rhythm, + + /** + * Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Smooth, + + /** + * Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Friction + } + + /** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + 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 20 + */ + interpolate(fraction: number): number; + } + + /** + * Implements initialization for the interpolation curve, + * which is used to create an interpolation curve based on the input parameter. + * + * @param { Curve } [curve] - Curve type.
Default value: **Curve.Linear**. + * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function initCurve(curve?: Curve): ICurve; + + /** + * Creates a step curve. + * + * @param { number } count - Number of steps. The value must be a positive integer.
Value range: [1, +∞). + *

**NOTE**: + *
A value less than 1 evaluates to the value **1**. + *

+ * @param { boolean } end -Whether jumping occurs when the interpolation ends. + * **true**: Jumping occurs when the interpolation ends. + * *false**: Jumping occurs when the interpolation starts. + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function stepsCurve(count: number, end: boolean): ICurve; + + /** + * Creates a custom curve. + * + * @param { function } interpolate - Custom interpolation callback.fraction: input x value for interpolation. + * when the animation starts. Value range: [0, 1]The return value is the y value of the curve. Value range: [0, 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. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function customCurve(interpolate: (fraction: number) => number): ICurve; + + /** + * Creates a cubic Bezier curve. The curve values must be between 0 and 1. + * + * @param { number } x1 - X coordinate of the first point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y1 - Y coordinate of the first point on the Bezier curve.
Value range: (-∞, +∞). + * @param { number } x2 - X coordinate of the second point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y2 - Y coordinate of the second point on the Bezier curve.
Value range: (-∞, +∞). + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; + + /** + * Creates a spring curve. The curve shape is subject to the spring parameters, and the animation duration + * is subject to the **duration** parameter in **animation** and **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. The velocity is the normalized + * velocity, and its value is equal to the actual velocity at the beginning of the animation divided by the + * animation attribute change value.Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + * Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } stiffness - Stiffness.It is the degree to which an object deforms by resisting the force + * applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, + * and the faster the speed of restoring to the equilibrium position.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } damping -Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + + /** + * Creates a spring animation curve. + * If multiple spring animations are applied to the same attribute of an object, + * each animation replaces their predecessor and inherits the velocity. + * + * @param { number } [response] Duration of one complete oscillation. + *
Default value: **0.55**.
Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.55** is used. + *

+ * @param { number } [dampingFraction] Damping coefficient. + * **0**: undamped. In this case, the spring oscillates forever.
> 0 and < 1: underdamped. + * In this case, the spring overshoots the equilibrium position.
**1**: critically damped. + * 1: overdamped. In this case, the spring approaches equilibrium gradually.
Default value: **0.825**. + * Unit: second. + * Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.825**. + *

+ * @param { number } [overlapDuration] Duration for animations to overlap, in seconds. + * When animations overlap, the **response** values of these animations will transit smoothly over this duratio + * if they are different.
Default value: **0**
Unit: second
Value range: [0, +∞). + *

**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. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates a responsive spring animation curve. It is a special case of [springMotion](#curvesspringmotion9), + * with the only difference in the default values. It can be used together with **springMotion**. + * + * @param { number } [response] See **response** in **springMotion**.
Default value: **0.15**. + * Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.15** is used. + *

+ * @param { number } [dampingFraction] See **dampingFraction** in **springMotion**.
Default value: **0.86**. + * Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0.86**. + *

+ * @param { number } [overlapDuration] See **overlapDuration** in **springMotion**.
Default value: **0.25**. + * Unit: second
Value range: [0, +∞). + *

**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. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based + * on the curve. The animation duration is subject to the curve parameters, rather than the **duration** parameter + * in **animation** or **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. + * The velocity is the normalized velocity, and its value is equal to the actual velocity at the beginning of + * the animation divided by the animation attribute change value.
Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + *
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } stiffness - Stiffness. It is the degree to which an object deforms by resisting + * the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist + * deformation, and the faster the speed of restoring to the equilibrium position.
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } damping - Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.
Value range: (0, +∞)
+ *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; +} +export default curves; -- Gitee