From c19e5514ad55d7270c6faf85ace2c7debf594587 Mon Sep 17 00:00:00 2001 From: lanyill Date: Wed, 1 Jun 2022 16:31:42 +0800 Subject: [PATCH] =?UTF-8?q?ArkUI=E3=80=91=E3=80=90API9=E3=80=91Interpolate?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=B8=8D=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lanyill Change-Id: Idc43ff599102efb3b9f36aa95acbc673420dc4a6 --- api/@ohos.curves.d.ts | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts index e3a377d6ce..57d03e20a4 100644 --- a/api/@ohos.curves.d.ts +++ b/api/@ohos.curves.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* Copyright (c) 2021-2022 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 @@ -17,12 +17,12 @@ * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. * @import import Curves from '@ohos.curves' * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 + * @since 9 */ declare namespace curves { /** * enum Curve. - * @since 7 + * @since 9 */ enum Curve { Linear, @@ -40,29 +40,41 @@ declare namespace curves { Friction, } + /** + * Interface for curve object. + * @since 9 + */ + interface ICurve { + /** + * Get curve value by fraction. + * @since 9 + */ + interpolate(fraction : number) : number; + } /** * Initializes the interpolator curve when called. - * @since 7 + * @since 9 */ - function init(curve?: Curve): string; + function init(curve?: Curve): ICurve; /** * Constructs a step curve when called. - * @since 7 + * @since 9 */ - function steps(count: number, end: boolean): string; + function steps(count: number, end: boolean): ICurve; /** * Constructs a third-order Bezier curve when called. * @since 7 + * @deprecated since 9 */ - function cubicBezier(x1: number, y1: number, x2: number, y2: number): string; + function cubicBezier(x1: number, y1: number, x2: number, y2: number): ICurve; /** * Constructs a spring curve when called. - * @since 7 + * @since 9 */ - function spring(velocity: number, mass: number, stiffness: number, damping: number): string; + function spring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; } export default curves; -- Gitee