utils.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /// <reference types="miniprogram-api-typings" />
  2. interface File {
  3. path: string;
  4. url: string;
  5. size: number;
  6. name: string;
  7. type: string;
  8. time: number;
  9. image: boolean;
  10. }
  11. export declare function isImageFile(item: File): boolean;
  12. export declare function isVideo(
  13. res: any,
  14. accept: string
  15. ): res is WechatMiniprogram.ChooseVideoSuccessCallbackResult;
  16. export declare function chooseFile({
  17. accept,
  18. multiple,
  19. capture,
  20. compressed,
  21. maxDuration,
  22. sizeType,
  23. camera,
  24. maxCount,
  25. }: {
  26. accept: any;
  27. multiple: any;
  28. capture: any;
  29. compressed: any;
  30. maxDuration: any;
  31. sizeType: any;
  32. camera: any;
  33. maxCount: any;
  34. }): Promise<
  35. | WechatMiniprogram.ChooseImageSuccessCallbackResult
  36. | WechatMiniprogram.ChooseMediaSuccessCallbackResult
  37. | WechatMiniprogram.ChooseVideoSuccessCallbackResult
  38. | WechatMiniprogram.ChooseMessageFileSuccessCallbackResult
  39. >;
  40. export declare function isFunction(val: unknown): val is Function;
  41. export declare function isObject(val: any): val is Record<any, any>;
  42. export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
  43. export {};