mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 06:17:04 +00:00
[@types/imagemin] Add type definitions
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import * as Imagemin from 'imagemin';
|
||||
|
||||
const input = ['fileA.jpg', 'fileB.png'];
|
||||
const output = 'output';
|
||||
const options = { plugins: [] };
|
||||
|
||||
Imagemin(input);
|
||||
Imagemin(input, output);
|
||||
Imagemin(input, options);
|
||||
Imagemin(input, output, options);
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// Type definitions for imagemin 6.0
|
||||
// Project: https://github.com/imagemin/imagemin#readme
|
||||
// Definitions by: Romain Faust <https://github.com/romain-faust>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function imagemin(input: string[], outputOrOptions?: string | imagemin.Options, options?: imagemin.Options): Promise<imagemin.Result[]>;
|
||||
|
||||
declare namespace imagemin {
|
||||
function buffer(buffer: Buffer, options?: Options): Promise<Buffer>;
|
||||
|
||||
type Plugin = (input: Buffer) => Promise<Buffer>;
|
||||
|
||||
interface Options {
|
||||
plugins: Plugin[];
|
||||
}
|
||||
|
||||
interface Result {
|
||||
data: Buffer;
|
||||
path: string;
|
||||
}
|
||||
}
|
||||
|
||||
export = imagemin;
|
||||
@@ -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",
|
||||
"imagemin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user