@vchatcloud/vue-ui-kit
Version:
VChatCloud UI Kit for vue integration
67 lines (66 loc) • 2.42 kB
TypeScript
export interface IFileUtilProps {
roomId: string;
uploadTag: string | HTMLElement;
updateEvent: any;
uploadDragTag: string | HTMLElement;
progressTag: string | HTMLElement;
progressSize: 60;
progressEvent: (...args: any) => any;
isPrivate?: boolean;
privateRoomId?: string;
}
/**
* 필수
* updateEvent : 업데이트 이벤트
* uploadTag : 업로드 클릭 태그
*
* 옵션
* uploadDragTag : 업로드 드래그 & 드롭 태그
* progressTag : 프로그래스 태그
*/
declare class FileUtil {
progressFlag: boolean;
extenstions: {
image: string[];
video: string[];
audio: string[];
checkType: (ext: string) => "image" | "video" | "audio" | "file";
};
addCustomStyle: (html: string) => void;
upload_url: string;
download_url: string;
isPrivate?: boolean;
roomId: string;
privateRoomId: string | (() => string);
progressSize: number;
bar: HTMLElement;
value: HTMLElement;
circumference: number;
initChech: (data: IFileUtilProps) => void;
update: (_flag: boolean, _data: any, _res?: any) => void;
progressEvent: () => void;
init: (targetTag: any) => void;
dragInit: (targetTag: any) => void;
progressInit: (targetTag: any) => void;
uploadFile: (file: string | Blob | File) => void;
progressBar: (per: number) => void;
fileInTag: (name: any, type: string, date: any, size: number, fileKey: string) => JQuery<HTMLElement>;
loadCheck: (obj: {
ext: string;
key: string;
data: any;
imgLoad: (fileKey: string) => any;
vodLoad: (fileKey: string) => any;
audioLoad: (fileKey: string) => any;
fileLoad: (fileKey: string) => any;
}) => void;
imgLoad: (key: string, onload: (image: HTMLImageElement, button: HTMLDivElement) => any, error: (error: string | Event) => any) => void;
vodLoad: (key: string, onload: (video: HTMLVideoElement, button: HTMLDivElement) => any) => void;
aodLoad: (key: string, onload: (audio: HTMLAudioElement, button: HTMLDivElement) => any) => void;
setPrivateRoomId: (roomId: string) => void;
constructor(arg: IFileUtilProps);
fileExeCheck(type: string): string;
getFileType(filename: string): "image" | "video" | "audio" | "file";
forCheck(ext: string, extList: string | string[]): boolean;
}
export default FileUtil;