tav-ui
Version:
18 lines (17 loc) • 562 B
TypeScript
import type { Ref } from 'vue';
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
$el: T;
}
declare type Nullable<T> = T | null;
interface Fn<T = any, R = T> {
(...arg: T[]): R;
}
export declare const useScrollToCenter: (scrollRef: Ref<ElRef | ComponentElRef>, opt?: {
duration?: number;
callback?: Fn;
direction?: 'scrollTop' | 'scrollLeft';
}) => {
scrollToCenter: <T extends HTMLElement = HTMLButtonElement>(buttonEl: T) => void;
};
export {};