mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
@uppy/robodog: fix types
This commit is contained in:
parent
2f791c1747
commit
d9ff0030a9
8 changed files with 70 additions and 59 deletions
2
packages/@uppy/dropbox/types/index.d.ts
vendored
2
packages/@uppy/dropbox/types/index.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
|
||||
import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
|
||||
|
||||
interface DropboxOptions extends PluginOptions, PublicProviderOptions {
|
||||
export interface DropboxOptions extends PluginOptions, PublicProviderOptions {
|
||||
replaceTargetContent?: boolean
|
||||
target?: PluginTarget
|
||||
title?: string
|
||||
|
|
|
|||
2
packages/@uppy/facebook/types/index.d.ts
vendored
2
packages/@uppy/facebook/types/index.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
|
||||
import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
|
||||
|
||||
interface FacebookOptions extends PluginOptions, PublicProviderOptions {
|
||||
export interface FacebookOptions extends PluginOptions, PublicProviderOptions {
|
||||
replaceTargetContent?: boolean
|
||||
target?: PluginTarget
|
||||
title?: string
|
||||
|
|
|
|||
2
packages/@uppy/form/types/index.d.ts
vendored
2
packages/@uppy/form/types/index.d.ts
vendored
|
|
@ -1,6 +1,6 @@
|
|||
import type { PluginOptions, PluginTarget, BasePlugin } from '@uppy/core'
|
||||
|
||||
interface FormOptions extends PluginOptions {
|
||||
export interface FormOptions extends PluginOptions {
|
||||
replaceTargetContent?: boolean
|
||||
target?: PluginTarget
|
||||
resultName?: string
|
||||
|
|
|
|||
2
packages/@uppy/google-drive/types/index.d.ts
vendored
2
packages/@uppy/google-drive/types/index.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
|
||||
import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
|
||||
|
||||
interface GoogleDriveOptions extends PluginOptions, PublicProviderOptions {
|
||||
export interface GoogleDriveOptions extends PluginOptions, PublicProviderOptions {
|
||||
replaceTargetContent?: boolean
|
||||
target?: PluginTarget
|
||||
title?: string
|
||||
|
|
|
|||
2
packages/@uppy/instagram/types/index.d.ts
vendored
2
packages/@uppy/instagram/types/index.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
|
||||
import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
|
||||
|
||||
interface InstagramOptions extends PluginOptions, PublicProviderOptions {
|
||||
export interface InstagramOptions extends PluginOptions, PublicProviderOptions {
|
||||
replaceTargetContent?: boolean
|
||||
target?: PluginTarget
|
||||
title?: string
|
||||
|
|
|
|||
2
packages/@uppy/onedrive/types/index.d.ts
vendored
2
packages/@uppy/onedrive/types/index.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
|
||||
import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
|
||||
|
||||
interface OneDriveOptions extends PluginOptions, PublicProviderOptions {
|
||||
export interface OneDriveOptions extends PluginOptions, PublicProviderOptions {
|
||||
replaceTargetContent?: boolean
|
||||
target?: PluginTarget
|
||||
title?: string
|
||||
|
|
|
|||
113
packages/@uppy/robodog/types/index.d.ts
vendored
113
packages/@uppy/robodog/types/index.d.ts
vendored
|
|
@ -1,55 +1,66 @@
|
|||
import Uppy = require('@uppy/core');
|
||||
import Transloadit = require('@uppy/transloadit')
|
||||
import Dashboard = require('@uppy/dashboard')
|
||||
import Dropbox = require('@uppy/dropbox')
|
||||
import GoogleDrive = require('@uppy/google-drive')
|
||||
import Instagram = require('@uppy/instagram');
|
||||
import Url = require('@uppy/url')
|
||||
import Webcam = require('@uppy/webcam')
|
||||
import Onedrive = require('@uppy/onedrive')
|
||||
import Facebook = require('@uppy/facebook');
|
||||
import Form = require('@uppy/form')
|
||||
import type { Uppy, UppyOptions, UploadResult } from '@uppy/core'
|
||||
import type { Assembly, Result, TransloaditOptions } from '@uppy/transloadit'
|
||||
import type { DashboardOptions } from '@uppy/dashboard'
|
||||
import type { DropboxOptions } from '@uppy/dropbox'
|
||||
import type { GoogleDriveOptions } from '@uppy/google-drive'
|
||||
import type { InstagramOptions } from '@uppy/instagram'
|
||||
import type { UrlOptions } from '@uppy/url'
|
||||
import type { WebcamOptions } from '@uppy/webcam'
|
||||
import type { OneDriveOptions } from '@uppy/onedrive'
|
||||
import type { FacebookOptions } from '@uppy/facebook'
|
||||
import type { FormOptions } from '@uppy/form'
|
||||
|
||||
declare namespace Robodog {
|
||||
type Provider = 'dropbox' | 'google-drive' | 'instagram' | 'url' | 'webcam' | 'onedrive' | 'facebook'
|
||||
type Provider =
|
||||
| 'dropbox'
|
||||
| 'google-drive'
|
||||
| 'instagram'
|
||||
| 'url'
|
||||
| 'webcam'
|
||||
| 'onedrive'
|
||||
| 'facebook'
|
||||
|
||||
interface RobodogOptionsBase extends Uppy.UppyOptions {
|
||||
providers?: Provider[]
|
||||
companionUrl?: string,
|
||||
companionAllowedHosts?: string | RegExp | Array<string | RegExp>
|
||||
companionHeaders?: Record<string, string>,
|
||||
dropbox?: Dropbox.DropboxOptions
|
||||
googleDrive?: GoogleDrive.GoogleDriveOptions
|
||||
instagram?: Instagram.InstagramOptions
|
||||
url?: Url.UrlOptions
|
||||
webcam?: Webcam.WebcamOptions,
|
||||
onedrive?: Onedrive.OneDriveOptions,
|
||||
facebook?: Facebook.FacebookOptions
|
||||
}
|
||||
|
||||
type RobodogOptions = RobodogOptionsBase & Transloadit.TransloaditOptions & Dashboard.DashboardOptions
|
||||
|
||||
interface RobodogTransloaditResult extends Transloadit.Result {
|
||||
assemblyId: string,
|
||||
stepName: string
|
||||
}
|
||||
|
||||
interface RobodogResult extends Uppy.UploadResult {
|
||||
transloadit: Transloadit.Assembly[],
|
||||
results?: RobodogTransloaditResult[]
|
||||
}
|
||||
|
||||
function pick(opts: RobodogOptions): Promise<RobodogResult>;
|
||||
|
||||
type RobodogFormOptions = RobodogOptions
|
||||
& Pick<Form.FormOptions, 'submitOnSuccess' | 'triggerUploadOnSubmit'>
|
||||
& { modal?: boolean, statusbar?: string }
|
||||
|
||||
function form(target: string, opts: RobodogFormOptions): Uppy.Uppy
|
||||
|
||||
function upload(files: (File | Blob & { name: string })[], opts: RobodogOptions): Promise<RobodogResult>;
|
||||
|
||||
function dashboard(target: string, opts: RobodogOptions): Uppy.Uppy;
|
||||
interface RobodogOptionsBase extends UppyOptions {
|
||||
providers?: Provider[];
|
||||
companionUrl?: string;
|
||||
companionAllowedHosts?: string | RegExp | Array<string | RegExp>;
|
||||
companionHeaders?: Record<string, string>;
|
||||
dropbox?: DropboxOptions;
|
||||
googleDrive?: GoogleDriveOptions;
|
||||
instagram?: InstagramOptions;
|
||||
url?: UrlOptions;
|
||||
webcam?: WebcamOptions;
|
||||
onedrive?: OneDriveOptions;
|
||||
facebook?: FacebookOptions;
|
||||
}
|
||||
|
||||
export = Robodog;
|
||||
export type RobodogOptions = RobodogOptionsBase & TransloaditOptions & DashboardOptions;
|
||||
|
||||
interface RobodogTransloaditResult extends Result {
|
||||
assemblyId: string;
|
||||
stepName: string;
|
||||
}
|
||||
|
||||
interface RobodogResult extends UploadResult {
|
||||
transloadit: Assembly[];
|
||||
results?: RobodogTransloaditResult[];
|
||||
}
|
||||
|
||||
export function pick(opts: RobodogOptions): Promise<RobodogResult>;
|
||||
|
||||
type RobodogFormOptions =
|
||||
RobodogOptions &
|
||||
Pick<FormOptions, 'submitOnSuccess' | 'triggerUploadOnSubmit'> & {
|
||||
modal?: boolean;
|
||||
statusbar?: string;
|
||||
};
|
||||
|
||||
export function form(target: string, opts: RobodogFormOptions): Uppy;
|
||||
|
||||
export function upload(
|
||||
files: (File | (Blob & { name: string }))[],
|
||||
opts: RobodogOptions
|
||||
): Promise<RobodogResult>;
|
||||
|
||||
export function dashboard(target: string, opts: RobodogOptions): Uppy;
|
||||
|
||||
export const VERSION: string
|
||||
|
|
|
|||
4
packages/@uppy/transloadit/types/index.d.ts
vendored
4
packages/@uppy/transloadit/types/index.d.ts
vendored
|
|
@ -23,7 +23,7 @@ import TransloaditLocale from './generatedLocale'
|
|||
meta: Record<string, any>
|
||||
}
|
||||
|
||||
interface Result extends FileInfo {
|
||||
export interface Result extends FileInfo {
|
||||
cost: number,
|
||||
execTime: number,
|
||||
queue: string,
|
||||
|
|
@ -113,7 +113,7 @@ interface TransloaditOptionsBase extends PluginOptions {
|
|||
}
|
||||
|
||||
// Either have a getAssemblyOptions() that returns an AssemblyOptions, *or* have them embedded in the options
|
||||
type TransloaditOptions = TransloaditOptionsBase &
|
||||
export type TransloaditOptions = TransloaditOptionsBase &
|
||||
(
|
||||
| {
|
||||
getAssemblyOptions?: (file: UppyFile) => AssemblyOptions | Promise<AssemblyOptions>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue