@oiij/use
Version:
Som Composable Functions for Vue 3
27 lines (26 loc) • 962 B
text/typescript
import * as vue59 from "vue";
import { Ref } from "vue";
import * as _vueuse_core20 from "@vueuse/core";
//#region src/composables/use-number-animation.d.ts
type EasingFunction = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | ((t: number) => number);
type 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<vue59.ShallowRef<boolean>>;
start: () => void;
stop: () => void;
pause: _vueuse_core20.Fn;
resume: _vueuse_core20.Fn;
onStart: _vueuse_core20.EventHookOn<[]>;
onEnd: _vueuse_core20.EventHookOn<[]>;
onProgress: _vueuse_core20.EventHookOn<[number]>;
};
type UseNumberAnimationReturns = ReturnType<typeof useNumberAnimation>;
//#endregion
export { UseNumberAnimationReturns, useNumberAnimation };