forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3-uploader.d.ts
66 lines (58 loc) · 1.72 KB
/
s3-uploader.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
64
65
66
// Type definitions for s3-uploader
// Project: https://www.npmjs.com/package/s3-uploader
// Definitions by: COLSA Corporation <http://www.colsa.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/)
declare module "s3-uploader" {
export = Upload;
}
interface S3UploaderVersion {
original?: boolean;
suffix?: string;
quality?: number;
maxWidth?: number;
maxHeight?: number;
}
interface S3UploaderOptions {
awsAccessKeyId?: string;
awsSecretAccessKey?: string;
awsBucketRegion?: string;
awsBucketPath?: string;
awsBucketAcl?: string;
awsMaxRetries?: number;
awsHttpTimeout?: number;
resizeQuality?: number;
returnExif?: boolean;
tmpDir?: string;
workers?: number;
url?: string;
versions?: S3UploaderVersion;
}
declare class Meta {
public format: string;
public fileSize: string;
public imageSize: imageSize;
public orientation: string;
public colorSpace: string;
public compression: string;
public quallity: string;
}
declare class imageSize {
public height: number;
public width: number;
}
declare class image {
public etag: string;
public format: string;
public height: number;
public original: boolean;
public path: string;
public size: string;
public src: string;
public url: string;
public width: number;
}
declare class Upload {
public constructor(awsBucketName: string, opts: S3UploaderOptions);
public upload(src: string, opts?: S3UploaderOptions, cb?: (err: string, images: image[], meta: Meta) => void): void;
}