Installation
npm install --save @types/bounce.js
Summary
This package contains type definitions for bounce.js (https://github.com/tictail/bounce.js).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bounce.js.
index.d.ts
/// <reference types="jquery"/>
export default Bounce;
interface Point2D {
x: number;
y: number;
}
interface BounceOptions<T> {
from: T;
to: T;
duration?: number | undefined;
delay?: number | undefined;
easing?: string | undefined;
bounces?: number | undefined;
stiffness?: number | undefined;
}
interface AnimationOptions {
loop?: boolean | undefined;
remove?: boolean | undefined;
onComplete?: (() => void) | undefined;
}
interface SerailizedComponent<T> {
type: string;
from: T;
to: T;
duration: number;
delay: number;
easing: string;
bounces: number;
stiffness: number;
}
declare class Bounce {
static FPS: number;
static counter: number;
static isSupported(): boolean;
constructor();
scale(options: BounceOptions<Point2D>): Bounce;
rotate(options: BounceOptions<number>): Bounce;
translate(options: BounceOptions<Point2D>): Bounce;
skew(options: BounceOptions<Point2D>): Bounce;
serialize(): Array<SerailizedComponent<number | Point2D>>;
deserialize(serailized: Array<SerailizedComponent<number | Point2D>>): Bounce;
applyTo(element: Element, options?: AnimationOptions): void;
applyTo(elements: Element[], options?: AnimationOptions): void;
applyTo(elements: JQuery, options?: AnimationOptions): JQueryPromise<void>;
define(name: string): Bounce;
remove(): void;
}
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:23 GMT
- Dependencies: @types/jquery
Credits
These definitions were written by Cherry.