ivue-material-plus
Version:
A high quality UI components Library with Vue.js
59 lines (58 loc) • 2.72 kB
TypeScript
import { CSSProperties } from 'vue';
export declare type UploaderResultType = 'dataUrl' | 'text' | 'file' | 'url';
export declare type Interceptor = (...args: any[]) => Promise<boolean> | boolean;
export declare type UploaderMaxSize = number | string | ((file: File) => boolean);
export declare type UploaderFileListItem = {
url?: string;
file?: File;
content?: string;
status?: '' | 'uploading' | 'done' | 'failed';
message?: string;
beforeDelete?: Interceptor;
};
export declare function readFileContent(file: File, resultType: UploaderResultType): Promise<string | void>;
export declare function isOversize(items: UploaderFileListItem | UploaderFileListItem[], maxSize: UploaderMaxSize): boolean;
export declare function toArray<T>(item: T | T[]): T[];
export declare function isFunction(val: unknown): val is Function;
export declare function filterFiles(items: UploaderFileListItem[], maxSize: UploaderMaxSize): {
valid: UploaderFileListItem[];
invalid: UploaderFileListItem[];
};
export declare const getRandomStr: (len?: number) => string;
export declare function isImageUrl(url: string): boolean;
export declare function isImageFile(item: any): boolean;
export declare function addUnit(value?: string | number): string | undefined;
export declare function getSizeStyle(originSize?: string | number): CSSProperties | undefined;
export declare const EVENT_CODE: {
tab: string;
enter: string;
space: string;
left: string;
up: string;
right: string;
down: string;
esc: string;
delete: string;
backspace: string;
};
export declare function createRange(length: any): number[];
export declare function isCssColor(color: any): boolean;
export declare function setTextColor(color: string | string[]): {
color?: string;
};
export declare function isValueNumber(value: any): boolean;
export declare function getScrollBarSize(fresh?: any): any;
export declare const useZIndex: () => {
currentZIndex: import("vue").ComputedRef<number>;
nextZIndex: () => number;
};
export declare const isClient: boolean;
export declare const isObject: (obj: unknown) => boolean;
export declare const isElement: (el: HTMLElement) => boolean;
export declare function downloadFile(url: any, name?: string): Promise<void>;
export declare function raf(fn: FrameRequestCallback): number;
export declare function cancelRaf(id: number): void;
export declare function doubleRaf(fn: FrameRequestCallback): void;
export declare const isUndefined: (val: any) => val is undefined;
export declare function findComponentsUpward(context: any, componentName: any): any;
export declare function findComponentUpward(context: any, componentName: any, componentNames?: any): any;