ソースを参照

Use the UppyFile type where relevant.

Renée Kooi 6 年 前
コミット
7a639e1610

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

@@ -1,4 +1,4 @@
-import { Plugin, PluginOptions, Uppy } from '@uppy/core';
+import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
 
 export interface AwsS3Part {
   PartNumber: number;
@@ -8,7 +8,7 @@ export interface AwsS3Part {
 
 export interface AwsS3MultipartOptions extends PluginOptions {
   serverUrl: string;
-  createMultipartUpload(file: object): Promise<{uploadId: string, key: string}>;
+  createMultipartUpload(file: UppyFile): Promise<{uploadId: string, key: string}>;
   listParts(opts: {uploadId: string, key: string}): Promise<AwsS3Part>;
   prepareUploadPart(partData: {uploadId: string, key: string, body: Blob, number: number}): Promise<{url: string}>;
   abortMultipartUpload(opts: {uploadId: string, key: string}): Promise<void>;

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

@@ -1,4 +1,4 @@
-import { Plugin, PluginOptions, Uppy } from '@uppy/core';
+import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
 
 export interface AwsS3UploadParameters {
   method?: string;
@@ -9,7 +9,7 @@ export interface AwsS3UploadParameters {
 
 export interface AwsS3Options extends PluginOptions {
   serverUrl: string;
-  getUploadParameters(file: object): Promise<AwsS3UploadParameters>;
+  getUploadParameters(file: UppyFile): Promise<AwsS3UploadParameters>;
   timeout: number;
   limit: number;
 }

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

@@ -1,4 +1,4 @@
-import { Plugin, PluginOptions, Uppy } from '@uppy/core';
+import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
 
 export interface AssemblyOptions {
   params: object;
@@ -14,7 +14,7 @@ export interface TransloaditOptions extends PluginOptions {
   waitForMetadata: boolean;
   importFromUploadURLs: boolean;
   alwaysRunAssembly: boolean;
-  getAssemblyOptions: (file: object) => AssemblyOptions | Promise<AssemblyOptions>;
+  getAssemblyOptions: (file: UppyFile) => AssemblyOptions | Promise<AssemblyOptions>;
 }
 
 export default class Transloadit extends Plugin {

+ 5 - 3
packages/@uppy/utils/types/index.d.ts

@@ -1,3 +1,5 @@
+import { UppyFile } from '@uppy/core';
+
 declare module '@uppy/utils/lib/Translator' {
   export interface TranslatorOptions {
     locale: {
@@ -32,7 +34,7 @@ declare module '@uppy/utils/lib/emitSocketProgress' {
     bytesTotal: number;
   }
 
-  export default function emitSocketProgress(uploader: object, progressData: ProgressData, file: object);
+  export default function emitSocketProgress(uploader: object, progressData: ProgressData, file: UppyFile);
 }
 
 declare module '@uppy/utils/lib/findAllDOMElements' {
@@ -44,7 +46,7 @@ declare module '@uppy/utils/lib/findDOMElement' {
 }
 
 declare module '@uppy/utils/lib/generateFileID' {
-  export default function generateFileID(file: object): string;
+  export default function generateFileID(file: UppyFile): string;
 }
 
 declare module '@uppy/utils/lib/getBytesRemaining' {
@@ -60,7 +62,7 @@ declare module '@uppy/utils/lib/getFileNameAndExtension' {
 }
 
 declare module '@uppy/utils/lib/getFileType' {
-  export default function getFileType(file: object): string?;
+  export default function getFileType(file: UppyFile): string?;
 }
 
 declare module '@uppy/utils/lib/getFileTypeExtension' {