Merge pull request #28385 from romain-faust/imagemin-svgo

[@types/imagemin-svgo] Add type definitions
This commit is contained in:
Daniel Rosenwasser
2018-08-25 13:44:12 -07:00
committed by GitHub
4 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import imagemin = require('imagemin');
import imageminSvgo = require('imagemin-svgo');
imagemin(['*.svg'], {
plugins: [
imageminSvgo(),
imageminSvgo({ floatPrecision: 2 })
]
});

16
types/imagemin-svgo/index.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Type definitions for imagemin-svgo 7.0
// Project: https://github.com/imagemin/imagemin-svgo#readme
// Definitions by: Romain Faust <https://github.com/romain-faust>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import { Plugin } from 'imagemin';
import { Options as SvgoOptions } from 'svgo';
declare function imageminSvgo(options?: imageminSvgo.Options): Plugin;
declare namespace imageminSvgo {
type Options = SvgoOptions;
}
export = imageminSvgo;

View 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",
"imagemin-svgo-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }