mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
[jump.js] Add option for passing duration as a function (#40082)
* Add option for passing duration as a function, it has been supported in jump.js just missing from typings https://github.com/callmecavs/jump.js/blob/master/src/jump.js#L133 * jump.js remove myself from the defitions by (also kick off another build)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
2f8b27fdb0
commit
23332fa2c8
Vendored
+1
-1
@@ -10,7 +10,7 @@ declare function jump(target: string | Element | number, opts?: jump.Options): v
|
||||
declare namespace jump {
|
||||
type TransitionFunc = (t: number, b: number, c: number, d: number) => number;
|
||||
interface Options {
|
||||
duration?: number;
|
||||
duration?: number | ((distance: number) => number);
|
||||
offset?: number;
|
||||
callback?(): void;
|
||||
easing?: TransitionFunc;
|
||||
|
||||
@@ -6,6 +6,9 @@ jump('.target');
|
||||
jump('.target', {
|
||||
duration: 1000,
|
||||
});
|
||||
jump('.target', {
|
||||
duration: distance => Math.abs(distance)
|
||||
});
|
||||
jump('.target', {
|
||||
duration: 200,
|
||||
offset: 10
|
||||
|
||||
Reference in New Issue
Block a user