mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Add gulp-image types. (#24889)
This commit is contained in:
parent
b46ec025ce
commit
8b636fd9a8
28
types/gulp-image/gulp-image-tests.ts
Normal file
28
types/gulp-image/gulp-image-tests.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import image = require('gulp-image');
|
||||
|
||||
image(false); // $ExpectError
|
||||
|
||||
image(); // $ExpectType Transform
|
||||
image({});
|
||||
image({
|
||||
pngquant: true,
|
||||
optipng: false,
|
||||
zopflipng: true,
|
||||
jpegRecompress: false,
|
||||
mozjpeg: true,
|
||||
guetzli: false,
|
||||
gifsicle: true,
|
||||
svgo: true,
|
||||
concurrent: 10,
|
||||
quiet: true // defaults to false
|
||||
});
|
||||
image({
|
||||
optipng: ['-i 1', '-strip all', '-fix', '-o7', '-force'],
|
||||
pngquant: ['--speed=1', '--force', 256],
|
||||
zopflipng: ['-y', '--lossy_8bit', '--lossy_transparent'],
|
||||
jpegRecompress: ['--strip', '--quality', 'medium', '--min', 40, '--max', 80],
|
||||
mozjpeg: ['-optimize', '-progressive'],
|
||||
guetzli: ['--quality', 85],
|
||||
gifsicle: ['--optimize'],
|
||||
svgo: ['--enable', 'cleanupIDs', '--disable', 'convertColors']
|
||||
});
|
||||
31
types/gulp-image/index.d.ts
vendored
Normal file
31
types/gulp-image/index.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Type definitions for gulp-image 4.3
|
||||
// Project: https://github.com/1000ch/gulp-image#readme
|
||||
// Definitions by: Aankhen <https://github.com/Aankhen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import stream = require("stream");
|
||||
|
||||
export = GulpImage;
|
||||
|
||||
declare function GulpImage(options?: GulpImage.Options): stream.Transform;
|
||||
|
||||
declare namespace GulpImage {
|
||||
type OptimizerSetting = boolean
|
||||
| any[];
|
||||
|
||||
interface Options {
|
||||
pngquant?: OptimizerSetting;
|
||||
optipng?: OptimizerSetting;
|
||||
zopflipng?: OptimizerSetting;
|
||||
jpegRecompress?: OptimizerSetting;
|
||||
mozjpeg?: OptimizerSetting;
|
||||
guetzli?: OptimizerSetting;
|
||||
gifsicle?: OptimizerSetting;
|
||||
svgo?: OptimizerSetting;
|
||||
concurrent?: number;
|
||||
quiet?: boolean;
|
||||
}
|
||||
}
|
||||
23
types/gulp-image/tsconfig.json
Normal file
23
types/gulp-image/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-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/gulp-image/tslint.json
Normal file
1
types/gulp-image/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user