mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Merge pull request #28284 from romain-faust/imagemin
[@types/imagemin] Add type definitions
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import imagemin = require('imagemin');
|
||||
|
||||
imagemin(['*.png']).then((results: imagemin.Result[]) => { /* ... */ });
|
||||
imagemin(['*.png'], 'dist').then((results: imagemin.Result[]) => { /* ... */ });
|
||||
imagemin(['*.png'], { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ });
|
||||
imagemin(['*.png'], 'dist', { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ });
|
||||
|
||||
imagemin.buffer(Buffer.from([/* ... */])).then((result: Buffer) => { /* ... */ });
|
||||
imagemin.buffer(Buffer.from([/* ... */]), { plugins: [] }).then((result: Buffer) => { /* ... */ });
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// 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: ReadonlyArray<string>, outputOrOptions?: string | imagemin.Options): Promise<imagemin.Result[]>;
|
||||
declare function imagemin(input: ReadonlyArray<string>, output?: string, options?: imagemin.Options): Promise<imagemin.Result[]>;
|
||||
|
||||
declare namespace imagemin {
|
||||
type Plugin = (input: Buffer) => Promise<Buffer>;
|
||||
|
||||
interface Options {
|
||||
plugins: ReadonlyArray<Plugin>;
|
||||
}
|
||||
|
||||
interface Result {
|
||||
data: Buffer;
|
||||
path: string;
|
||||
}
|
||||
|
||||
function buffer(buffer: Buffer, options?: Options): Promise<Buffer>;
|
||||
}
|
||||
|
||||
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