mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Add gulp-image-resize types. (#24894)
This commit is contained in:
40
types/gulp-image-resize/gulp-image-resize-tests.ts
Normal file
40
types/gulp-image-resize/gulp-image-resize-tests.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import resize = require('gulp-image-resize');
|
||||
|
||||
resize(); // $ExpectType Transform
|
||||
resize(undefined);
|
||||
resize("1"); // $ExpectError
|
||||
|
||||
resize({ // $ExpectType Transform
|
||||
width: 100,
|
||||
height: 100,
|
||||
crop: true,
|
||||
upscale: false
|
||||
});
|
||||
|
||||
resize({
|
||||
widt: 5 // $ExpectError
|
||||
});
|
||||
|
||||
resize({
|
||||
width: undefined,
|
||||
height: undefined,
|
||||
upscale: undefined,
|
||||
crop: undefined,
|
||||
gravity: undefined,
|
||||
quality: undefined,
|
||||
format: undefined,
|
||||
filter: undefined,
|
||||
sharpen: undefined,
|
||||
samplingFactor: undefined,
|
||||
noProfile: undefined,
|
||||
interlace: undefined,
|
||||
imageMagick: undefined,
|
||||
background: undefined,
|
||||
flatten: undefined,
|
||||
percentage: undefined,
|
||||
cover: undefined
|
||||
});
|
||||
|
||||
resize({ format: 'jpeg' });
|
||||
resize({ width: 100 });
|
||||
resize({ percentage: 50 });
|
||||
38
types/gulp-image-resize/index.d.ts
vendored
Normal file
38
types/gulp-image-resize/index.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Type definitions for gulp-image-resize 0.13
|
||||
// Project: https://github.com/scalableminds/gulp-image-resize
|
||||
// Definitions by: Aankhen <https://github.com/Aankhen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as stream from "stream";
|
||||
import * as gm from "gm";
|
||||
|
||||
export = GulpImageResize;
|
||||
|
||||
declare function GulpImageResize(options?: GulpImageResize.Options): stream.Transform;
|
||||
|
||||
declare namespace GulpImageResize {
|
||||
type SamplingFactor = [number, number];
|
||||
|
||||
interface Options {
|
||||
width?: number;
|
||||
height?: number;
|
||||
upscale?: boolean;
|
||||
crop?: boolean;
|
||||
gravity?: gm.GravityDirection;
|
||||
quality?: number;
|
||||
format?: string;
|
||||
filter?: gm.FilterType;
|
||||
sharpen?: boolean | string;
|
||||
samplingFactor?: SamplingFactor;
|
||||
noProfile?: boolean;
|
||||
interlace?: boolean;
|
||||
imageMagick?: boolean;
|
||||
background?: string;
|
||||
flatten?: boolean;
|
||||
percentage?: number;
|
||||
cover?: boolean;
|
||||
}
|
||||
}
|
||||
23
types/gulp-image-resize/tsconfig.json
Normal file
23
types/gulp-image-resize/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gulp-image-resize-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/gulp-image-resize/tslint.json
Normal file
1
types/gulp-image-resize/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user