@oiij/use
Version:
Som Composable Functions for Vue 3
27 lines (26 loc) • 964 B
TypeScript
import * as _vueuse_core13 from "@vueuse/core";
import * as vue37 from "vue";
import { Ref } from "vue";
//#region src/composables/use-number-animation.d.ts
type EasingFunction = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | ((t: number) => number);
interface NumberAnimationOptions {
from?: number;
manual?: boolean;
duration?: number;
precision?: number;
easing?: EasingFunction;
}
declare function useNumberAnimation(to: Ref<number> | number, options?: NumberAnimationOptions): {
value: Readonly<Ref<string, string>>;
isActive: Readonly<vue37.ShallowRef<boolean>>;
start: () => void;
stop: () => void;
pause: _vueuse_core13.Fn;
resume: _vueuse_core13.Fn;
onStart: _vueuse_core13.EventHookOn<[]>;
onEnd: _vueuse_core13.EventHookOn<[]>;
onProgress: _vueuse_core13.EventHookOn<[number]>;
};
type UseNumberAnimationReturns = ReturnType<typeof useNumberAnimation>;
//#endregion
export { UseNumberAnimationReturns, useNumberAnimation };