From 4160e507c6768e30b4db3cd6000ecfe8668475f6 Mon Sep 17 00:00:00 2001 From: Daniel Kurowski <daniel.kurowski@grifart.cz> Date: Thu, 10 Sep 2020 13:47:34 +0200 Subject: [PATCH] Renamed setupVelocity to bindEasingToVelocity --- src/easing/bindEasingToVelocity.d.ts | 5 +++++ src/easing/{setupVelocity.js => bindEasingToVelocity.js} | 4 ++-- src/easing/setupVelocity.d.ts | 5 ----- src/index.ts | 2 +- src/scrollers/scrollToElement.ts | 2 +- src/scrollers/scrollToOffset.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 src/easing/bindEasingToVelocity.d.ts rename src/easing/{setupVelocity.js => bindEasingToVelocity.js} (97%) delete mode 100644 src/easing/setupVelocity.d.ts diff --git a/src/easing/bindEasingToVelocity.d.ts b/src/easing/bindEasingToVelocity.d.ts new file mode 100644 index 0000000..eaf8629 --- /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 4d0264e..60337df 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 7f66e6b..0000000 --- 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 f276e7d..8c433d1 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 f7f410d..0d7f21c 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 e90bab5..ade7c3a 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, -- GitLab