upload.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { SuperComponent } from '../common/src/index';
  2. import { UploadMpConfig, UploadFile } from './type';
  3. export default class Upload extends SuperComponent {
  4. externalClasses: string[];
  5. options: {
  6. multipleSlots: boolean;
  7. };
  8. data: {
  9. classPrefix: string;
  10. prefix: string;
  11. current: boolean;
  12. proofs: any[];
  13. customFiles: UploadFile[];
  14. customLimit: number;
  15. config: UploadMpConfig;
  16. files: UploadFile[];
  17. max: number;
  18. sizeLimit: number;
  19. requestMethod: any;
  20. gridItemStyle: string;
  21. column: number;
  22. };
  23. properties: import("./type").TdUploadProps;
  24. controlledProps: {
  25. key: string;
  26. event: string;
  27. }[];
  28. observers: {
  29. files(files: UploadFile): void;
  30. max(max: any): void;
  31. gridConfig(): void;
  32. };
  33. onProofTap(e: any): void;
  34. ready(): void;
  35. handleLimit(customFiles: UploadFile[], max: number): void;
  36. uploadFiles(files: UploadFile[]): Promise<unknown>;
  37. startUpload(files: UploadFile[]): Promise<unknown>;
  38. /** 选择媒体素材 */
  39. chooseMedia(mediaType: any): void;
  40. /**
  41. * 由于小程序暂时在ios上不支持返回上传文件的fileType,这里用文件的后缀来判断
  42. * @param mediaType
  43. * @param tempFilePath
  44. * @returns string
  45. * @link https://developers.weixin.qq.com/community/develop/doc/00042820b28ee8fb41fc4d0c254c00
  46. */
  47. getFileType(mediaType: string[], tempFilePath: string, fileType?: string): string;
  48. getRandFileName(filePath: any): string;
  49. closePop(): void;
  50. onAddTap(): void;
  51. onChooseImage(): void;
  52. onChooseVideo(): void;
  53. onDelete(e: any): void;
  54. deleteHandle(index: number): void;
  55. updateGrid(): void;
  56. }