vue-amazing-ui
Version:
An Amazing Vue3 UI Components Library, Using TypeScript.
55 lines (54 loc) • 2.69 kB
TypeScript
import { Ref, ComputedRef, Reactive } from 'vue';
export declare function dateFormat(value?: number | string | Date, format?: string): string;
export declare function formatNumber(value: number | string, precision?: number, separator?: string, decimal?: string, prefix?: string, suffix?: string): string;
export declare function rafTimeout(fn: Function, delay?: number, interval?: boolean): {
id: number;
};
export declare function cancelRaf(raf: {
id: number;
}): void;
export declare function throttle(fn: Function, delay?: number): Function;
export declare function debounce(fn: Function, delay?: number): Function;
export declare function add(num1: number, num2: number): number;
export declare function downloadFile(url: string, fileName?: string): void;
export declare function toggleDark(): void;
export declare function useMounted(): Ref<boolean>;
export declare function useSupported(callback: () => unknown): ComputedRef<boolean>;
export declare function useEventListener(target: HTMLElement | Window | Document, event: string, callback: Function): void;
export declare function useMutationObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: MutationCallback, options?: object): {
start: () => void;
stop: () => void;
};
export declare function useScroll(target?: Ref | HTMLElement | Window | Document, throttleDelay?: number, onScroll?: (e: Event) => void, onStop?: (e: Event) => void): {
x: Ref<number>;
xScrollMax: Ref<number>;
y: Ref<number>;
yScrollMax: Ref<number>;
isScrolling: Ref<boolean>;
left: Ref<boolean>;
right: Ref<boolean>;
top: Ref<boolean>;
bottom: Ref<boolean>;
};
export declare function useFps(): {
fps: Ref<number>;
};
export declare function useMediaQuery(mediaQuery: string): {
match: Ref<boolean>;
};
export declare function useResizeObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: ResizeObserverCallback, options?: object): {
start: () => void;
stop: () => void;
};
type SlotsExistResult<T extends string | string[]> = T extends string ? ComputedRef<boolean> : Reactive<Record<string, ComputedRef<boolean>>>;
export declare function useSlotsExist<T extends string | string[] = 'default'>(slotsName: T): SlotsExistResult<T>;
export declare function useInject(key: string): {
colorPalettes: Ref<string[]>;
shadowColor: Ref<string>;
};
export declare function getColorPalettes(primaryColor: string): string[];
export declare function getAlphaColor(frontColor: string, backgroundColor?: string): string;
export declare function useOptionsSupported(prop: 'capture' | 'once' | 'passive' | 'signal'): {
isSupported: Ref<boolean>;
};
export {};