-
Notifications
You must be signed in to change notification settings - Fork 537
/
interfaces.ts
69 lines (60 loc) · 1.35 KB
/
interfaces.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
67
68
69
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import sharp from "sharp";
import { ImageFormatTypes, RequestTypes, StatusCodes } from "./enums";
import { Headers, ImageEdits } from "./types";
export interface ImageHandlerEvent {
path?: string;
queryStringParameters?: {
signature: string;
};
requestContext?: {
elb?: unknown;
};
headers?: Headers;
}
export interface DefaultImageRequest {
bucket?: string;
key: string;
edits?: ImageEdits;
outputFormat?: ImageFormatTypes;
effort?: number;
headers?: Headers;
}
export interface BoundingBox {
height: number;
left: number;
top: number;
width: number;
}
export interface BoxSize {
height: number;
width: number;
}
export interface ImageRequestInfo {
requestType: RequestTypes;
bucket: string;
key: string;
edits?: ImageEdits;
originalImage: Buffer;
headers?: Headers;
contentType?: string;
expires?: string;
lastModified?: string;
cacheControl?: string;
outputFormat?: ImageFormatTypes;
effort?: number;
}
export interface RekognitionCompatibleImage {
imageBuffer: {
data: Buffer;
info: sharp.OutputInfo;
};
format: keyof sharp.FormatEnum;
}
export interface ImageHandlerExecutionResult {
statusCode: StatusCodes;
isBase64Encoded: boolean;
headers: Headers;
body: string;
}