From a5fcb41d1914ba177aedc0c398457a1f92f3ad57 Mon Sep 17 00:00:00 2001 From: cheng-feiwang Date: Sat, 9 Aug 2025 16:08:43 +0800 Subject: [PATCH] fix sdk 3 Signed-off-by: cheng-feiwang Change-Id: I727c058073f62a92887482efa4b82d01137c9243 --- api/@ohos.animator.d.ts | 110 ++---- api/@ohos.animator.static.d.ets | 359 +++++++++++++++++++ api/@ohos.arkui.ArcAlphabetIndexer.d.ts | 3 +- api/@ohos.arkui.shape.d.ts | 102 ++---- api/@ohos.arkui.shape.static.d.ets | 359 +++++++++++++++++++ api/@ohos.curves.d.ts | 221 +----------- api/@ohos.curves.static.d.ets | 359 +++++++++++++++++++ api/@ohos.matrix4.d.ts | 125 +++---- api/@ohos.matrix4.static.d.ets | 442 ++++++++++++++++++++++++ api/arkui/AlphabetIndexerModifier.d.ts | 2 +- 10 files changed, 1650 insertions(+), 432 deletions(-) create mode 100644 api/@ohos.animator.static.d.ets create mode 100644 api/@ohos.arkui.shape.static.d.ets create mode 100644 api/@ohos.curves.static.d.ets create mode 100644 api/@ohos.matrix4.static.d.ets diff --git a/api/@ohos.animator.d.ts b/api/@ohos.animator.d.ts index 7b40c6e1ec..296ec868c8 100644 --- a/api/@ohos.animator.d.ts +++ b/api/@ohos.animator.d.ts @@ -18,11 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { FillMode, PlayMode } from './arkui/component/enums'; -import { ExpectedFrameRateRange } from './arkui/component/common'; -/*** endif */ - /** * Defines the animator options. * @interface AnimatorOptions @@ -42,8 +37,7 @@ import { ExpectedFrameRateRange } from './arkui/component/common'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ export interface AnimatorOptions { /** @@ -68,8 +62,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ duration: number; @@ -141,8 +134,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ easing: string; @@ -168,8 +160,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ delay: number; @@ -198,8 +189,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fill: "none" | "forwards" | "backwards" | "both"; @@ -225,8 +215,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; @@ -252,8 +241,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ iterations: number; @@ -279,8 +267,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ begin: number; @@ -306,8 +293,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ end: number; } @@ -318,8 +304,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ export declare class SimpleAnimatorOptions { /** @@ -330,8 +315,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ constructor(begin: number, end: number); @@ -343,8 +327,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ duration(duration: number): SimpleAnimatorOptions; @@ -370,8 +353,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ easing(curve: string): SimpleAnimatorOptions; @@ -383,8 +365,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ delay(delay: number): SimpleAnimatorOptions; @@ -396,8 +377,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ fill(fillMode: FillMode): SimpleAnimatorOptions; @@ -409,8 +389,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ direction(direction: PlayMode): SimpleAnimatorOptions; @@ -422,8 +401,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ iterations(iterations: number): SimpleAnimatorOptions; } @@ -447,8 +425,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ export interface AnimatorResult { /** @@ -495,8 +472,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ reset(options: AnimatorOptions): void; @@ -511,8 +487,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ reset(options: AnimatorOptions | SimpleAnimatorOptions): void; @@ -532,8 +507,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ play(): void; @@ -553,8 +527,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ finish(): void; @@ -574,8 +547,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ pause(): void; @@ -595,8 +567,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ cancel(): void; @@ -617,8 +588,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ reverse(): void; @@ -651,8 +621,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onFrame: (progress: number) => void; @@ -685,8 +654,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onFinish: () => void; @@ -719,8 +687,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onCancel: () => void; @@ -753,8 +720,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onRepeat: () => void; @@ -763,8 +729,7 @@ export interface AnimatorResult { * @param { ExpectedFrameRateRange } rateRange - Indicates ExpectedFrameRateRange. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setExpectedFrameRateRange(rateRange: ExpectedFrameRateRange): void; } @@ -787,15 +752,7 @@ export interface AnimatorResult { * @atomicservice * @since 11 */ -/** - * Defines the Animator class. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ -declare class Animator { +export default class Animator { /** * Create an animator object for custom animation. * @param { AnimatorOptions } options - Options. @@ -858,10 +815,7 @@ declare class Animator { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ static create(options: AnimatorOptions | SimpleAnimatorOptions): AnimatorResult; } - -export default Animator; diff --git a/api/@ohos.animator.static.d.ets b/api/@ohos.animator.static.d.ets new file mode 100644 index 0000000000..6ce2c66ed0 --- /dev/null +++ b/api/@ohos.animator.static.d.ets @@ -0,0 +1,359 @@ +/* + * 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; diff --git a/api/@ohos.arkui.ArcAlphabetIndexer.d.ts b/api/@ohos.arkui.ArcAlphabetIndexer.d.ts index 2fdcf701cb..22f78240c3 100755 --- a/api/@ohos.arkui.ArcAlphabetIndexer.d.ts +++ b/api/@ohos.arkui.ArcAlphabetIndexer.d.ts @@ -1,6 +1,6 @@ /* * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * @@ -283,6 +283,7 @@ declare class ArcAlphabetIndexerAttribute extends CommonMethod) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radius?: number | string | Array; } @@ -91,18 +84,16 @@ export interface RectShapeOptions extends ShapeSize { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ -export interface RoundRectShapeOptions extends ShapeSize { +interface RoundRectShapeOptions extends ShapeSize { /** * Defines the width of the corner radius for RectShape. * @type { ? (number | string) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusWidth?: number | string; @@ -112,8 +103,7 @@ export interface RoundRectShapeOptions extends ShapeSize { * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusHeight?: number | string; } @@ -126,18 +116,16 @@ export interface RoundRectShapeOptions extends ShapeSize { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ -export interface PathShapeOptions { +interface PathShapeOptions { /** * Defines the commands for drawing the PathShape. * @type { ?string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ commands?: string; } @@ -149,8 +137,7 @@ export interface PathShapeOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class CommonShapeMethod { /** @@ -162,8 +149,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ offset(offset: Position): T; @@ -176,8 +162,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fill(color: ResourceColor): T; @@ -190,8 +175,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ position(position: Position): T; } @@ -204,8 +188,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class BaseShape extends CommonShapeMethod { /** @@ -217,8 +200,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ width(width: Length): T; @@ -231,8 +213,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ height(height: Length): T; @@ -245,8 +226,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ size(size: SizeOptions): T; } @@ -259,8 +239,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class RectShape extends BaseShape { /** @@ -271,8 +250,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: RectShapeOptions | RoundRectShapeOptions); @@ -285,8 +263,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusWidth(rWidth: number | string): RectShape; @@ -299,8 +276,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusHeight(rHeight: number | string): RectShape; @@ -313,8 +289,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radius(radius: number | string | Array): RectShape; } @@ -327,8 +302,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class CircleShape extends BaseShape { /** @@ -339,8 +313,7 @@ export declare class CircleShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: ShapeSize); } @@ -353,8 +326,7 @@ export declare class CircleShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class EllipseShape extends BaseShape { /** @@ -365,8 +337,7 @@ export declare class EllipseShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: ShapeSize); } @@ -379,8 +350,7 @@ export declare class EllipseShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class PathShape extends CommonShapeMethod { /** @@ -391,8 +361,7 @@ export declare class PathShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: PathShapeOptions); @@ -405,8 +374,7 @@ export declare class PathShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ commands(commands: string): PathShape; } \ No newline at end of file diff --git a/api/@ohos.arkui.shape.static.d.ets b/api/@ohos.arkui.shape.static.d.ets new file mode 100644 index 0000000000..6ce2c66ed0 --- /dev/null +++ b/api/@ohos.arkui.shape.static.d.ets @@ -0,0 +1,359 @@ +/* + * 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; diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts index 6e9f42033b..06e4518f43 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,8 +522,7 @@ 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; @@ -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..6ce2c66ed0 --- /dev/null +++ b/api/@ohos.curves.static.d.ets @@ -0,0 +1,359 @@ +/* + * 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; diff --git a/api/@ohos.matrix4.d.ts b/api/@ohos.matrix4.d.ts index 96ffc1d561..dcb363f685 100644 --- a/api/@ohos.matrix4.d.ts +++ b/api/@ohos.matrix4.d.ts @@ -40,8 +40,7 @@ * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare namespace matrix4 { /** @@ -66,10 +65,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface TranslateOption { + interface TranslateOption { /** * Indicates the translation distance of the x-axis, in px. * @@ -95,8 +93,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ x?: number; @@ -125,8 +122,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ y?: number; @@ -155,8 +151,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ z?: number; } @@ -183,10 +178,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface ScaleOption { + interface ScaleOption { /** * Zoom factor of the x-axis. * @@ -213,8 +207,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ x?: number; @@ -244,8 +237,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ y?: number; @@ -275,8 +267,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ z?: number; @@ -305,8 +296,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerX?: number; @@ -335,8 +325,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerY?: number; } @@ -363,10 +352,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface RotateOption { + interface RotateOption { /** * Axis of rotation vector x coordinate. * @@ -391,8 +379,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ x?: number; @@ -420,8 +407,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ y?: number; @@ -450,8 +436,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ z?: number; @@ -482,8 +467,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerX?: number; @@ -514,8 +498,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerY?: number; @@ -542,8 +525,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ angle?: number; } @@ -556,8 +538,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export interface Point { @@ -568,8 +549,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ x: number; @@ -580,8 +560,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ y: number; } @@ -593,8 +572,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export interface PolyToPolyOptions { @@ -605,8 +583,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ src: Array; @@ -617,8 +594,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ srcIndex?: number; @@ -629,8 +605,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ dst:Array; @@ -642,8 +617,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ dstIndex?: number; @@ -657,8 +631,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ pointCount?:number; @@ -685,10 +658,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface Matrix4Transit { + interface Matrix4Transit { /** * Copy function of Matrix, which can copy a copy of the current matrix object. * @@ -711,8 +683,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ copy(): Matrix4Transit; @@ -738,8 +709,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ invert(): Matrix4Transit; @@ -768,8 +738,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ combine(options: Matrix4Transit): Matrix4Transit; @@ -798,8 +767,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ translate(options: TranslateOption): Matrix4Transit; @@ -828,8 +796,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scale(options: ScaleOption): Matrix4Transit; @@ -844,8 +811,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ skew(x: number, y: number): Matrix4Transit; @@ -874,8 +840,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rotate(options: RotateOption): Matrix4Transit; @@ -904,8 +869,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ transformPoint(options: [number, number]): [number, number]; @@ -917,8 +881,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setPolyToPoly(options: PolyToPolyOptions): Matrix4Transit; } @@ -1013,8 +976,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function init( options: [ @@ -1059,8 +1021,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function identity(): Matrix4Transit; diff --git a/api/@ohos.matrix4.static.d.ets b/api/@ohos.matrix4.static.d.ets new file mode 100644 index 0000000000..e58cde4376 --- /dev/null +++ b/api/@ohos.matrix4.static.d.ets @@ -0,0 +1,442 @@ +/* + * 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 + */ + +/** + * Used to do matrix operations + * + * @namespace matrix4 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare namespace matrix4 { + + /** + * Set translation parameters + * + * @interface TranslateOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface TranslateOption { + + /** + * Indicates the translation distance of the x-axis, in px. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: number; + + /** + * Indicates the translation distance of the y-axis, in px. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: number; + + /** + * Indicates the translation distance of the z-axis, in px. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + z?: number; + } + + /** + * Set scaling parameters + * + * @interface ScaleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface ScaleOption { + + /** + * Zoom factor of the x-axis. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: number; + + + /** + * Zoom factor of the y-axis. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: number; + + /** + * Zoom factor of the z-axis. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + z?: number; + + + /** + * Transform the x-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerX?: number; + + /** + * Transform the y-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerY?: number; + } + + /** + * Set Rotation Parameters. + * + * @interface RotateOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface RotateOption { + + /** + * Axis of rotation vector x coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: number; + + /** + * Axis of rotation vector y coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: number; + + /** + * Axis of rotation vector z coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + z?: number; + + /** + * Transform the x-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerX?: number; + + /** + * Transform the y-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerY?: number; + + /** + * Rotation angle. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + angle?: number; + } + /** + * Set poly to poly point. + * + * @interface Point + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface Point { + /** + * Point x. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x: number; + /** + * Point y. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y: number; + } + /** + * Set poly to poly point options. + * + * @interface PolyToPolyOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface PolyToPolyOptions { + /** + * Array of point coordinates for the source polygon. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + src: Array; + /** + * Start point index of the source polygon, which defaults to 0. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + srcIndex?: number; + /** + * Array of point coordinates for the target polygon. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + dst: Array; + /** + * Start index of the target polygon, which defaults to 0. + * + * @type { ?number } + * @default src.Length/2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + dstIndex?: number; + /** + * The number of points to be used. + * If it is 0, it returns the identity matrix. + * If it is 1, it returns a translation matrix that changed before two points. + * If it is 2-4, it returns a transformation matrix. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + pointCount?: number; + } + + + /** + * Matrix4Transit. + * + * @interface Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface Matrix4Transit { + + + /** + * Copy function of Matrix, which can copy a copy of the current matrix object. + * + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + copy(): Matrix4Transit; + + + /** + * The inverse function of Matrix returns an inverse matrix of the current matrix object, that is, the effect is exactly the opposite. + * + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + invert(): Matrix4Transit; + + + /** + * Matrix superposition function, which can superpose the effects of two matrices to generate a new matrix object. + * + * @param { Matrix4Transit } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + combine(options: Matrix4Transit): Matrix4Transit; + + + /** + * Matrix translation function, which can add the x-axis, Y-axis, or Z-axis translation effect to the current matrix. + * + * @param { TranslateOption } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + translate(options: TranslateOption): Matrix4Transit; + + + /** + * Scaling function of the Matrix, which can add the x-axis, Y-axis, or Z-axis scaling effect to the current matrix. + * + * @param { ScaleOption } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scale(options: ScaleOption): Matrix4Transit; + /** + * Skew function of the Matrix, which can add the x-axis, y-axis skew effect to the current matrix. + * Skew function takes a generic point with coordinates (x0, y0, z0) to the point (x0 + x*y0, y0 + y*x0, z0), + * where x, y are fixed parameters, called the shear factors. + * + * @param { number } x - the shear factor of x-axis. + * @param { number } y - the shear factor of y-axis. + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + skew(x: number, y: number): Matrix4Transit; + + + /** + * Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix. + * + * @param { RotateOption } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rotate(options: RotateOption): Matrix4Transit; + + + /** + * Matrix coordinate point conversion function, which can apply the current transformation effect to a coordinate point. + * + * @param { [number, number] } options + * @returns { [number, number] } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transformPoint(options: [ + number, + number + ]): [ + number, + number + ]; + /** + * Sets matrix to map src to dst. + * + * @param { PolyToPolyOptions } options - polyToPoly options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setPolyToPoly(options: PolyToPolyOptions): Matrix4Transit; + } + + + + /** + * Constructor of Matrix, which can create a fourth-order matrix based on the input parameters. The matrix is column-first. + * + * @param { [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number] } options + * options indicates a fourth-order matrix + * The default value: + * [1, 0, 0, 0, + * 0, 1, 0, 0, + * 0, 0, 1, 0, + * 0, 0, 0, 1] + * Fourth-order matrix notes: + * m00 { number } -The x-axis scale value, the identity matrix defaults to 1. + * m01 { number } -The second value, the rotation and skew of the xyz axis affects this value. + * m02 { number } -The third value, the rotation of the xyz axis affects this value. + * m03 { number } -The fourth value, the perspective projection affects this value. + * m10 { number } -The fifth value, the rotation and skew of the xyz axis affects this value. + * m11 { number } -The y-axis scales the value, and the identity matrix defaults to 1. + * m12 { number } -The 7th value, the rotation of the xyz axis affects this value. + * m13 { number } -The 8th value, the perspective projection affects this value. + * m20 { number } -The 9th value, the rotation of the xyz axis affects this value. + * m21 { number } -The 10th value, xyz axis rotation affects this value. + * m22 { number } -The z-axis scale value, the identity matrix defaults to 1. + * m23 { number } -The 12th value, the perspective projection affects this value. + * m30 { number } -The x-axis translation value in px, the identity matrix defaults to 0. + * m31 { number } -Y-axis translation value, in px, the identity matrix defaults to 0. + * m32 { number } -The z-axis translation value in px, the identity matrix defaults to 0. + * m33 { number } -It takes effect in homogeneous coordinates to produce a perspective projection effect. + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + function init(options: [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]): Matrix4Transit; + + + /** + * Matrix initialization function, which can return an identity matrix object. + * + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + function identity(): Matrix4Transit; +} +export default matrix4; diff --git a/api/arkui/AlphabetIndexerModifier.d.ts b/api/arkui/AlphabetIndexerModifier.d.ts index c68ab3f2ef..947d4f7a3d 100755 --- a/api/arkui/AlphabetIndexerModifier.d.ts +++ b/api/arkui/AlphabetIndexerModifier.d.ts @@ -28,7 +28,7 @@ * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 -*/ + */ /** * Defines AlphabetIndexer Modifier * -- Gitee