interface.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { booleanType, stringType, functionType, arrayType, objectType, someType } from '../_util/type';
  2. function uploadProps() {
  3. return {
  4. capture: someType([Boolean, String]),
  5. type: stringType(),
  6. name: String,
  7. defaultFileList: arrayType(),
  8. fileList: arrayType(),
  9. action: someType([String, Function]),
  10. directory: booleanType(),
  11. data: someType([Object, Function]),
  12. method: stringType(),
  13. headers: objectType(),
  14. showUploadList: someType([Boolean, Object]),
  15. multiple: booleanType(),
  16. accept: String,
  17. beforeUpload: functionType(),
  18. onChange: functionType(),
  19. 'onUpdate:fileList': functionType(),
  20. onDrop: functionType(),
  21. listType: stringType(),
  22. onPreview: functionType(),
  23. onDownload: functionType(),
  24. onReject: functionType(),
  25. onRemove: functionType(),
  26. /** @deprecated Please use `onRemove` directly */
  27. remove: functionType(),
  28. supportServerRender: booleanType(),
  29. disabled: booleanType(),
  30. prefixCls: String,
  31. customRequest: functionType(),
  32. withCredentials: booleanType(),
  33. openFileDialogOnClick: booleanType(),
  34. locale: objectType(),
  35. id: String,
  36. previewFile: functionType(),
  37. /** @deprecated Please use `beforeUpload` directly */
  38. transformFile: functionType(),
  39. iconRender: functionType(),
  40. isImageUrl: functionType(),
  41. progress: objectType(),
  42. itemRender: functionType(),
  43. /** Config max count of `fileList`. Will replace current one when `maxCount` is 1 */
  44. maxCount: Number,
  45. height: someType([Number, String]),
  46. removeIcon: functionType(),
  47. downloadIcon: functionType(),
  48. previewIcon: functionType()
  49. };
  50. }
  51. function uploadListProps() {
  52. return {
  53. listType: stringType(),
  54. onPreview: functionType(),
  55. onDownload: functionType(),
  56. onRemove: functionType(),
  57. items: arrayType(),
  58. progress: objectType(),
  59. prefixCls: stringType(),
  60. showRemoveIcon: booleanType(),
  61. showDownloadIcon: booleanType(),
  62. showPreviewIcon: booleanType(),
  63. removeIcon: functionType(),
  64. downloadIcon: functionType(),
  65. previewIcon: functionType(),
  66. locale: objectType(undefined),
  67. previewFile: functionType(),
  68. iconRender: functionType(),
  69. isImageUrl: functionType(),
  70. appendAction: functionType(),
  71. appendActionVisible: booleanType(),
  72. itemRender: functionType()
  73. };
  74. }
  75. export { uploadProps, uploadListProps };