46 Star 176 Fork 4.8K

OpenHarmony/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.curves.d.ts 36.47 KB
一键复制 编辑 原始数据 按行查看 历史
chenxiaoxue 提交于 24天前 . mark
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
/*
* Copyright (c) 2021-2025 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkUI
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
*
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
declare namespace curves {
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* enum Curve.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
export enum Curve {
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Linear. Indicates that the animation has the same velocity from start to finish.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Linear,
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end,
* CubicBezier(0.25, 0.1, 0.25, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Ease,
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
EaseIn,
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
EaseOut,
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
EaseInOut,
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
FastOutSlowIn,
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
LinearOutSlowIn,
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
FastOutLinearIn,
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
ExtremeDeceleration,
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Sharp,
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Rhythm,
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Smooth,
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0).
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
Friction,
}
/**
* Interface for curve object.
*
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Interface for curve object.
*
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Interface for curve object.
*
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Interface for curve object.
*
* @interface ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
export interface ICurve {
/**
* Get curve value by fraction.
*
* @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1].
* Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used.
* @returns { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Get curve value by fraction.
*
* @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1].
* Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used.
* @returns { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Implements calculation.
*
* @param { number } fraction - Current normalized time.<br>Value range: [0, 1].
* <p>**NOTE**:
* <br>A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**.
* </p>
* @returns { number } - Curve interpolation corresponding to the normalized time point.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @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;
}
/**
* Initializes the interpolator curve when called.
*
* @param { Curve } [curve] The default value is Curve.Linear
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Initializes the interpolator curve when called.
*
* @param { Curve } [curve] The default value is Curve.Linear
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Implements initialization for the interpolation curve,
* which is used to create an interpolation curve based on the input parameter.
*
* @param { Curve } [curve] - Curve type.<br>Default value: **Curve.Linear**.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function initCurve(curve?: Curve): ICurve;
/**
* Initializes the interpolator curve when called.
*
* @param { Curve } [curve]
* @returns { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
* @deprecated since 9
* @useinstead initCurve
*/
function init(curve?: Curve): string;
/**
* Constructs a step curve when called.
*
* @param { number } count -The number of steps. The range of this value is [1, +∞).
* @param { boolean } end -A step change occurs at the start or end of each interval.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Constructs a step curve when called.
*
* @param { number } count -The number of steps. The range of this value is [1, +∞).
* @param { boolean } end -A step change occurs at the start or end of each interval.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Creates a step curve.
*
* @param { number } count - Number of steps. The value must be a positive integer.<br>Value range: [1, +∞).
* <p>**NOTE**:
* <br>A value less than 1 evaluates to the value **1**.
* </p>
* @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
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function stepsCurve(count: number, end: boolean): ICurve;
/**
* Constructs a custom curve when called.
*
* @param { function } interpolate - fraction range is [0,1], the return number must between [0,1].
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* 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].
* <p>**NOTE**:
* <br>If fraction is 0, the return value 0 corresponds to the animation start point; any other return value means
* <br>that the animation jumps at the start point.If fraction is 1, the return value 1 corresponds to the animation
* <br>end point; any other return value means that the end value of the animation is not the value of the state
* <br>variable, which will result in an effect of transition from that end value to the value of the state variable.
* </p>
* @returns { ICurve } Interpolation curve.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function customCurve(interpolate: (fraction: number) => number): ICurve;
/**
* Constructs a step curve when called.
*
* @param { number } count
* @param { boolean } end
* @returns { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
* @deprecated since 9
* @useinstead stepsCurve
*/
function steps(count: number, end: boolean): string;
/**
* Constructs a third-order Bezier curve when called.
* @param { number } x1 -Value range [0, 1].
* Note: If the value is less than 0, 0 is used. If the value is greater than 1, 1 is used.
* @param { number } y1 -Value range (-∞, +∞).
* @param { number } x2 -Value range [0, 1].
* Note: If the value is less than 0, 0 is used. If the value is greater than 1, 1 is used.
* @param { number } y2 -Value range (-∞, +∞).
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Constructs a third-order Bezier curve when called.
*
* @param { number } x1 -Value range [0, 1].
* Note: If the value is less than 0, 0 is used. If the value is greater than 1, 1 is used.
* @param { number } y1 -Value range (-∞, +∞).
* @param { number } x2 -Value range [0, 1].
* Note: If the value is less than 0, 0 is used. If the value is greater than 1, 1 is used.
* @param { number } y2 -Value range (-∞, +∞).
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* 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.<br>Value range: [0, 1].
* <p>**NOTE**:
* <br>A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**.
* </p>
* @param { number } y1 - Y coordinate of the first point on the Bezier curve.<br>Value range: (-∞, +∞).
* @param { number } x2 - X coordinate of the second point on the Bezier curve.<br>Value range: [0, 1].
* <p>**NOTE**:
* <br>A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**.
* </p>
* @param { number } y2 - Y coordinate of the second point on the Bezier curve.<br>Value range: (-∞, +∞).
* @returns { ICurve } Interpolation curve.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export 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.
* You are advised to use cubicBezierCurve instead.
*
* @param { number } x1 -Value range [0, 1].
* Note: If the value is less than 0, 0 is used. If the value is greater than 1, 1 is used.
* @param { number } y1 -Value range (-∞, +∞).
* @param { number } x2 -Value range [0, 1].
* Note: If the value is less than 0, 0 is used. If the value is greater than 1, 1 is used.
* @param { number } y2 -Value range (-∞, +∞).
* @returns { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
* @deprecated since 9
* @useinstead cubicBezierCurve
*/
function cubicBezier(x1: number, y1: number, x2: number, y2: number): string;
/**
* Constructs a spring curve when called. For more information about the meaning of the parameter, see spring().
*
* @param { number } velocity -Value range (-∞, +∞).
* @param { number } mass -Value range (0, +∞). Note: If the value is less than or equal to 0, 1 is used.
* @param { number } stiffness -Value range (0, +∞). Note: If the value is less than or equal to 0, 1 is used.
* @param { number } damping -Value range (0, +∞). Note: If the value is less than or equal to 0, 1 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Constructs a spring curve when called.
*
* @param { number } velocity -Value range (-∞, +∞).
* @param { number } mass -Value range (0, +∞). Note: If the value is less than or equal to 0, 1 is used.
* @param { number } stiffness -Value range (0, +∞). Note: If the value is less than or equal to 0, 1 is used.
* @param { number } damping -Value range (0, +∞). Note: If the value is less than or equal to 0, 1 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* 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, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the value 1 is used.
* </p>
* @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, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the value 1 is used.
* </p>
* @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, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the value 1 is used.
* </p>
* @returns { ICurve } Interpolation curve.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve;
/**
* Constructs a spring curve when called.
*
* @param { number } velocity -Initial velocity. An influence parameter of external factors on elastic dynamics,
* purpose is to ensure a smooth transition of the object from the previous state of motion to the elastic dynamics.
* @param { number } mass -Quality. The force object of the elastic system will have an inertial effect on elastic
* system. The greater the mass, the greater the amplitude of the oscillation.
* @param { number } stiffness -The degree to which an object is deformed by resisting the applied force.
* @param { number } damping -Pure number, Used to describe oscillation and decay of a system after being disturbed.
* @returns { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
* @deprecated since 9
* @useinstead springCurve
*/
function spring(velocity: number, mass: number, stiffness: number, damping: number): string;
/**
* Constructs a spring motion when called.
*
* @param { number } [response] The default value is 0.55. Unit: seconds. Value range: (0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.55 is used.
* @param { number } [dampingFraction] The default value is 0.825. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.825 is used.
* @param { number } [overlapDuration] The default value is 0. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Constructs a spring motion when called.
*
* @param { number } [response] The default value is 0.55. Unit: seconds. Value range: (0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.55 is used.
* @param { number } [dampingFraction] The default value is 0.825. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.825 is used.
* @param { number } [overlapDuration] The default value is 0. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* 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.
* <br>Default value: **0.55**.<br>Unit: second<br>Value range: (0, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the default value **0.55** is used.
* </p>
* @param { number } [dampingFraction] Damping coefficient.
* **0**: undamped. In this case, the spring oscillates forever.<br>> 0 and < 1: underdamped.
* In this case, the spring overshoots the equilibrium position.<br>**1**: critically damped.
* 1: overdamped. In this case, the spring approaches equilibrium gradually.<br>Default value: **0.825**.
* Unit: second.
* Value range: [0, +∞).
* <p>**NOTE**:
* <br>A value less than 0 evaluates to the default value **0.825**.
* </p>
* @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.<br>Default value: **0**<br>Unit: second<br>Value range: [0, +∞).
* <p>**NOTE**
* <br>A value less than 0 evaluates to the default value **0**.
* <br>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.
* </p>
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve;
/**
* Constructs a responsive spring motion when called.
*
* @param { number } [response] The default value is 0.15. Unit: seconds. Value range: (0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.15 is used.
* @param { number } [dampingFraction] The default value is 0.86. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.86 is used.
* @param { number } [overlapDuration] The default value is 0.25. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.25 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Constructs a responsive spring motion when called.
*
* @param { number } [response] The default value is 0.15. Unit: seconds. Value range: (0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.15 is used.
* @param { number } [dampingFraction] The default value is 0.86. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.86 is used.
* @param { number } [overlapDuration] The default value is 0.25. Unit: seconds. Value range: [0, +∞).
* Note: If a value is set to 0 or less, the default value of 0.25 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* 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**.<br>Default value: **0.15**.
* Unit: second<br>Value range: (0, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the default value **0.15** is used.
* </p>
* @param { number } [dampingFraction] See **dampingFraction** in **springMotion**.<br>Default value: **0.86**.
* Unit: second<br>Value range: [0, +∞).
* <p>**NOTE**
* <br>A value less than 0 evaluates to the default value **0.86**.
* </p>
* @param { number } [overlapDuration] See **overlapDuration** in **springMotion**.<br>Default value: **0.25**.
* Unit: second<br>Value range: [0, +∞).
* <p>**NOTE**:
* <br>A value less than 0 evaluates to the default value **0.25**.
* <br>To apply custom settings for a spring animation, you are advised to use **springMotion**.
* <br>When using **responsiveSpringMotion**, you are advised to retain the default settings.
* <br>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.
* <br>In addition, the interpolation cannot be obtained using the **interpolate** function of the curve.
* </p>
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve;
/**
* Constructs an interpolating spring curve when called, the animation duration can not be specified manually,
* and is determined by parameters of the curve. It produces values change from 0 to 1, and then uses interpolator
* to calculate the actual animation values.
*
* @param { number } velocity - the initial velocity of the spring, and is a normalized speed corresponding to the
* value changes from 0 to 1,specific value range (-∞, ∞).
* @param { number } mass - the mass of object in the mass-damper-spring system, value range (0, +∞).
* Note: If the value is less than or equal to 0, the value 1 is used.
* @param { number } stiffness - the stiffness of spring, value range (0, +∞).
* Note: If the value is less than or equal to 0, the value 1 is used.
* @param { number } damping - the damping value of spring, value range (0, +∞).
* Note: If the value is less than or equal to 0, the value 1 is used.
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* 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.<br>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.
* <br>Value range: (0, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the value **1** is used.
* </p>
* @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.<br>Value range: (0, +∞).
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the value **1** is used.
* </p>
* @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.<br>Value range: (0, +∞)<br>
* <p>**NOTE**:
* <br>If this parameter is set to a value less than or equal to 0, the value **1** is used.
* </p>
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve;
}
export default curves;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助