diff --git a/src/easing/bindEasingToVelocity.d.ts b/src/easing/bindEasingToVelocity.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eaf8629848b6f9847c1d7e0c74e9569fb2dab59e --- /dev/null +++ b/src/easing/bindEasingToVelocity.d.ts @@ -0,0 +1,5 @@ +import * as Velocity from 'velocity-animate'; + +declare const bindEasingToVelocity: (velocity: typeof Velocity) => void; +export declare const EASE_IN_SKIP_OUT_EASING: string; +export default bindEasingToVelocity; diff --git a/src/easing/setupVelocity.js b/src/easing/bindEasingToVelocity.js similarity index 97% rename from src/easing/setupVelocity.js rename to src/easing/bindEasingToVelocity.js index 4d0264e822519e4276ba9bb5b15d0a4675ae53f5..60337df72f834881f0ee38b8a9bc27114160e519 100644 --- a/src/easing/setupVelocity.js +++ b/src/easing/bindEasingToVelocity.js @@ -68,7 +68,7 @@ const computeHowMuchToSkip = (tweenDelta) => { return howMuchToSkip; }; -const setupVelocity = (velocity) => { +const bindEasingToVelocity = (velocity) => { velocity.Easings[EASE_IN_SKIP_OUT_EASING] = composeEasing( (time, opts, tweenDelta) => mapIntervalLinear( velocity.Easings['ease-in'](time, opts, tweenDelta), @@ -83,4 +83,4 @@ const setupVelocity = (velocity) => { ); }; -export default setupVelocity; +export default bindEasingToVelocity; diff --git a/src/easing/setupVelocity.d.ts b/src/easing/setupVelocity.d.ts deleted file mode 100644 index 7f66e6b6c14b071a30704e3ad54a74f1bcf2bf1a..0000000000000000000000000000000000000000 --- a/src/easing/setupVelocity.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as Velocity from 'velocity-animate'; - -declare const setupVelocity: (velocity: typeof Velocity) => void; -export declare const EASE_IN_SKIP_OUT_EASING: string; -export default setupVelocity; diff --git a/src/index.ts b/src/index.ts index f276e7d7ce5c4daf0e31b1b1ef72afcdbb4fa62f..8c433d1110d1f9e1de17647d309c5e4e2737ac83 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import * as Velocity from 'velocity-animate'; -import setupVelocity from './easing/setupVelocity'; +import bindEasingToVelocity from './easing/bindEasingToVelocity'; import {initializeOnLoadScroll} from './handlers/loadScroll/initializeOnLoadScroll'; import {initializeOnLinkClickScroll} from './handlers/linkClickScroll/initializeOnLinkClickScroll'; import {scrollToElement} from './scrollers/scrollToElement'; diff --git a/src/scrollers/scrollToElement.ts b/src/scrollers/scrollToElement.ts index f7f410d1c9bd0d567a537042a5eb1049d85dd0d5..0d7f21c0704090aeab117db472f1ecf29899582d 100644 --- a/src/scrollers/scrollToElement.ts +++ b/src/scrollers/scrollToElement.ts @@ -1,5 +1,5 @@ import * as Velocity from 'velocity-animate'; -import {EASE_IN_SKIP_OUT_EASING} from '../easing/setupVelocity'; +import {EASE_IN_SKIP_OUT_EASING} from '../easing/bindEasingToVelocity'; export function scrollToElement(element: HTMLElement, onScrollFinishedCallback?: () => void): void { diff --git a/src/scrollers/scrollToOffset.ts b/src/scrollers/scrollToOffset.ts index e90bab598c8eec0e56cdaa59f62a3feaa5c6159a..ade7c3afb8b452b07e19e35c922707d2134dec19 100644 --- a/src/scrollers/scrollToOffset.ts +++ b/src/scrollers/scrollToOffset.ts @@ -1,5 +1,5 @@ import * as Velocity from 'velocity-animate'; -import {EASE_IN_SKIP_OUT_EASING} from '../easing/setupVelocity'; +import {EASE_IN_SKIP_OUT_EASING} from '../easing/bindEasingToVelocity'; export function scrollToOffset( topOffset: number,