Files
DefinitelyTyped/types/images/index.d.ts
DingWeizhe 76c82115ad [fluent-ffmpeg] support es6 import syntax & conform to tdslint (#16036)
* support es6 import syntax

* support es6 import syntax

* add author

* test import syntax to es6

* add tslint config

* tslint: Interface has only a call signature

* tslint: ban-types

* tslint: no-misused-new

* tslint: semicolon

* tslint: TypeScript compile error: Cannot find name 'object'.

* tslint: unified-signatures

* tslint: disable unified-signatures, parameter name is different

* tslint: object-literal-shorthand

* tslint: one-variable-per-declaration

* tslint: dt-header

* tslint: no-single-declare-module

* type definitions for images 2.2
2017-05-04 18:13:03 -07:00

44 lines
1.9 KiB
TypeScript

// Type definitions for images 2.2
// Project: https://github.com/zhangyuanwei/node-images
// Definitions by: Ding Weizhe <https://github.com/DingWeizhe/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace images {
interface ImagesConfig {
[key: string]: any;
}
type SupportType = "png" | "jpg" | "gif" | "bmp" | "raw" | "webp";
class ImagesStatic {
fill(red: number, green: number, blue: number, alpha?: number): ImagesStatic;
draw(image: ImagesStatic, x: number, y: number): ImagesStatic;
loadFromBuffer(buffer: Buffer): ImagesStatic;
encode(type: string, config?: ImagesConfig): void;
save(file: string, type?: SupportType, config?: ImagesConfig): void;
save(file: string, config?: ImagesConfig): void;
size(): { width: number, height: number };
size(width: number, height?: number): ImagesStatic;
resize(width: number, height?: number, filter?: string): ImagesStatic;
resize(width: number, height: number, filter?: string): ImagesStatic;
width(): number;
width(width: number): ImagesStatic;
height(): number;
height(height: number): ImagesStatic;
setLimit(width: number, height: number): void;
setGCThreshold(value: number): void;
getUsedMemory(): void;
gc(): void;
}
}
/* tslint:disable:unified-signatures */
declare function images(file: string): images.ImagesStatic;
declare function images(width: number, height: number): images.ImagesStatic;
declare function images(buffer: Buffer, start?: number, end?: number): images.ImagesStatic;
declare function images(image: images.ImagesStatic): images.ImagesStatic;
declare function images(image: images.ImagesStatic, x: number, y: number, width: number, height: number): images.ImagesStatic;
/* tslint:enable:unified-signatures */
export = images;