This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
forked from gmenih/multer-s3
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.d.ts
63 lines (58 loc) · 2.72 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import * as AWS from "aws-sdk";
import multer from "multer";
export interface Options {
s3: AWS.S3;
bucket: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, bucket?: string) => void) => void) | string;
key?(req: Express.Request, file: Express.Multer.File, callback: (error: any, key?: string) => void): void;
acl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, acl?: string) => void) => void) | string;
contentType?(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void;
contentDisposition?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, contentDisposition?: string) => void) => void) | string;
metadata?(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: any) => void): void;
cacheControl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, cacheControl?: string) => void) => void) | string;
serverSideEncryption?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, serverSideEncryption?: string) => void) => void) | string;
shouldTransform?(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: any) => void): void;
transforms?: {
id: string;
key(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: any) => void): void;
transform(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: any) => void): void
}[];
}
declare global {
namespace Express {
namespace MulterS3 {
interface File extends Multer.File {
bucket: string;
key: string;
acl: string;
contentType: string;
contentDisposition: null;
storageClass: string;
serverSideEncryption: null;
metadata: any;
location: string;
etag: string;
transforms: {
id: string;
size: string;
bucket: string;
key: string;
acl: string;
contentType: string;
contentDisposition: null;
storageClass: string;
serverSideEncryption: null;
metadata: any;
location: string;
etag: string;
}[];
}
}
}
}
export interface S3StorageTransforms {
(options?: Options): multer.StorageEngine;
AUTO_CONTENT_TYPE(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void;
DEFAULT_CONTENT_TYPE(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string) => void): void;
}
declare const s3Storage: S3StorageTransforms;
export default s3Storage;