forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imagemagick-native.d.ts
117 lines (110 loc) · 3.39 KB
/
imagemagick-native.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Type definitions for imagemagick-native 1.7.0
// Project: https://www.npmjs.org/package/imagemagick-native
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "imagemagick-native" {
import stream = require('stream');
export module streams {
export function convert(options: IStreamConvertOptions): stream.Transform;
}
function convert(options: IConvertOptions): Buffer;
function convert(options: IConvertOptions, callback: (err: any, result: Buffer) => void): void;
function identify(options: IIdentifyOptions): IIdentifyResult;
function identify(options: IIdentifyOptions, callback: (err: any, result: IIdentifyResult) => void): void;
function quantizeColors(options: IQuantizeColorsOptions): IQuantizeColorsItem[];
function composite(options: ICompositeOptions): Buffer;
function composite(options: ICompositeOptions, callback: (err: any, result: Buffer) => void): void;
function getConstPixels(options: IConstPixelsOptions): IConstPixelsItem[];
function quantumDepth(): number;
function version(): string;
export interface IStreamConvertOptions {
srcFormat?: string;
quality?: number;
trim?: boolean;
trimFuzz?: number;
width?: number;
height?: number;
density?: number;
resizeStyle?: string;
gravity?: string;
format?: string;
filter?: string;
blur?: number;
strip?: boolean;
rotate?: number;
flip?: boolean;
debug?: boolean;
ignoreWarnings?: boolean;
}
export interface IConvertOptions {
srcData: Buffer;
srcFormat?: string;
quality?: number;
trim?: boolean;
trimFuzz?: number;
width?: number;
height?: number;
density?: number;
resizeStyle?: string;
gravity?: string;
format?: string;
filter?: string;
blur?: number;
strip?: boolean;
rotate?: number;
flip?: boolean;
debug?: boolean;
ignoreWarnings?: boolean;
}
export interface IIdentifyOptions {
srcData: Buffer;
debug?: boolean;
ignoreWarnings?: boolean;
}
export interface IIdentifyResult {
format: string;
width: number;
height: number;
depth: number;
density : {
width : number;
height : number;
};
exif: {
orientation: number; // 0 if none exists or e.g. 3 (portrait iPad pictures)
};
}
export interface IQuantizeColorsOptions {
srcData: Buffer;
colors: number;
debug?: boolean;
ignoreWarnings?: boolean;
}
export interface IQuantizeColorsItem {
r: number;
g: number;
b: number;
hex: string;
}
export interface ICompositeOptions {
srcData: Buffer;
compositeData: Buffer;
gravity?: string;
debug?: boolean;
ignoreWarnings?: boolean;
}
export interface IConstPixelsOptions {
srcData: Buffer;
x: number;
y: number;
columns: number;
rows: number;
}
export interface IConstPixelsItem {
red: number;
green: number;
blue: number;
opacity: number;
}
}