1 | import type { ComponentPublicInstance } from 'vue';
|
2 | import type { ImageFit } from '../image';
|
3 | import type { Numeric, Interceptor } from '../utils';
|
4 | import type { UploaderProps } from './Uploader';
|
5 | export type UploaderResultType = 'dataUrl' | 'text' | 'file';
|
6 | export type UploaderFileListItem = {
|
7 | url?: string;
|
8 | file?: File;
|
9 | objectUrl?: string;
|
10 | content?: string;
|
11 | isImage?: boolean;
|
12 | status?: '' | 'uploading' | 'done' | 'failed';
|
13 | message?: string;
|
14 | imageFit?: ImageFit;
|
15 | deletable?: boolean;
|
16 | reupload?: boolean;
|
17 | previewSize?: Numeric;
|
18 | beforeDelete?: Interceptor;
|
19 | };
|
20 | export type UploaderMaxSize = Numeric | ((file: File) => boolean);
|
21 | export type UploaderBeforeRead = (file: File | File[], detail: {
|
22 | name: Numeric;
|
23 | index: number;
|
24 | }) => boolean | undefined | Promise<File | File[] | undefined>;
|
25 | export type UploaderAfterRead = (items: UploaderFileListItem | UploaderFileListItem[], detail: {
|
26 | name: Numeric;
|
27 | index: number;
|
28 | }) => void;
|
29 | export type UploaderExpose = {
|
30 | chooseFile: () => void;
|
31 | closeImagePreview: () => void;
|
32 | reuploadFile: (index: number) => void;
|
33 | };
|
34 | export type UploaderInstance = ComponentPublicInstance<UploaderProps, UploaderExpose>;
|
35 | export type UploaderThemeVars = {
|
36 | uploaderSize?: string;
|
37 | uploaderIconSize?: string;
|
38 | uploaderIconColor?: string;
|
39 | uploaderTextColor?: string;
|
40 | uploaderTextFontSize?: string;
|
41 | uploaderUploadBackground?: string;
|
42 | uploaderUploadActiveColor?: string;
|
43 | uploaderDeleteColor?: string;
|
44 | uploaderDeleteIconSize?: string;
|
45 | uploaderDeleteBackground?: string;
|
46 | uploaderFileBackground?: string;
|
47 | uploaderFileIconSize?: string;
|
48 | uploaderFileIconColor?: string;
|
49 | uploaderFileNamePadding?: string;
|
50 | uploaderFileNameMarginTop?: string;
|
51 | uploaderFileNameFontSize?: string;
|
52 | uploaderFileNameTextColor?: string;
|
53 | uploaderMaskTextColor?: string;
|
54 | uploaderMaskBackground?: string;
|
55 | uploaderMaskIconSize?: string;
|
56 | uploaderMaskMessageFontSize?: string;
|
57 | uploaderMaskMessageLineHeight?: number | string;
|
58 | uploaderLoadingIconSize?: string;
|
59 | uploaderLoadingIconColor?: string;
|
60 | uploaderDisabledOpacity?: number | string;
|
61 | };
|