Convert to "export =" everywhere because...

...the *.js source files use "module.exports = " instead of
"export default".
This commit is contained in:
Matthias Bohlen 2018-11-12 12:05:54 +01:00
parent fce440ae9a
commit c8cb89bde0
21 changed files with 275 additions and 195 deletions

View file

@ -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;
}
}

View file

@ -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 };
}
interface AwsS3Options extends PluginOptions {
serverUrl: string;
getUploadParameters(file: UppyFile): Promise<AwsS3UploadParameters>;
timeout: number;
limit: number;
}
}
export interface AwsS3Options extends PluginOptions {
serverUrl: string;
getUploadParameters(file: UppyFile): Promise<AwsS3UploadParameters>;
timeout: number;
limit: number;
declare class AwsS3 extends Plugin {
constructor(uppy: Uppy, opts: Partial<AwsS3.AwsS3Options>);
}
export default class AwsS3 extends Plugin {
constructor(uppy: Uppy, opts: Partial<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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
interface InformerOptions extends PluginOptions {
typeColors: {
[type: string]: Color
};
}
}
export interface InformerOptions extends PluginOptions {
typeColors: {
[type: string]: Color
};
declare class Informer extends Plugin {
constructor(uppy: Uppy, opts: Partial<Informer.InformerOptions>);
}
export default class Informer extends Plugin {
constructor(uppy: Uppy, opts: Partial<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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

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

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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 };
}
interface AssemblyOptions {
params: AssemblyParameters;
fields?: { [name: string]: number | string };
signature?: string;
}
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 interface AssemblyOptions {
params: AssemblyParameters;
fields?: { [name: string]: number | string };
signature?: string;
declare class Transloadit extends Plugin {
constructor(uppy: Uppy, opts: Partial<Transloadit.TransloaditOptions>);
}
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>;
}
export default class Transloadit extends Plugin {
constructor(uppy: Uppy, opts: Partial<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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}