-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
50 lines (47 loc) · 998 Bytes
/
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
/// <reference types="node" />
/**
* The configuration object for the convert function.
*/
type ConvertConfig = {
/**
* The image buffer to compress.
*/
buffer: Buffer;
/**
* The maximum width or height of the converted image.
*/
max_dimensions: number;
/**
* The format of the converted image. Defaults to webp.
* @default "webp"
*/
format?: Format;
/**
* The filter to use when resizing the image. Defaults to nearest.
* @default "nearest"
*/
filter?: FilterType;
}
type Format =
| "webp"
| "avif"
| "jpg"
| "png"
| "tiff"
| "gif"
| "bmp"
| "tga";
type FilterType =
| "nearest"
| "lanczos3"
| "gaussian"
| "triangle"
| "catmullrom"
declare module "@alexislours/optimage" {
/**
* Converts an image buffer to a resized and compressed image buffer.
* @param convertConfig The configuration object.
* @returns The compressed image buffer.
*/
export function convert(convertConfig: ConvertConfig): Buffer;
}