diff --git a/packages/@uppy/aws-s3-multipart/types/aws-s3-multipart-tests.ts b/packages/@uppy/aws-s3-multipart/types/aws-s3-multipart-tests.ts index 6742e5f262..64e300bbcd 100644 --- a/packages/@uppy/aws-s3-multipart/types/aws-s3-multipart-tests.ts +++ b/packages/@uppy/aws-s3-multipart/types/aws-s3-multipart-tests.ts @@ -1,34 +1,34 @@ -import Uppy, { UppyFile } from '@uppy/core'; -import AwsS3Multipart, { AwsS3Part } from '../'; +import Uppy = require('@uppy/core'); +import AwsS3Multipart = require('../'); { const uppy = Uppy(); uppy.use(AwsS3Multipart, { createMultipartUpload(file) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile }, listParts(file, opts) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile opts.uploadId // $ExpectType string opts.key // $ExpectType string }, prepareUploadPart(file, part) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile part.uploadId // $ExpectType string part.key // $ExpectType string part.body // $ExpectType Blob part.number // $ExpectType number }, abortMultipartUpload(file, opts) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile opts.uploadId // $ExpectType string opts.key // $ExpectType string }, completeMultipartUpload(file, opts) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile opts.uploadId // $ExpectType string opts.key // $ExpectType string - opts.parts[0] // $ExpectType AwsS3Part + opts.parts[0] // $ExpectType AwsS3Multipart.AwsS3Part }, }); } diff --git a/packages/@uppy/aws-s3/types/aws-s3-tests.ts b/packages/@uppy/aws-s3/types/aws-s3-tests.ts index 0929ea364b..3ca8e591bf 100644 --- a/packages/@uppy/aws-s3/types/aws-s3-tests.ts +++ b/packages/@uppy/aws-s3/types/aws-s3-tests.ts @@ -1,11 +1,11 @@ -import Uppy, { UppyFile } from '@uppy/core'; -import AwsS3 from '../'; +import Uppy = require('@uppy/core'); +import AwsS3 = require('../'); { const uppy = Uppy(); uppy.use(AwsS3, { getUploadParameters(file) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile } }); } diff --git a/packages/@uppy/dashboard/types/dashboard-tests.ts b/packages/@uppy/dashboard/types/dashboard-tests.ts index b271989aa7..956859c608 100644 --- a/packages/@uppy/dashboard/types/dashboard-tests.ts +++ b/packages/@uppy/dashboard/types/dashboard-tests.ts @@ -1,5 +1,5 @@ -import Uppy from '@uppy/core'; -import Dashboard from '../'; +import Uppy = require('@uppy/core') +import Dashboard = require('../') { const uppy = Uppy() @@ -7,7 +7,7 @@ import Dashboard from '../'; target: 'body' }) - const plugin = uppy.getPlugin('Dashboard') + const plugin = uppy.getPlugin('Dashboard') as Dashboard plugin.openModal() plugin.isModalOpen() // $ExpectType boolean plugin.closeModal() diff --git a/packages/@uppy/transloadit/types/transloadit-tests.ts b/packages/@uppy/transloadit/types/transloadit-tests.ts index 03477d4ded..ce3a775330 100644 --- a/packages/@uppy/transloadit/types/transloadit-tests.ts +++ b/packages/@uppy/transloadit/types/transloadit-tests.ts @@ -1,11 +1,11 @@ -import Uppy, { UppyFile } from '@uppy/core'; -import Transloadit from '../'; +import Uppy = require('@uppy/core') +import Transloadit = require('../') { - const uppy = Uppy(); + const uppy = Uppy() uppy.use(Transloadit, { getAssemblyOptions(file) { - file // $ExpectType UppyFile + file // $ExpectType Uppy.UppyFile }, waitForEncoding: false, waitForMetadata: true, @@ -14,40 +14,40 @@ import Transloadit from '../'; auth: { key: 'abc' }, steps: {} } - }); + }) } { - const uppy = Uppy(); + const uppy = Uppy() // $ExpectError - uppy.use(Transloadit, { waitForEncoding: null }); + uppy.use(Transloadit, { waitForEncoding: null }) // $ExpectError - uppy.use(Transloadit, { waitForMetadata: null }); + uppy.use(Transloadit, { waitForMetadata: null }) } { - const uppy = Uppy(); + const uppy = Uppy() // $ExpectError - uppy.use(Transloadit, { params: {} }); + uppy.use(Transloadit, { params: {} }) // $ExpectError - uppy.use(Transloadit, { params: { auth: {} } }); + uppy.use(Transloadit, { params: { auth: {} } }) // $ExpectError uppy.use(Transloadit, { params: { auth: { key: null } } - }); + }) // $ExpectError uppy.use(Transloadit, { params: { auth: { key: 'abc' }, steps: 'test' } - }); + }) uppy.use(Transloadit, { params: { auth: { key: 'abc' }, steps: { name: {} } } - }); + }) } diff --git a/test/endtoend/typescript/main.ts b/test/endtoend/typescript/main.ts index fedf7f1441..656a1a2b24 100644 --- a/test/endtoend/typescript/main.ts +++ b/test/endtoend/typescript/main.ts @@ -1,18 +1,20 @@ import 'es6-promise/auto' import 'whatwg-fetch' -import Uppy = require('@uppy/core') -import Dashboard = require('@uppy/dashboard') -import Instagram = require('@uppy/instagram') -import Dropbox = require('@uppy/dropbox') -import GoogleDrive = require('@uppy/google-drive') -import Url = require('@uppy/url') -import Webcam = require('@uppy/webcam') -import Tus = require('@uppy/tus') -import Form = require('@uppy/form') +import { + Core, + Dashboard, + Instagram, + Dropbox, + GoogleDrive, + Url, + Webcam, + Tus, + Form +} from 'uppy' const TUS_ENDPOINT = 'https://master.tus.io/files/' -const uppy = Uppy({ +const uppy = Core({ debug: true, meta: { username: 'John', diff --git a/tsconfig.json b/tsconfig.json index dfe3a66e51..e38bb81a2d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "types": [], "noEmit": true, "esModuleInterop": true, - "allowSyntheticDefaultImports": true, + "allowSyntheticDefaultImports": false, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true },