소스 검색

Convert to "export =" everywhere because...

...the *.js source files use "module.exports = " instead of
"export default".
Matthias Bohlen 6 년 전
부모
커밋
c8cb89bde0

+ 19 - 19
packages/@uppy/aws-s3-multipart/types/index.d.ts

@@ -1,32 +1,32 @@
 import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
 
 declare module AwsS3Multipart {
-    interface AwsS3Part {
-        PartNumber?: number;
-        Size?: number;
-        ETag?: string;
-    }
+  interface AwsS3Part {
+    PartNumber?: number;
+    Size?: number;
+    ETag?: string;
+  }
 
-    interface AwsS3MultipartOptions extends PluginOptions {
-        serverUrl: string;
-        createMultipartUpload(file: UppyFile): Promise<{ uploadId: string, key: string }>;
-        listParts(file: UppyFile, opts: { uploadId: string, key: string }): Promise<AwsS3Part[]>;
-        prepareUploadPart(file: UppyFile, partData: { uploadId: string, key: string, body: Blob, number: number }): Promise<{ url: string }>;
-        abortMultipartUpload(file: UppyFile, opts: { uploadId: string, key: string }): Promise<void>;
-        completeMultipartUpload(file: UppyFile, opts: { uploadId: string, key: string, parts: AwsS3Part[] }): Promise<{ location?: string }>;
-        timeout: number;
-        limit: number;
-    }
+  interface AwsS3MultipartOptions extends PluginOptions {
+    serverUrl: string;
+    createMultipartUpload(file: UppyFile): Promise<{ uploadId: string, key: string }>;
+    listParts(file: UppyFile, opts: { uploadId: string, key: string }): Promise<AwsS3Part[]>;
+    prepareUploadPart(file: UppyFile, partData: { uploadId: string, key: string, body: Blob, number: number }): Promise<{ url: string }>;
+    abortMultipartUpload(file: UppyFile, opts: { uploadId: string, key: string }): Promise<void>;
+    completeMultipartUpload(file: UppyFile, opts: { uploadId: string, key: string, parts: AwsS3Part[] }): Promise<{ location?: string }>;
+    timeout: number;
+    limit: number;
+  }
 }
 
 declare class AwsS3Multipart extends Plugin {
-    constructor(uppy: Uppy, opts: Partial<AwsS3Multipart.AwsS3MultipartOptions>);
+  constructor(uppy: Uppy, opts: Partial<AwsS3Multipart.AwsS3MultipartOptions>);
 }
 
 export = AwsS3Multipart;
 
 declare module '@uppy/core' {
-    export interface Uppy {
-        use(pluginClass: typeof AwsS3Multipart, opts: Partial<AwsS3Multipart.AwsS3MultipartOptions>): Uppy;
-    }
+  export interface Uppy {
+    use(pluginClass: typeof AwsS3Multipart, opts: Partial<AwsS3Multipart.AwsS3MultipartOptions>): Uppy;
+  }
 }

+ 18 - 14
packages/@uppy/aws-s3/types/index.d.ts

@@ -1,25 +1,29 @@
 import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
 
-export interface AwsS3UploadParameters {
-  method?: string;
-  url: string;
-  fields?: { [type: string]: string };
-  headers?: { [type: string]: string };
-}
+declare module AwsS3 {
+  interface AwsS3UploadParameters {
+    method?: string;
+    url: string;
+    fields?: { [type: string]: string };
+    headers?: { [type: string]: string };
+  }
 
-export interface AwsS3Options extends PluginOptions {
-  serverUrl: string;
-  getUploadParameters(file: UppyFile): Promise<AwsS3UploadParameters>;
-  timeout: number;
-  limit: number;
+  interface AwsS3Options extends PluginOptions {
+    serverUrl: string;
+    getUploadParameters(file: UppyFile): Promise<AwsS3UploadParameters>;
+    timeout: number;
+    limit: number;
+  }
 }
 
-export default class AwsS3 extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<AwsS3Options>);
+declare class AwsS3 extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<AwsS3.AwsS3Options>);
 }
 
+export = AwsS3;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof AwsS3, opts: Partial<AwsS3Options>): Uppy;
+    use(pluginClass: typeof AwsS3, opts: Partial<AwsS3.AwsS3Options>): Uppy;
   }
 }

+ 27 - 23
packages/@uppy/dashboard/types/index.d.ts

@@ -1,29 +1,31 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface DashboardOptions extends PluginOptions {
-  onRequestCloseModal: () => void;
-  disablePageScrollWhenModalOpen: boolean;
-  closeModalOnClickOutside: boolean;
-  trigger: string | HTMLElement;
-  inline: boolean;
-  defaultTabIcon: string;
-  hideUploadButton: boolean;
-  width: string | number;
-  height: string | number;
-  note: string;
-  showLinkToFileUploadResult: boolean;
-  proudlyDisplayPoweredByUppy: boolean;
-  metaFields: string[];
-  plugins: string[];
-  disableStatusBar: boolean;
-  showProgressDetails: boolean;
-  hideProgressAfterFinish: boolean;
-  disableInformer: boolean;
-  disableThumbnailGenerator: boolean;
+declare module Dashboard {
+  interface DashboardOptions extends PluginOptions {
+    onRequestCloseModal: () => void;
+    disablePageScrollWhenModalOpen: boolean;
+    closeModalOnClickOutside: boolean;
+    trigger: string | HTMLElement;
+    inline: boolean;
+    defaultTabIcon: string;
+    hideUploadButton: boolean;
+    width: string | number;
+    height: string | number;
+    note: string;
+    showLinkToFileUploadResult: boolean;
+    proudlyDisplayPoweredByUppy: boolean;
+    metaFields: string[];
+    plugins: string[];
+    disableStatusBar: boolean;
+    showProgressDetails: boolean;
+    hideProgressAfterFinish: boolean;
+    disableInformer: boolean;
+    disableThumbnailGenerator: boolean;
+  }
 }
 
-export default class Dashboard extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<DashboardOptions>);
+declare class Dashboard extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Dashboard.DashboardOptions>);
   addTarget(plugin: Plugin): HTMLElement;
   hideAllPanels(): void;
   openModal(): void;
@@ -34,8 +36,10 @@ export default class Dashboard extends Plugin {
   uninstall(): void;
 }
 
+export = Dashboard;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Dashboard, opts: Partial<DashboardOptions>): Uppy;
+    use(pluginClass: typeof Dashboard, opts: Partial<Dashboard.DashboardOptions>): Uppy;
   }
 }

+ 13 - 9
packages/@uppy/drag-drop/types/index.d.ts

@@ -1,19 +1,23 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface DragDropOptions extends PluginOptions {
-  inputName: string;
-  allowMultipleFiles: boolean;
-  width: string;
-  height: string;
-  note: string;
+declare module DragDrop {
+  interface DragDropOptions extends PluginOptions {
+    inputName: string;
+    allowMultipleFiles: boolean;
+    width: string;
+    height: string;
+    note: string;
+  }
 }
 
-export default class DragDrop extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<DragDropOptions>);
+declare class DragDrop extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<DragDrop.DragDropOptions>);
 }
 
+export = DragDrop;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof DragDrop, opts: Partial<DragDropOptions>): Uppy;
+    use(pluginClass: typeof DragDrop, opts: Partial<DragDrop.DragDropOptions>): Uppy;
   }
 }

+ 10 - 6
packages/@uppy/dropbox/types/index.d.ts

@@ -1,17 +1,21 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 import { ProviderOptions } from '@uppy/companion-client';
 
-export interface DropboxOptions extends PluginOptions, ProviderOptions {
-  serverUrl: string;
-  serverPattern: string | RegExp | Array<string | RegExp>;
+declare module Dropbox {
+  interface DropboxOptions extends PluginOptions, ProviderOptions {
+    serverUrl: string;
+    serverPattern: string | RegExp | Array<string | RegExp>;
+  }
 }
 
-export default class Dropbox extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<DropboxOptions>);
+declare class Dropbox extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Dropbox.DropboxOptions>);
 }
 
+export = Dropbox;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Dropbox, opts: Partial<DropboxOptions>): Uppy;
+    use(pluginClass: typeof Dropbox, opts: Partial<Dropbox.DropboxOptions>): Uppy;
   }
 }

+ 10 - 6
packages/@uppy/file-input/types/index.d.ts

@@ -1,16 +1,20 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface FileInputOptions extends PluginOptions {
-  pretty: boolean;
-  inputName: string;
+declare module FileInput {
+  interface FileInputOptions extends PluginOptions {
+    pretty: boolean;
+    inputName: string;
+  }
 }
 
-export default class FileInput extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<FileInputOptions>);
+declare class FileInput extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<FileInput.FileInputOptions>);
 }
 
+export = FileInput;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof FileInput, opts: Partial<FileInputOptions>): Uppy;
+    use(pluginClass: typeof FileInput, opts: Partial<FileInput.FileInputOptions>): Uppy;
   }
 }

+ 13 - 9
packages/@uppy/form/types/index.d.ts

@@ -1,19 +1,23 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface FormOptions extends PluginOptions {
-  getMetaFromForm: boolean;
-  addResultToForm: boolean;
-  submitOnSuccess: boolean;
-  triggerUploadOnSubmit: boolean;
-  resultName: string;
+declare module Form {
+  interface FormOptions extends PluginOptions {
+    getMetaFromForm: boolean;
+    addResultToForm: boolean;
+    submitOnSuccess: boolean;
+    triggerUploadOnSubmit: boolean;
+    resultName: string;
+  }
 }
 
-export default class Form extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<FormOptions>);
+declare class Form extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Form.FormOptions>);
 }
 
+export = Form;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Form, opts: Partial<FormOptions>): Uppy;
+    use(pluginClass: typeof Form, opts: Partial<Form.FormOptions>): Uppy;
   }
 }

+ 11 - 7
packages/@uppy/golden-retriever/types/index.d.ts

@@ -1,17 +1,21 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface GoldenRetrieverOptions extends PluginOptions {
-  expires: number;
-  serviceWorker: boolean;
-  indexedDB: any;
+declare module GoldenRetriever {
+  interface GoldenRetrieverOptions extends PluginOptions {
+    expires: number;
+    serviceWorker: boolean;
+    indexedDB: any;
+  }
 }
 
-export default class GoldenRetriever extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<GoldenRetrieverOptions>);
+declare class GoldenRetriever extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<GoldenRetriever.GoldenRetrieverOptions>);
 }
 
+export = GoldenRetriever;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof GoldenRetriever, opts: Partial<GoldenRetrieverOptions>): Uppy;
+    use(pluginClass: typeof GoldenRetriever, opts: Partial<GoldenRetriever.GoldenRetrieverOptions>): Uppy;
   }
 }

+ 10 - 6
packages/@uppy/google-drive/types/index.d.ts

@@ -1,17 +1,21 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 import { ProviderOptions } from '@uppy/companion-client';
 
-export interface GoogleDriveOptions extends PluginOptions, ProviderOptions {
-  serverUrl: string;
-  serverPattern: string | RegExp | Array<string | RegExp>;
+declare module GoogleDrive {
+  interface GoogleDriveOptions extends PluginOptions, ProviderOptions {
+    serverUrl: string;
+    serverPattern: string | RegExp | Array<string | RegExp>;
+  }
 }
 
-export default class GoogleDrive extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<GoogleDriveOptions>);
+declare class GoogleDrive extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<GoogleDrive.GoogleDriveOptions>);
 }
 
+export = GoogleDrive;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof GoogleDrive, opts: Partial<GoogleDriveOptions>): Uppy;
+    use(pluginClass: typeof GoogleDrive, opts: Partial<GoogleDrive.GoogleDriveOptions>): Uppy;
   }
 }

+ 15 - 11
packages/@uppy/informer/types/index.d.ts

@@ -1,22 +1,26 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-interface Color {
-  bg: string | number;
-  text: string | number;
-}
+declare module Informer {
+  interface Color {
+    bg: string | number;
+    text: string | number;
+  }
 
-export interface InformerOptions extends PluginOptions {
-  typeColors: {
-    [type: string]: Color
-  };
+  interface InformerOptions extends PluginOptions {
+    typeColors: {
+      [type: string]: Color
+    };
+  }
 }
 
-export default class Informer extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<InformerOptions>);
+declare class Informer extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Informer.InformerOptions>);
 }
 
+export = Informer;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Informer, opts: Partial<InformerOptions>): Uppy;
+    use(pluginClass: typeof Informer, opts: Partial<Informer.InformerOptions>): Uppy;
   }
 }

+ 10 - 6
packages/@uppy/instagram/types/index.d.ts

@@ -1,17 +1,21 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 import { ProviderOptions } from '@uppy/companion-client';
 
-export interface InstagramOptions extends PluginOptions, ProviderOptions {
-  serverUrl: string;
-  serverPattern: string | RegExp | Array<string | RegExp>;
+declare module Instagram {
+  interface InstagramOptions extends PluginOptions, ProviderOptions {
+    serverUrl: string;
+    serverPattern: string | RegExp | Array<string | RegExp>;
+  }
 }
 
-export default class Instagram extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<InstagramOptions>);
+declare class Instagram extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Instagram.InstagramOptions>);
 }
 
+export = Instagram;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Instagram, opts: Partial<InstagramOptions>): Uppy;
+    use(pluginClass: typeof Instagram, opts: Partial<Instagram.InstagramOptions>): Uppy;
   }
 }

+ 10 - 6
packages/@uppy/progress-bar/types/index.d.ts

@@ -1,16 +1,20 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface ProgressBarOptions extends PluginOptions {
-  hideAfterFinish: boolean;
-  fixed: boolean;
+declare module ProgressBar {
+  interface ProgressBarOptions extends PluginOptions {
+    hideAfterFinish: boolean;
+    fixed: boolean;
+  }
 }
 
-export default class ProgressBar extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<ProgressBarOptions>);
+declare class ProgressBar extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<ProgressBar.ProgressBarOptions>);
 }
 
+export = ProgressBar;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof ProgressBar, opts: Partial<ProgressBarOptions>): Uppy;
+    use(pluginClass: typeof ProgressBar, opts: Partial<ProgressBar.ProgressBarOptions>): Uppy;
   }
 }

+ 8 - 4
packages/@uppy/redux-dev-tools/types/index.d.ts

@@ -1,14 +1,18 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface ReduxDevToolsOptions extends PluginOptions {
+declare module ReduxDevTools {
+  interface ReduxDevToolsOptions extends PluginOptions {
+  }
 }
 
-export default class ReduxDevTools extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<ReduxDevToolsOptions>);
+declare class ReduxDevTools extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<ReduxDevTools.ReduxDevToolsOptions>);
 }
 
+export = ReduxDevTools;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof ReduxDevTools, opts: Partial<ReduxDevToolsOptions>): Uppy;
+    use(pluginClass: typeof ReduxDevTools, opts: Partial<ReduxDevTools.ReduxDevToolsOptions>): Uppy;
   }
 }

+ 11 - 7
packages/@uppy/status-bar/types/index.d.ts

@@ -1,17 +1,21 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface StatusBarOptions extends PluginOptions {
-  showProgressDetails: boolean;
-  hideUploadButton: boolean;
-  hideAfterFinish: boolean;
+declare module StatusBar {
+  export interface StatusBarOptions extends PluginOptions {
+    showProgressDetails: boolean;
+    hideUploadButton: boolean;
+    hideAfterFinish: boolean;
+  }
 }
 
-export default class StatusBar extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<StatusBarOptions>);
+declare class StatusBar extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<StatusBar.StatusBarOptions>);
 }
 
+export = StatusBar;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof StatusBar, opts: Partial<StatusBarOptions>): Uppy;
+    use(pluginClass: typeof StatusBar, opts: Partial<StatusBar.StatusBarOptions>): Uppy;
   }
 }

+ 2 - 1
packages/@uppy/store-default/types/index.d.ts

@@ -7,4 +7,5 @@ declare class DefaultStore implements Store {
   subscribe(listener: any): () => void;
 }
 
-export default function createDefaultStore(): DefaultStore;
+declare function createDefaultStore(): DefaultStore;
+export = createDefaultStore;

+ 8 - 1
packages/@uppy/store-redux/types/index.d.ts

@@ -14,6 +14,13 @@ declare class ReduxStore implements Store {
   subscribe(listener: any): () => void;
 }
 
-export default function createReduxStore(opts: ReduxStoreOptions): ReduxStore;
 export const reducer: Reducer<object>;
 export const middleware: Middleware;
+// Redux action name.
+export const STATE_UPDATE: string;
+
+// Typescript forbids the next two lines with the following error message:
+// "An export assignment cannot be used in a module with other exported elements."
+
+// declare function createReduxStore(opts: ReduxStoreOptions): ReduxStore;
+// export = createReduxStore;

+ 9 - 5
packages/@uppy/thumbnail-generator/types/index.d.ts

@@ -1,15 +1,19 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface ThumbnailGeneratorOptions extends PluginOptions {
-  thumbnailWidth: number;
+declare module ThumbnailGenerator {
+  interface ThumbnailGeneratorOptions extends PluginOptions {
+    thumbnailWidth: number;
+  }
 }
 
-export default class ThumbnailGenerator extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<ThumbnailGeneratorOptions>);
+declare class ThumbnailGenerator extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<ThumbnailGenerator.ThumbnailGeneratorOptions>);
 }
 
+export = ThumbnailGenerator;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof ThumbnailGenerator, opts: Partial<ThumbnailGeneratorOptions>): Uppy;
+    use(pluginClass: typeof ThumbnailGenerator, opts: Partial<ThumbnailGenerator.ThumbnailGeneratorOptions>): Uppy;
   }
 }

+ 28 - 24
packages/@uppy/transloadit/types/index.d.ts

@@ -1,36 +1,40 @@
 import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
 
-export interface AssemblyParameters {
-  auth: { key: string };
-  template_id?: string;
-  steps?: { [step: string]: object };
-  notify_url?: string;
-  fields?: { [name: string]: number | string };
-}
+declare module Transloadit {
+  interface AssemblyParameters {
+    auth: { key: string };
+    template_id?: string;
+    steps?: { [step: string]: object };
+    notify_url?: string;
+    fields?: { [name: string]: number | string };
+  }
 
-export interface AssemblyOptions {
-  params: AssemblyParameters;
-  fields?: { [name: string]: number | string };
-  signature?: string;
-}
+  interface AssemblyOptions {
+    params: AssemblyParameters;
+    fields?: { [name: string]: number | string };
+    signature?: string;
+  }
 
-export interface TransloaditOptions extends PluginOptions {
-  params: AssemblyParameters;
-  signature: string;
-  service: string;
-  waitForEncoding: boolean;
-  waitForMetadata: boolean;
-  importFromUploadURLs: boolean;
-  alwaysRunAssembly: boolean;
-  getAssemblyOptions: (file: UppyFile) => AssemblyOptions | Promise<AssemblyOptions>;
+  interface TransloaditOptions extends PluginOptions {
+    params: AssemblyParameters;
+    signature: string;
+    service: string;
+    waitForEncoding: boolean;
+    waitForMetadata: boolean;
+    importFromUploadURLs: boolean;
+    alwaysRunAssembly: boolean;
+    getAssemblyOptions: (file: UppyFile) => AssemblyOptions | Promise<AssemblyOptions>;
+  }
 }
 
-export default class Transloadit extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<TransloaditOptions>);
+declare class Transloadit extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Transloadit.TransloaditOptions>);
 }
 
+export = Transloadit;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Transloadit, opts: Partial<TransloaditOptions>): Uppy;
+    use(pluginClass: typeof Transloadit, opts: Partial<Transloadit.TransloaditOptions>): Uppy;
   }
 }

+ 14 - 10
packages/@uppy/tus/types/index.d.ts

@@ -1,20 +1,24 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface TusOptions extends PluginOptions {
-  limit: number;
-  endpoint: string;
-  uploadUrl: string;
-  useFastRemoteRetry: boolean;
-  resume: boolean;
-  autoRetry: boolean;
+declare module Tus {
+  export interface TusOptions extends PluginOptions {
+    limit: number;
+    endpoint: string;
+    uploadUrl: string;
+    useFastRemoteRetry: boolean;
+    resume: boolean;
+    autoRetry: boolean;
+  }
 }
 
-export default class Tus extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<TusOptions>);
+declare class Tus extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Tus.TusOptions>);
 }
 
+export = Tus;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Tus, opts: Partial<TusOptions>): Uppy;
+    use(pluginClass: typeof Tus, opts: Partial<Tus.TusOptions>): Uppy;
   }
 }

+ 10 - 6
packages/@uppy/url/types/index.d.ts

@@ -1,16 +1,20 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface UrlOptions extends PluginOptions {
-  serverUrl: string;
-  // TODO inherit from ProviderOptions
+declare module Url {
+  export interface UrlOptions extends PluginOptions {
+    serverUrl: string;
+    // TODO inherit from ProviderOptions
+  }
 }
 
-export default class Url extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<UrlOptions>);
+declare class Url extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<Url.UrlOptions>);
 }
 
+export = Url;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof Url, opts: Partial<UrlOptions>): Uppy;
+    use(pluginClass: typeof Url, opts: Partial<Url.UrlOptions>): Uppy;
   }
 }

+ 18 - 14
packages/@uppy/xhr-upload/types/index.d.ts

@@ -1,24 +1,28 @@
 import { Plugin, PluginOptions, Uppy } from '@uppy/core';
 
-export interface XHRUploadOptions extends PluginOptions {
-  limit: string;
-  bundle: boolean;
-  formData: FormData;
-  headers: any;
-  metaFields: string[];
-  fieldName: string;
-  timeout: number;
-  responseUrlFieldName: string;
-  endpoint: string;
-  method: 'GET' | 'POST' | 'HEAD';
+declare module XHRUpload {
+  export interface XHRUploadOptions extends PluginOptions {
+    limit: string;
+    bundle: boolean;
+    formData: FormData;
+    headers: any;
+    metaFields: string[];
+    fieldName: string;
+    timeout: number;
+    responseUrlFieldName: string;
+    endpoint: string;
+    method: 'GET' | 'POST' | 'HEAD';
+  }
 }
 
-export default class XHRUpload extends Plugin {
-  constructor(uppy: Uppy, opts: Partial<XHRUploadOptions>);
+declare class XHRUpload extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<XHRUpload.XHRUploadOptions>);
 }
 
+export = XHRUpload;
+
 declare module '@uppy/core' {
   export interface Uppy {
-    use(pluginClass: typeof XHRUpload, opts: Partial<XHRUploadOptions>): Uppy;
+    use(pluginClass: typeof XHRUpload, opts: Partial<XHRUpload.XHRUploadOptions>): Uppy;
   }
 }