1 | const PropTypes = require('prop-types')
|
2 | const UppyCore = require('@uppy/core').Uppy
|
3 |
|
4 |
|
5 | const uppy = PropTypes.instanceOf(UppyCore).isRequired
|
6 |
|
7 |
|
8 | const plugins = PropTypes.arrayOf(PropTypes.string)
|
9 |
|
10 |
|
11 | const locale = PropTypes.shape({
|
12 | strings: PropTypes.object,
|
13 | pluralize: PropTypes.func
|
14 | })
|
15 |
|
16 |
|
17 | const metaField = PropTypes.shape({
|
18 | id: PropTypes.string.isRequired,
|
19 | name: PropTypes.string.isRequired,
|
20 | placeholder: PropTypes.string
|
21 | })
|
22 | const metaFields = PropTypes.arrayOf(metaField)
|
23 |
|
24 |
|
25 | const cssSize = PropTypes.oneOfType([
|
26 | PropTypes.string,
|
27 | PropTypes.number
|
28 | ])
|
29 |
|
30 |
|
31 | const dashboard = {
|
32 | uppy,
|
33 | inline: PropTypes.bool,
|
34 | plugins,
|
35 | width: cssSize,
|
36 | height: cssSize,
|
37 | showProgressDetails: PropTypes.bool,
|
38 | hideUploadButton: PropTypes.bool,
|
39 | hideProgressAfterFinish: PropTypes.bool,
|
40 | note: PropTypes.string,
|
41 | metaFields,
|
42 | proudlyDisplayPoweredByUppy: PropTypes.bool,
|
43 | disableStatusBar: PropTypes.bool,
|
44 | disableInformer: PropTypes.bool,
|
45 | disableThumbnailGenerator: PropTypes.bool,
|
46 |
|
47 | thumbnailWidth: PropTypes.number,
|
48 | locale
|
49 | }
|
50 |
|
51 | module.exports = {
|
52 | uppy,
|
53 | locale,
|
54 | dashboard
|
55 | }
|