react-dropzone 11.3.4 → 11.4.2

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.
@@ -260,3 +260,18 @@ function createFile(name, size, type) {
260
260
  return file
261
261
  }
262
262
 
263
+ describe('ErrorCode', () => {
264
+ let utils
265
+ beforeEach(async done => {
266
+ utils = await import('./index')
267
+ done()
268
+ })
269
+
270
+ it('should exist and have known error code properties', () => {
271
+ expect(utils.ErrorCode.FileInvalidType).toEqual(utils.FILE_INVALID_TYPE)
272
+ expect(utils.ErrorCode.FileTooLarge).toEqual(utils.FILE_TOO_LARGE)
273
+ expect(utils.ErrorCode.FileTooSmall).toEqual(utils.FILE_TOO_SMALL)
274
+ expect(utils.ErrorCode.TooManyFiles).toEqual(utils.TOO_MANY_FILES)
275
+ })
276
+ })
277
+
@@ -8,9 +8,16 @@ export interface DropzoneProps extends DropzoneOptions {
8
8
  children?(state: DropzoneState): JSX.Element;
9
9
  }
10
10
 
11
+ export enum ErrorCode {
12
+ FileInvalidType = 'file-invalid-type',
13
+ FileTooLarge = 'file-too-large',
14
+ FileTooSmall = 'file-too-small',
15
+ TooManyFiles = 'too-many-files',
16
+ }
17
+
11
18
  export interface FileError {
12
19
  message: string;
13
- code: "file-too-large" | "file-too-small" | "too-many-files" | "file-invalid-type" | string;
20
+ code: ErrorCode | string;
14
21
  }
15
22
 
16
23
  export interface FileRejection {