forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imagemagick.d.ts
59 lines (50 loc) · 2.05 KB
/
imagemagick.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
// Type definitions for imagemagick
// Project: http://github.com/rsms/node-imagemagick
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/imagemagick.d.ts
/// <reference path="../node/node.d.ts" />
declare module "imagemagick" {
import child_process = require("child_process");
export function identify(path: string, callback: (err: Error, features: Features) => void): child_process.ChildProcess;
export function identify(path: any[], callback: (err: Error, result: string) => void): child_process.ChildProcess;
export module identify {
export var path: string;
}
export function readMetadata(path: string, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function convert(args: any, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function convert(args: any, timeout: number, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export module convert {
export var path: string;
}
export function resize(options: Options, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function crop(options: Options, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function resizeArgs(options: Options): ResizeArgs;
export interface Features {
format?: string;
width?: number;
height?: number;
depth?: number;
}
export interface Options {
srcPath?: string; //: null,
srcData?: string; //: null,
srcFormat?: string; //: null,
dstPath?: string; //: null,
quality?: number; //: 0.8,
format?: string; //: 'jpg',
progressive?: boolean; //: false,
colorspace?: any; //: null,
width?: number; //: 0,
height?: number; //: 0,
strip?: boolean; //: true,
filter?: string; //: 'Lagrange',
sharpening?: number; //: 0.2,
customArgs?: any[]; //: [],
timeout?: number; //: 0
}
export interface ResizeArgs {
opt: Options;
args: string[];
}
}