@tplc/wot 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/components/wd-swiper/index.scss +4 -3
  2. package/components/wd-swiper/types.ts +9 -0
  3. package/components/wd-swiper/wd-swiper.vue +16 -2
  4. package/components/wd-tabs/wd-tabs.vue +3 -1
  5. package/components/wd-tooltip/wd-tooltip.vue +1 -1
  6. package/package.json +3 -6
  7. package/types/components/common/AbortablePromise.d.ts +16 -6
  8. package/types/components/common/base64.d.ts +1 -1
  9. package/types/components/common/canvasHelper.d.ts +1 -1
  10. package/types/components/common/clickoutside.d.ts +4 -4
  11. package/types/components/common/dayjs.d.ts +24 -24
  12. package/types/components/common/props.d.ts +39 -39
  13. package/types/components/common/util.d.ts +74 -54
  14. package/types/components/composables/useCell.d.ts +2 -2
  15. package/types/components/composables/useChildren.d.ts +28 -9
  16. package/types/components/composables/useCountDown.d.ts +17 -17
  17. package/types/components/composables/useLockScroll.d.ts +4 -4
  18. package/types/components/composables/useParent.d.ts +20 -14
  19. package/types/components/composables/usePopover.d.ts +39 -8
  20. package/types/components/composables/useQueue.d.ts +10 -10
  21. package/types/components/composables/useRaf.d.ts +5 -5
  22. package/types/components/composables/useTouch.d.ts +10 -10
  23. package/types/components/composables/useTranslate.d.ts +2 -2
  24. package/types/components/wd-action-sheet/types.d.ts +142 -142
  25. package/types/components/wd-action-sheet/wd-action-sheet.vue.d.ts +162 -143
  26. package/types/components/wd-backtop/types.d.ts +65 -65
  27. package/types/components/wd-backtop/wd-backtop.vue.d.ts +119 -100
  28. package/types/components/wd-badge/types.d.ts +52 -52
  29. package/types/components/wd-badge/wd-badge.vue.d.ts +89 -70
  30. package/types/components/wd-button/types.d.ts +132 -124
  31. package/types/components/wd-button/wd-button.vue.d.ts +175 -156
  32. package/types/components/wd-calendar/types.d.ts +283 -279
  33. package/types/components/wd-calendar/wd-calendar.vue.d.ts +342 -323
  34. package/types/components/wd-calendar-view/month/month.vue.d.ts +87 -71
  35. package/types/components/wd-calendar-view/month/types.d.ts +37 -37
  36. package/types/components/wd-calendar-view/monthPanel/month-panel.vue.d.ts +118 -102
  37. package/types/components/wd-calendar-view/monthPanel/types.d.ts +63 -63
  38. package/types/components/wd-calendar-view/types.d.ts +135 -126
  39. package/types/components/wd-calendar-view/utils.d.ts +42 -28
  40. package/types/components/wd-calendar-view/wd-calendar-view.vue.d.ts +144 -128
  41. package/types/components/wd-calendar-view/year/types.d.ts +33 -33
  42. package/types/components/wd-calendar-view/year/year.vue.d.ts +80 -64
  43. package/types/components/wd-calendar-view/yearPanel/types.d.ts +46 -46
  44. package/types/components/wd-calendar-view/yearPanel/year-panel.vue.d.ts +89 -73
  45. package/types/components/wd-card/types.d.ts +41 -41
  46. package/types/components/wd-card/wd-card.vue.d.ts +81 -62
  47. package/types/components/wd-cell/types.d.ts +128 -128
  48. package/types/components/wd-cell/wd-cell.vue.d.ts +181 -162
  49. package/types/components/wd-cell-group/types.d.ts +38 -38
  50. package/types/components/wd-cell-group/wd-cell-group.vue.d.ts +72 -53
  51. package/types/components/wd-checkbox/types.d.ts +73 -73
  52. package/types/components/wd-checkbox/wd-checkbox.vue.d.ts +124 -105
  53. package/types/components/wd-checkbox-group/types.d.ts +75 -75
  54. package/types/components/wd-checkbox-group/wd-checkbox-group.vue.d.ts +121 -102
  55. package/types/components/wd-circle/types.d.ts +76 -76
  56. package/types/components/wd-circle/wd-circle.vue.d.ts +124 -105
  57. package/types/components/wd-col/types.d.ts +25 -25
  58. package/types/components/wd-col/wd-col.vue.d.ts +66 -47
  59. package/types/components/wd-col-picker/types.d.ts +227 -223
  60. package/types/components/wd-col-picker/wd-col-picker.vue.d.ts +287 -268
  61. package/types/components/wd-collapse/types.d.ts +74 -67
  62. package/types/components/wd-collapse/wd-collapse.vue.d.ts +110 -91
  63. package/types/components/wd-collapse-item/types.d.ts +44 -44
  64. package/types/components/wd-collapse-item/wd-collapse-item.vue.d.ts +79 -64
  65. package/types/components/wd-config-provider/types.d.ts +872 -811
  66. package/types/components/wd-config-provider/wd-config-provider.vue.d.ts +66 -47
  67. package/types/components/wd-count-down/types.d.ts +53 -53
  68. package/types/components/wd-count-down/utils.d.ts +7 -7
  69. package/types/components/wd-count-down/wd-count-down.vue.d.ts +93 -76
  70. package/types/components/wd-count-to/types.d.ts +123 -123
  71. package/types/components/wd-count-to/wd-count-to.vue.d.ts +172 -153
  72. package/types/components/wd-curtain/types.d.ts +59 -52
  73. package/types/components/wd-curtain/wd-curtain.vue.d.ts +101 -85
  74. package/types/components/wd-datetime-picker/types.d.ts +306 -295
  75. package/types/components/wd-datetime-picker/wd-datetime-picker.vue.d.ts +384 -353
  76. package/types/components/wd-datetime-picker-view/types.d.ts +147 -139
  77. package/types/components/wd-datetime-picker-view/wd-datetime-picker-view.vue.d.ts +182 -166
  78. package/types/components/wd-divider/types.d.ts +18 -18
  79. package/types/components/wd-divider/wd-divider.vue.d.ts +57 -38
  80. package/types/components/wd-drop-menu/types.d.ts +52 -52
  81. package/types/components/wd-drop-menu/wd-drop-menu.vue.d.ts +93 -74
  82. package/types/components/wd-drop-menu-item/types.d.ts +103 -103
  83. package/types/components/wd-drop-menu-item/wd-drop-menu-item.vue.d.ts +163 -144
  84. package/types/components/wd-fab/types.d.ts +86 -86
  85. package/types/components/wd-fab/wd-fab.vue.d.ts +145 -126
  86. package/types/components/wd-form/types.d.ts +80 -72
  87. package/types/components/wd-form/wd-form.vue.d.ts +90 -71
  88. package/types/components/wd-form-item/types.d.ts +31 -31
  89. package/types/components/wd-form-item/wd-form-item.vue.d.ts +91 -72
  90. package/types/components/wd-gap/types.d.ts +30 -30
  91. package/types/components/wd-gap/wd-gap.vue.d.ts +61 -45
  92. package/types/components/wd-grid/types.d.ts +57 -57
  93. package/types/components/wd-grid/wd-grid.vue.d.ts +88 -69
  94. package/types/components/wd-grid-item/types.d.ts +100 -100
  95. package/types/components/wd-grid-item/wd-grid-item.vue.d.ts +152 -133
  96. package/types/components/wd-icon/types.d.ts +31 -31
  97. package/types/components/wd-icon/wd-icon.vue.d.ts +62 -46
  98. package/types/components/wd-img/types.d.ts +72 -58
  99. package/types/components/wd-img/wd-img.vue.d.ts +110 -91
  100. package/types/components/wd-img-cropper/types.d.ts +99 -99
  101. package/types/components/wd-img-cropper/wd-img-cropper.vue.d.ts +129 -113
  102. package/types/components/wd-index-anchor/type.d.ts +15 -15
  103. package/types/components/wd-index-anchor/wd-index-anchor.vue.d.ts +54 -35
  104. package/types/components/wd-index-bar/type.d.ts +22 -22
  105. package/types/components/wd-index-bar/wd-index-bar.vue.d.ts +39 -20
  106. package/types/components/wd-input/types.d.ts +270 -270
  107. package/types/components/wd-input/wd-input.vue.d.ts +387 -368
  108. package/types/components/wd-input-number/types.d.ts +107 -107
  109. package/types/components/wd-input-number/wd-input-number.vue.d.ts +158 -142
  110. package/types/components/wd-loading/types.d.ts +33 -33
  111. package/types/components/wd-loading/wd-loading.vue.d.ts +61 -45
  112. package/types/components/wd-loadmore/types.d.ts +30 -30
  113. package/types/components/wd-loadmore/wd-loadmore.vue.d.ts +56 -40
  114. package/types/components/wd-message-box/index.d.ts +4 -4
  115. package/types/components/wd-message-box/types.d.ts +92 -92
  116. package/types/components/wd-message-box/wd-message-box.vue.d.ts +50 -31
  117. package/types/components/wd-navbar/types.d.ts +79 -79
  118. package/types/components/wd-navbar/wd-navbar.vue.d.ts +135 -116
  119. package/types/components/wd-navbar-capsule/wd-navbar-capsule.vue.d.ts +22 -8
  120. package/types/components/wd-notice-bar/types.d.ts +80 -80
  121. package/types/components/wd-notice-bar/wd-notice-bar.vue.d.ts +136 -117
  122. package/types/components/wd-notify/index.d.ts +7 -7
  123. package/types/components/wd-notify/types.d.ts +84 -84
  124. package/types/components/wd-notify/wd-notify.vue.d.ts +123 -104
  125. package/types/components/wd-number-keyboard/key/index.vue.d.ts +65 -49
  126. package/types/components/wd-number-keyboard/key/types.d.ts +22 -22
  127. package/types/components/wd-number-keyboard/types.d.ts +115 -115
  128. package/types/components/wd-number-keyboard/wd-number-keyboard.vue.d.ts +176 -157
  129. package/types/components/wd-overlay/types.d.ts +38 -38
  130. package/types/components/wd-overlay/wd-overlay.vue.d.ts +88 -69
  131. package/types/components/wd-pagination/types.d.ts +66 -66
  132. package/types/components/wd-pagination/wd-pagination.vue.d.ts +102 -86
  133. package/types/components/wd-password-input/types.d.ts +58 -58
  134. package/types/components/wd-password-input/wd-password-input.vue.d.ts +97 -81
  135. package/types/components/wd-picker/types.d.ts +239 -232
  136. package/types/components/wd-picker/wd-picker.vue.d.ts +300 -275
  137. package/types/components/wd-picker-view/types.d.ts +102 -89
  138. package/types/components/wd-picker-view/wd-picker-view.vue.d.ts +137 -109
  139. package/types/components/wd-popover/types.d.ts +96 -84
  140. package/types/components/wd-popover/wd-popover.vue.d.ts +156 -137
  141. package/types/components/wd-popup/types.d.ts +95 -95
  142. package/types/components/wd-popup/wd-popup.vue.d.ts +178 -159
  143. package/types/components/wd-progress/types.d.ts +43 -43
  144. package/types/components/wd-progress/wd-progress.vue.d.ts +71 -55
  145. package/types/components/wd-radio/types.d.ts +39 -39
  146. package/types/components/wd-radio/wd-radio.vue.d.ts +91 -72
  147. package/types/components/wd-radio-group/types.d.ts +52 -52
  148. package/types/components/wd-radio-group/wd-radio-group.vue.d.ts +103 -84
  149. package/types/components/wd-rate/types.d.ts +109 -109
  150. package/types/components/wd-rate/wd-rate.vue.d.ts +131 -115
  151. package/types/components/wd-resize/types.d.ts +13 -13
  152. package/types/components/wd-resize/wd-resize.vue.d.ts +61 -42
  153. package/types/components/wd-row/types.d.ts +22 -22
  154. package/types/components/wd-row/wd-row.vue.d.ts +57 -38
  155. package/types/components/wd-search/types.d.ts +103 -103
  156. package/types/components/wd-search/wd-search.vue.d.ts +150 -131
  157. package/types/components/wd-segmented/types.d.ts +66 -66
  158. package/types/components/wd-segmented/wd-segmented.vue.d.ts +103 -86
  159. package/types/components/wd-select-picker/types.d.ts +184 -178
  160. package/types/components/wd-select-picker/wd-select-picker.vue.d.ts +334 -315
  161. package/types/components/wd-sidebar/types.d.ts +22 -22
  162. package/types/components/wd-sidebar/wd-sidebar.vue.d.ts +63 -44
  163. package/types/components/wd-sidebar-item/types.d.ts +43 -43
  164. package/types/components/wd-sidebar-item/wd-sidebar-item.vue.d.ts +98 -79
  165. package/types/components/wd-skeleton/types.d.ts +69 -69
  166. package/types/components/wd-skeleton/wd-skeleton.vue.d.ts +86 -67
  167. package/types/components/wd-slider/types.d.ts +115 -115
  168. package/types/components/wd-slider/wd-slider.vue.d.ts +137 -121
  169. package/types/components/wd-sort-button/types.d.ts +57 -57
  170. package/types/components/wd-sort-button/wd-sort-button.vue.d.ts +83 -67
  171. package/types/components/wd-status-tip/types.d.ts +58 -58
  172. package/types/components/wd-status-tip/wd-status-tip.vue.d.ts +69 -53
  173. package/types/components/wd-step/types.d.ts +32 -32
  174. package/types/components/wd-step/wd-step.vue.d.ts +58 -39
  175. package/types/components/wd-steps/types.d.ts +57 -57
  176. package/types/components/wd-steps/wd-steps.vue.d.ts +86 -67
  177. package/types/components/wd-sticky/types.d.ts +23 -23
  178. package/types/components/wd-sticky/wd-sticky.vue.d.ts +77 -58
  179. package/types/components/wd-sticky-box/types.d.ts +8 -8
  180. package/types/components/wd-sticky-box/wd-sticky-box.vue.d.ts +48 -29
  181. package/types/components/wd-swipe-action/types.d.ts +44 -41
  182. package/types/components/wd-swipe-action/wd-swipe-action.vue.d.ts +79 -60
  183. package/types/components/wd-swiper/types.d.ts +231 -201
  184. package/types/components/wd-swiper/wd-swiper.vue.d.ts +272 -211
  185. package/types/components/wd-swiper-nav/types.d.ts +62 -62
  186. package/types/components/wd-swiper-nav/wd-swiper-nav.vue.d.ts +97 -81
  187. package/types/components/wd-switch/types.d.ts +63 -63
  188. package/types/components/wd-switch/wd-switch.vue.d.ts +91 -75
  189. package/types/components/wd-tab/types.d.ts +26 -26
  190. package/types/components/wd-tab/wd-tab.vue.d.ts +64 -45
  191. package/types/components/wd-tabbar/types.d.ts +85 -85
  192. package/types/components/wd-tabbar/wd-tabbar.vue.d.ts +121 -102
  193. package/types/components/wd-tabbar-item/types.d.ts +47 -47
  194. package/types/components/wd-tabbar-item/wd-tabbar-item.vue.d.ts +77 -60
  195. package/types/components/wd-table/types.d.ts +103 -93
  196. package/types/components/wd-table/wd-table.vue.d.ts +181 -136
  197. package/types/components/wd-table-col/types.d.ts +55 -55
  198. package/types/components/wd-table-col/wd-table-col.vue.d.ts +85 -69
  199. package/types/components/wd-tabs/types.d.ts +94 -94
  200. package/types/components/wd-tabs/wd-tabs.vue.d.ts +157 -138
  201. package/types/components/wd-tag/types.d.ts +103 -103
  202. package/types/components/wd-tag/wd-tag.vue.d.ts +148 -129
  203. package/types/components/wd-text/types.d.ts +127 -127
  204. package/types/components/wd-text/wd-text.vue.d.ts +149 -130
  205. package/types/components/wd-textarea/types.d.ts +362 -362
  206. package/types/components/wd-textarea/wd-textarea.vue.d.ts +408 -389
  207. package/types/components/wd-toast/index.d.ts +9 -9
  208. package/types/components/wd-toast/types.d.ts +58 -58
  209. package/types/components/wd-toast/wd-toast.vue.d.ts +45 -29
  210. package/types/components/wd-tooltip/types.d.ts +116 -104
  211. package/types/components/wd-tooltip/wd-tooltip.vue.d.ts +151 -132
  212. package/types/components/wd-transition/types.d.ts +108 -97
  213. package/types/components/wd-transition/wd-transition.vue.d.ts +154 -135
  214. package/types/components/wd-upload/types.d.ts +388 -376
  215. package/types/components/wd-upload/utils.d.ts +11 -2
  216. package/types/components/wd-upload/wd-upload.vue.d.ts +310 -282
  217. package/types/components/wd-video-preview/types.d.ts +19 -19
  218. package/types/components/wd-video-preview/wd-video-preview.vue.d.ts +41 -25
  219. package/types/components/wd-watermark/types.d.ts +130 -130
  220. package/types/components/wd-watermark/wd-watermark.vue.d.ts +173 -157
  221. package/types/locale/lang/zh-CN.d.ts +127 -127
@@ -1,396 +1,408 @@
1
- import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
2
- import type { LoadingType } from '../wd-loading/types';
3
- import type { ImageMode } from '../wd-img/types';
1
+ import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
2
+ import type { LoadingType } from '../wd-loading/types'
3
+ import type { ImageMode } from '../wd-img/types'
4
4
  export interface ChooseFileOption {
5
- multiple: boolean;
6
- sizeType?: UploadSizeType[];
7
- sourceType: UploadSourceType[];
8
- maxCount: number;
9
- accept: UploadFileType;
10
- /**
11
- * 是否压缩视频,当 accept 为 video 时生效。
12
- */
13
- compressed: boolean;
14
- /**
15
- * 拍摄视频最长拍摄时间,当 accept 为 video | media 时生效,单位秒。
16
- */
17
- maxDuration: number;
18
- /**
19
- * 使用前置或者后置相机,当 accept 为 video | media 时生效,可选值为:back|front。
20
- */
21
- camera: UploadCameraType;
5
+ multiple: boolean
6
+ sizeType?: UploadSizeType[]
7
+ sourceType: UploadSourceType[]
8
+ maxCount: number
9
+ accept: UploadFileType
10
+ /**
11
+ * 是否压缩视频,当 accept 为 video 时生效。
12
+ */
13
+ compressed: boolean
14
+ /**
15
+ * 拍摄视频最长拍摄时间,当 accept 为 video | media 时生效,单位秒。
16
+ */
17
+ maxDuration: number
18
+ /**
19
+ * 使用前置或者后置相机,当 accept 为 video | media 时生效,可选值为:back|front。
20
+ */
21
+ camera: UploadCameraType
22
22
  }
23
23
  export type UploadFileItem = {
24
- [key: string]: any;
25
- uid: number;
26
- thumb?: string;
27
- name?: string;
28
- status?: UploadStatusType;
29
- size?: number;
30
- url: string;
31
- percent?: number;
32
- response?: string | Record<string, any>;
33
- };
24
+ [key: string]: any
25
+ uid: number
26
+ thumb?: string
27
+ name?: string
28
+ status?: UploadStatusType
29
+ size?: number
30
+ url: string
31
+ percent?: number
32
+ response?: string | Record<string, any>
33
+ }
34
34
  export interface ChooseFile {
35
- path: string;
36
- size?: number;
37
- name?: string;
38
- type: 'image' | 'video' | 'file';
39
- duration?: number;
40
- thumb?: string;
35
+ path: string
36
+ size?: number
37
+ name?: string
38
+ type: 'image' | 'video' | 'file'
39
+ duration?: number
40
+ thumb?: string
41
41
  }
42
- export type UploadSourceType = 'album' | 'camera';
43
- export type UploadSizeType = 'original' | 'compressed';
44
- export type UploadFileType = 'image' | 'video' | 'media' | 'all' | 'file';
45
- export type UploadCameraType = 'front' | 'back';
46
- export type UploadStatusType = 'pending' | 'loading' | 'success' | 'fail';
42
+ export type UploadSourceType = 'album' | 'camera'
43
+ export type UploadSizeType = 'original' | 'compressed'
44
+ export type UploadFileType = 'image' | 'video' | 'media' | 'all' | 'file'
45
+ export type UploadCameraType = 'front' | 'back'
46
+ export type UploadStatusType = 'pending' | 'loading' | 'success' | 'fail'
47
47
  export type UploadBeforePreviewOption = {
48
- index: number;
49
- imgList: string[];
50
- resolve: (isPass: boolean) => void;
51
- };
52
- export type UploadBeforePreview = (option: UploadBeforePreviewOption) => void;
48
+ index: number
49
+ imgList: string[]
50
+ resolve: (isPass: boolean) => void
51
+ }
52
+ export type UploadBeforePreview = (option: UploadBeforePreviewOption) => void
53
53
  export type UploadOnPreviewFailOption = {
54
- index: number;
55
- imgList: string[];
56
- };
57
- export type UploadOnPreviewFail = (option: UploadOnPreviewFailOption) => void;
54
+ index: number
55
+ imgList: string[]
56
+ }
57
+ export type UploadOnPreviewFail = (option: UploadOnPreviewFailOption) => void
58
58
  export type UploadBeforeRemoveOption = {
59
- file: UploadFileItem;
60
- index: number;
61
- fileList: UploadFileItem[];
62
- resolve: (isPass: boolean) => void;
63
- };
64
- export type UploadBeforeRemove = (option: UploadBeforeRemoveOption) => void;
59
+ file: UploadFileItem
60
+ index: number
61
+ fileList: UploadFileItem[]
62
+ resolve: (isPass: boolean) => void
63
+ }
64
+ export type UploadBeforeRemove = (option: UploadBeforeRemoveOption) => void
65
65
  export type UploadBeforeChooseOption = {
66
- fileList: UploadFileItem[];
67
- resolve: (isPass: boolean) => void;
68
- };
69
- export type UploadBeforeChoose = (option: UploadBeforeChooseOption) => void;
66
+ fileList: UploadFileItem[]
67
+ resolve: (isPass: boolean) => void
68
+ }
69
+ export type UploadBeforeChoose = (option: UploadBeforeChooseOption) => void
70
70
  export type UploadBeforeUploadOption = {
71
- files: Record<string, any>[];
72
- fileList: UploadFileItem[];
73
- resolve: (isPass: boolean) => void;
74
- };
75
- export type UploadBeforeUpload = (options: UploadBeforeUploadOption) => void;
76
- export type UploadFormData = Record<string, any>;
71
+ files: Record<string, any>[]
72
+ fileList: UploadFileItem[]
73
+ resolve: (isPass: boolean) => void
74
+ }
75
+ export type UploadBeforeUpload = (options: UploadBeforeUploadOption) => void
76
+ export type UploadFormData = Record<string, any>
77
77
  export type UploadBuildFormDataOption = {
78
- file: UploadFileItem;
79
- formData: UploadFormData;
80
- resolve: (formData: Record<string, any>) => void;
81
- };
82
- export type UploadBuildFormData = (options: UploadBuildFormDataOption) => void;
78
+ file: UploadFileItem
79
+ formData: UploadFormData
80
+ resolve: (formData: Record<string, any>) => void
81
+ }
82
+ export type UploadBuildFormData = (options: UploadBuildFormDataOption) => void
83
83
  export type UploadFile = Partial<UploadFileItem> & {
84
- url: string;
85
- };
86
- export type UploadMethod = (uploadFile: UploadFileItem, formData: UploadFormData, options: {
87
- action: string;
88
- header: Record<string, any>;
89
- name: string;
90
- fileName: string;
91
- fileType: 'image' | 'video' | 'audio';
92
- statusCode: number;
93
- onSuccess: (res: UniApp.UploadFileSuccessCallbackResult, file: UploadFileItem, formData: UploadFormData) => void;
94
- onError: (res: UniApp.GeneralCallbackResult, file: UploadFileItem, formData: UploadFormData) => void;
95
- onProgress: (res: UniApp.OnProgressUpdateResult, file: UploadFileItem) => void;
96
- }) => void;
84
+ url: string
85
+ }
86
+ export type UploadMethod = (
87
+ uploadFile: UploadFileItem,
88
+ formData: UploadFormData,
89
+ options: {
90
+ action: string
91
+ header: Record<string, any>
92
+ name: string
93
+ fileName: string
94
+ fileType: 'image' | 'video' | 'audio'
95
+ statusCode: number
96
+ onSuccess: (
97
+ res: UniApp.UploadFileSuccessCallbackResult,
98
+ file: UploadFileItem,
99
+ formData: UploadFormData,
100
+ ) => void
101
+ onError: (
102
+ res: UniApp.GeneralCallbackResult,
103
+ file: UploadFileItem,
104
+ formData: UploadFormData,
105
+ ) => void
106
+ onProgress: (res: UniApp.OnProgressUpdateResult, file: UploadFileItem) => void
107
+ },
108
+ ) => void
97
109
  export declare const uploadProps: {
98
- /**
99
- * 上传的文件列表,例如:[{name:'food.jpg',url:'https://xxx.cdn.com/xxx.jpg'}]
100
- * 类型:array
101
- * 默认值:[]
102
- */
103
- fileList: {
104
- type: PropType<UploadFile[]>;
105
- default: () => never[];
106
- };
107
- /**
108
- * 必选参数,上传的地址
109
- * 类型:string
110
- * 默认值:''
111
- */
112
- action: {
113
- type: PropType<string>;
114
- default: string;
115
- };
116
- /**
117
- * 设置上传的请求头部
118
- * 类型:object
119
- * 默认值:{}
120
- */
121
- header: {
122
- type: PropType<Record<string, any>>;
123
- default: () => void;
124
- };
125
- /**
126
- * 是否支持多选文件
127
- * 类型:boolean
128
- * 默认值:false
129
- */
130
- multiple: {
131
- type: BooleanConstructor;
132
- default: boolean;
133
- };
134
- /**
135
- * 是否禁用
136
- * 类型:boolean
137
- * 默认值:false
138
- */
139
- disabled: {
140
- type: BooleanConstructor;
141
- default: boolean;
142
- };
143
- /**
144
- * 最大允许上传个数
145
- * 类型:number
146
- * 默认值:无
147
- */
148
- limit: NumberConstructor;
149
- /**
150
- * 限制上传个数的情况下,是否展示当前上传的个数
151
- * 类型:boolean
152
- * 默认值:true
153
- */
154
- showLimitNum: {
155
- type: BooleanConstructor;
156
- default: boolean;
157
- };
158
- /**
159
- * 文件大小限制,单位为byte
160
- * 类型:number
161
- * 默认值:Number.MAX_VALUE
162
- */
163
- maxSize: {
164
- type: NumberConstructor;
165
- default: number;
166
- };
167
- /**
168
- * 选择图片的来源,chooseImage接口详细参数,查看官方手册
169
- * 类型:array
170
- * 默认值:['album','camera']
171
- */
172
- sourceType: {
173
- type: PropType<UploadSourceType[]>;
174
- default: () => string[];
175
- };
176
- /**
177
- * 所选的图片的尺寸,chooseImage接口详细参数,查看官方手册
178
- * 类型:array
179
- * 默认值:['original','compressed']
180
- */
181
- sizeType: {
182
- type: PropType<UploadSizeType[]>;
183
- default: () => string[];
184
- };
185
- /**
186
- * 文件对应的key,开发者在服务端可以通过这个key获取文件的二进制内容,uploadFile接口详细参数,查看官方手册
187
- * 类型:string
188
- * 默认值:'file'
189
- */
190
- name: {
191
- type: PropType<string>;
192
- default: string;
193
- };
194
- /**
195
- * HTTP请求中其他额外的formdata,uploadFile接口详细参数,查看官方手册
196
- * 类型:object
197
- * 默认值:{}
198
- */
199
- formData: {
200
- type: PropType<UploadFormData>;
201
- default: () => void;
202
- };
203
- /**
204
- * 预览失败执行操作
205
- * 类型:function({index,imgList})
206
- * 默认值:-
207
- */
208
- onPreviewFail: PropType<UploadOnPreviewFail>;
209
- /**
210
- * 上传文件之前的钩子,参数为上传的文件和文件列表,若返回false或者返回Promise且被reject,则停止上传。
211
- * 类型:function({files,fileList,resolve})
212
- * 默认值:-
213
- */
214
- beforeUpload: PropType<UploadBeforeUpload>;
215
- /**
216
- * 选择图片之前的钩子,参数为文件列表,若返回false或者返回Promise且被reject,则停止上传。
217
- * 类型:function({fileList,resolve})
218
- * 默认值:-
219
- */
220
- beforeChoose: PropType<UploadBeforeChoose>;
221
- /**
222
- * 删除文件之前的钩子,参数为要删除的文件和文件列表,若返回false或者返回Promise且被reject,则停止上传。
223
- * 类型:function({file,fileList,resolve})
224
- * 默认值:-
225
- */
226
- beforeRemove: PropType<UploadBeforeRemove>;
227
- /**
228
- * 图片预览前的钩子,参数为预览的图片下标和图片列表,若返回false或者返回Promise且被reject,则停止上传。
229
- * 类型:function({index,imgList,resolve})
230
- * 默认值:-
231
- */
232
- beforePreview: PropType<UploadBeforePreview>;
233
- /**
234
- * 构建上传formData的钩子,参数为上传的文件、待处理的formData,返回值为处理后的formData,若返回false或者返回Promise且被reject,则停止上传。
235
- * 类型:function({file,formData,resolve})
236
- * 默认值:-
237
- * 最低版本:0.1.61
238
- */
239
- buildFormData: PropType<UploadBuildFormData>;
240
- /**
241
- * 加载中图标类型
242
- * 类型:string
243
- * 默认值:'ring'
244
- */
245
- loadingType: {
246
- type: PropType<LoadingType>;
247
- default: LoadingType;
248
- };
249
- /**
250
- * 加载中图标颜色
251
- * 类型:string
252
- * 默认值:'#ffffff'
253
- */
254
- loadingColor: {
255
- type: PropType<string>;
256
- default: string;
257
- };
258
- /**
259
- * 文件类型,可选值:'image' | 'video' | 'media' | 'all' | 'file'
260
- * 默认值:image
261
- * 描述:'media'表示同时支持'image'和'video','file'表示支持除'image'和'video'外的所有文件类型,'all'标识支持全部类型文件
262
- * 'media'和'file'仅微信支持,'all'仅微信和H5支持
263
- */
264
- accept: {
265
- type: PropType<UploadFileType>;
266
- default: UploadFileType;
267
- };
268
- /**
269
- * file 数据结构中,status 对应的 key
270
- * 类型:string
271
- * 默认值:'status'
272
- */
273
- statusKey: {
274
- type: PropType<string>;
275
- default: string;
276
- };
277
- /**
278
- * 加载中图标尺寸
279
- * 类型:string
280
- * 默认值:'24px'
281
- */
282
- loadingSize: {
283
- type: PropType<string>;
284
- default: string;
285
- };
286
- /**
287
- * 是否压缩视频,当 accept 为 video 时生效。
288
- * 类型:boolean
289
- * 默认值:true
290
- */
291
- compressed: {
292
- type: BooleanConstructor;
293
- default: boolean;
294
- };
295
- /**
296
- * 拍摄视频最长拍摄时间,当 accept 为 video | media 时生效,单位秒。
297
- * 类型:number
298
- * 默认值:60
299
- */
300
- maxDuration: {
301
- type: NumberConstructor;
302
- default: number;
303
- };
304
- /**
305
- * 使用前置或者后置相机,当 accept 为 video | media 时生效,可选值为:back|front。
306
- * 类型:UploadCameraType
307
- * 默认值:'back'
308
- */
309
- camera: {
310
- type: PropType<UploadCameraType>;
311
- default: UploadCameraType;
312
- };
313
- /**
314
- * 预览图片的mode属性
315
- */
316
- imageMode: {
317
- type: PropType<ImageMode>;
318
- default: ImageMode;
319
- };
320
- /**
321
- * 接口响应的成功状态(statusCode)值
322
- */
323
- successStatus: {
324
- type: NumberConstructor;
325
- default: number;
326
- };
327
- /**
328
- * 自定义上传按钮样式
329
- * 类型:string
330
- */
331
- customEvokeClass: {
332
- type: PropType<string>;
333
- default: string;
334
- };
335
- /**
336
- * 自定义预览图片列表样式
337
- * 类型:string
338
- */
339
- customPreviewClass: {
340
- type: PropType<string>;
341
- default: string;
342
- };
343
- /**
344
- * 是否选择文件后自动上传
345
- * 类型:boolean
346
- */
347
- autoUpload: {
348
- type: BooleanConstructor;
349
- default: boolean;
350
- };
351
- /**
352
- * 自定义上传文件的请求方法
353
- * 类型:UploadMethod
354
- * 默认值:-
355
- */
356
- uploadMethod: PropType<UploadMethod>;
357
- customStyle: {
358
- type: PropType<string>;
359
- default: string;
360
- };
361
- customClass: {
362
- type: PropType<string>;
363
- default: string;
364
- };
365
- };
366
- export type UploadProps = ExtractPropTypes<typeof uploadProps>;
110
+ /**
111
+ * 上传的文件列表,例如:[{name:'food.jpg',url:'https://xxx.cdn.com/xxx.jpg'}]
112
+ * 类型:array
113
+ * 默认值:[]
114
+ */
115
+ fileList: {
116
+ type: PropType<UploadFile[]>
117
+ default: () => never[]
118
+ }
119
+ /**
120
+ * 必选参数,上传的地址
121
+ * 类型:string
122
+ * 默认值:''
123
+ */
124
+ action: {
125
+ type: PropType<string>
126
+ default: string
127
+ }
128
+ /**
129
+ * 设置上传的请求头部
130
+ * 类型:object
131
+ * 默认值:{}
132
+ */
133
+ header: {
134
+ type: PropType<Record<string, any>>
135
+ default: () => void
136
+ }
137
+ /**
138
+ * 是否支持多选文件
139
+ * 类型:boolean
140
+ * 默认值:false
141
+ */
142
+ multiple: {
143
+ type: BooleanConstructor
144
+ default: boolean
145
+ }
146
+ /**
147
+ * 是否禁用
148
+ * 类型:boolean
149
+ * 默认值:false
150
+ */
151
+ disabled: {
152
+ type: BooleanConstructor
153
+ default: boolean
154
+ }
155
+ /**
156
+ * 最大允许上传个数
157
+ * 类型:number
158
+ * 默认值:无
159
+ */
160
+ limit: NumberConstructor
161
+ /**
162
+ * 限制上传个数的情况下,是否展示当前上传的个数
163
+ * 类型:boolean
164
+ * 默认值:true
165
+ */
166
+ showLimitNum: {
167
+ type: BooleanConstructor
168
+ default: boolean
169
+ }
170
+ /**
171
+ * 文件大小限制,单位为byte
172
+ * 类型:number
173
+ * 默认值:Number.MAX_VALUE
174
+ */
175
+ maxSize: {
176
+ type: NumberConstructor
177
+ default: number
178
+ }
179
+ /**
180
+ * 选择图片的来源,chooseImage接口详细参数,查看官方手册
181
+ * 类型:array
182
+ * 默认值:['album','camera']
183
+ */
184
+ sourceType: {
185
+ type: PropType<UploadSourceType[]>
186
+ default: () => string[]
187
+ }
188
+ /**
189
+ * 所选的图片的尺寸,chooseImage接口详细参数,查看官方手册
190
+ * 类型:array
191
+ * 默认值:['original','compressed']
192
+ */
193
+ sizeType: {
194
+ type: PropType<UploadSizeType[]>
195
+ default: () => string[]
196
+ }
197
+ /**
198
+ * 文件对应的key,开发者在服务端可以通过这个key获取文件的二进制内容,uploadFile接口详细参数,查看官方手册
199
+ * 类型:string
200
+ * 默认值:'file'
201
+ */
202
+ name: {
203
+ type: PropType<string>
204
+ default: string
205
+ }
206
+ /**
207
+ * HTTP请求中其他额外的formdata,uploadFile接口详细参数,查看官方手册
208
+ * 类型:object
209
+ * 默认值:{}
210
+ */
211
+ formData: {
212
+ type: PropType<UploadFormData>
213
+ default: () => void
214
+ }
215
+ /**
216
+ * 预览失败执行操作
217
+ * 类型:function({index,imgList})
218
+ * 默认值:-
219
+ */
220
+ onPreviewFail: PropType<UploadOnPreviewFail>
221
+ /**
222
+ * 上传文件之前的钩子,参数为上传的文件和文件列表,若返回false或者返回Promise且被reject,则停止上传。
223
+ * 类型:function({files,fileList,resolve})
224
+ * 默认值:-
225
+ */
226
+ beforeUpload: PropType<UploadBeforeUpload>
227
+ /**
228
+ * 选择图片之前的钩子,参数为文件列表,若返回false或者返回Promise且被reject,则停止上传。
229
+ * 类型:function({fileList,resolve})
230
+ * 默认值:-
231
+ */
232
+ beforeChoose: PropType<UploadBeforeChoose>
233
+ /**
234
+ * 删除文件之前的钩子,参数为要删除的文件和文件列表,若返回false或者返回Promise且被reject,则停止上传。
235
+ * 类型:function({file,fileList,resolve})
236
+ * 默认值:-
237
+ */
238
+ beforeRemove: PropType<UploadBeforeRemove>
239
+ /**
240
+ * 图片预览前的钩子,参数为预览的图片下标和图片列表,若返回false或者返回Promise且被reject,则停止上传。
241
+ * 类型:function({index,imgList,resolve})
242
+ * 默认值:-
243
+ */
244
+ beforePreview: PropType<UploadBeforePreview>
245
+ /**
246
+ * 构建上传formData的钩子,参数为上传的文件、待处理的formData,返回值为处理后的formData,若返回false或者返回Promise且被reject,则停止上传。
247
+ * 类型:function({file,formData,resolve})
248
+ * 默认值:-
249
+ * 最低版本:0.1.61
250
+ */
251
+ buildFormData: PropType<UploadBuildFormData>
252
+ /**
253
+ * 加载中图标类型
254
+ * 类型:string
255
+ * 默认值:'ring'
256
+ */
257
+ loadingType: {
258
+ type: PropType<LoadingType>
259
+ default: LoadingType
260
+ }
261
+ /**
262
+ * 加载中图标颜色
263
+ * 类型:string
264
+ * 默认值:'#ffffff'
265
+ */
266
+ loadingColor: {
267
+ type: PropType<string>
268
+ default: string
269
+ }
270
+ /**
271
+ * 文件类型,可选值:'image' | 'video' | 'media' | 'all' | 'file'
272
+ * 默认值:image
273
+ * 描述:'media'表示同时支持'image'和'video','file'表示支持除'image'和'video'外的所有文件类型,'all'标识支持全部类型文件
274
+ * 'media'和'file'仅微信支持,'all'仅微信和H5支持
275
+ */
276
+ accept: {
277
+ type: PropType<UploadFileType>
278
+ default: UploadFileType
279
+ }
280
+ /**
281
+ * file 数据结构中,status 对应的 key
282
+ * 类型:string
283
+ * 默认值:'status'
284
+ */
285
+ statusKey: {
286
+ type: PropType<string>
287
+ default: string
288
+ }
289
+ /**
290
+ * 加载中图标尺寸
291
+ * 类型:string
292
+ * 默认值:'24px'
293
+ */
294
+ loadingSize: {
295
+ type: PropType<string>
296
+ default: string
297
+ }
298
+ /**
299
+ * 是否压缩视频,当 accept 为 video 时生效。
300
+ * 类型:boolean
301
+ * 默认值:true
302
+ */
303
+ compressed: {
304
+ type: BooleanConstructor
305
+ default: boolean
306
+ }
307
+ /**
308
+ * 拍摄视频最长拍摄时间,当 accept 为 video | media 时生效,单位秒。
309
+ * 类型:number
310
+ * 默认值:60
311
+ */
312
+ maxDuration: {
313
+ type: NumberConstructor
314
+ default: number
315
+ }
316
+ /**
317
+ * 使用前置或者后置相机,当 accept 为 video | media 时生效,可选值为:back|front。
318
+ * 类型:UploadCameraType
319
+ * 默认值:'back'
320
+ */
321
+ camera: {
322
+ type: PropType<UploadCameraType>
323
+ default: UploadCameraType
324
+ }
325
+ /**
326
+ * 预览图片的mode属性
327
+ */
328
+ imageMode: {
329
+ type: PropType<ImageMode>
330
+ default: ImageMode
331
+ }
332
+ /**
333
+ * 接口响应的成功状态(statusCode)值
334
+ */
335
+ successStatus: {
336
+ type: NumberConstructor
337
+ default: number
338
+ }
339
+ /**
340
+ * 自定义上传按钮样式
341
+ * 类型:string
342
+ */
343
+ customEvokeClass: {
344
+ type: PropType<string>
345
+ default: string
346
+ }
347
+ /**
348
+ * 自定义预览图片列表样式
349
+ * 类型:string
350
+ */
351
+ customPreviewClass: {
352
+ type: PropType<string>
353
+ default: string
354
+ }
355
+ /**
356
+ * 是否选择文件后自动上传
357
+ * 类型:boolean
358
+ */
359
+ autoUpload: {
360
+ type: BooleanConstructor
361
+ default: boolean
362
+ }
363
+ /**
364
+ * 自定义上传文件的请求方法
365
+ * 类型:UploadMethod
366
+ * 默认值:-
367
+ */
368
+ uploadMethod: PropType<UploadMethod>
369
+ customStyle: {
370
+ type: PropType<string>
371
+ default: string
372
+ }
373
+ customClass: {
374
+ type: PropType<string>
375
+ default: string
376
+ }
377
+ }
378
+ export type UploadProps = ExtractPropTypes<typeof uploadProps>
367
379
  export type UploadExpose = {
368
- /**
369
- * 手动触发上传
370
- */
371
- submit: () => void;
372
- };
380
+ /**
381
+ * 手动触发上传
382
+ */
383
+ submit: () => void
384
+ }
373
385
  export type UploadErrorEvent = {
374
- error: any;
375
- file: UploadFileItem;
376
- formData: UploadFormData;
377
- };
386
+ error: any
387
+ file: UploadFileItem
388
+ formData: UploadFormData
389
+ }
378
390
  export type UploadChangeEvent = {
379
- fileList: UploadFileItem[];
380
- };
391
+ fileList: UploadFileItem[]
392
+ }
381
393
  export type UploadSuccessEvent = {
382
- file: UploadFileItem;
383
- fileList: UploadFileItem[];
384
- formData: UploadFormData;
385
- };
394
+ file: UploadFileItem
395
+ fileList: UploadFileItem[]
396
+ formData: UploadFormData
397
+ }
386
398
  export type UploadProgressEvent = {
387
- response: UniApp.OnProgressUpdateResult;
388
- file: UploadFileItem;
389
- };
399
+ response: UniApp.OnProgressUpdateResult
400
+ file: UploadFileItem
401
+ }
390
402
  export type UploadOversizeEvent = {
391
- file: ChooseFile;
392
- };
403
+ file: ChooseFile
404
+ }
393
405
  export type UploadRemoveEvent = {
394
- file: UploadFileItem;
395
- };
396
- export type UploadInstance = ComponentPublicInstance<UploadProps, UploadExpose>;
406
+ file: UploadFileItem
407
+ }
408
+ export type UploadInstance = ComponentPublicInstance<UploadProps, UploadExpose>