node-upload-api
Advanced tools
+10
-2
| import Koa from 'koa'; | ||
| interface UploadApiOptions { | ||
| import { Fields, Files } from 'formidable'; | ||
| interface UploadedResult { | ||
| error: any; | ||
| files: Files; | ||
| fields: Fields; | ||
| } | ||
| interface UploadApiOptions<Ctx> { | ||
| uri?: string; | ||
| encoding?: string; | ||
@@ -12,2 +19,3 @@ uploadDir?: string; | ||
| hash?: string | false; | ||
| response?: (cx: Ctx, result: UploadedResult) => any; | ||
| fileWriteStreamHandler?: () => void; | ||
@@ -18,3 +26,3 @@ multiples?: boolean; | ||
| } | ||
| declare function uploadApi<Ctx>(options: UploadApiOptions): (cx: Koa.Context & Ctx, next: Koa.Next) => Promise<void>; | ||
| declare function uploadApi<Ctx>(options: UploadApiOptions<Ctx>): (cx: Koa.Context & Ctx, next: Koa.Next) => Promise<void>; | ||
| export default uploadApi; | ||
@@ -21,0 +29,0 @@ /** |
+1
-1
| { | ||
| "name": "node-upload-api", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
2795
8.54%84
10.53%