1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import {CommonMethod, AnimationStatus, Curve, FillMode, PlayMode} from "./common"; 17 18export declare class SpringProp { 19 constructor(mass: number, stiffness: number, damping: number); 20} 21 22export declare class SpringMotion { 23 constructor(start: number, end: number, velocity: number, prop: SpringProp); 24} 25 26export declare class FrictionMotion { 27 constructor(friction: number, position: number, velocity: number); 28} 29 30export declare class ScrollMotion { 31 constructor(position: number, velocity: number, min: number, max: number, prop: SpringProp); 32} 33 34export declare class AnimatorExtend<T> extends AnimatorAttribute<T> { 35} 36 37interface Animator extends AnimatorAttribute<Animator> { 38 (value: string): Animator; 39} 40 41declare class AnimatorAttribute<T> extends CommonMethod<T> { 42 state(value: AnimationStatus): T; 43 44 duration(value: number): T; 45 46 curve(value: Curve): T; 47 48 delay(value: number): T; 49 50 fillMode(value: FillMode): T; 51 52 iterations(value: number): T; 53 54 playMode(value: PlayMode): T; 55 56 motion(value: SpringMotion | FrictionMotion | ScrollMotion): T; 57 58 onStart(event: () => void): T; 59 60 onPause(event: () => void): T; 61 62 onRepeat(event: () => void): T; 63 64 onCancel(event: () => void): T; 65 66 onFinish(event: () => void): T; 67 68 onFrame(event: (value: number) => void): T; 69} 70 71export declare const AnimatorInterface: Animator;