mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
52 lines
1001 B
TypeScript
52 lines
1001 B
TypeScript
import svgmin = require("gulp-svgmin");
|
|
import { basename, extname } from "path";
|
|
|
|
// From tests
|
|
|
|
svgmin({ plugins: [] });
|
|
svgmin({ plugins: [{ removeDoctype: false }] });
|
|
svgmin({ plugins: [{ removeDoctype: false }, { removeComments: false }] });
|
|
|
|
// From examples given in README
|
|
|
|
// $ExpectType Transform
|
|
svgmin();
|
|
|
|
// $ExpectType Transform
|
|
svgmin({
|
|
plugins: [{
|
|
removeDoctype: false
|
|
}, {
|
|
removeComments: false
|
|
}, {
|
|
cleanupNumericValues: {
|
|
floatPrecision: 2
|
|
}
|
|
}, {
|
|
convertColors: {
|
|
names2hex: false,
|
|
rgb2hex: false
|
|
}
|
|
}]
|
|
});
|
|
|
|
// $ExpectType Transform
|
|
svgmin({
|
|
js2svg: {
|
|
pretty: true
|
|
}
|
|
});
|
|
|
|
// $ExpectType Transform
|
|
svgmin(function getOptions(file) {
|
|
const prefix = basename(file.relative, extname(file.relative));
|
|
return {
|
|
plugins: [{
|
|
cleanupIDs: {
|
|
prefix: prefix + '-',
|
|
minify: true
|
|
}
|
|
}]
|
|
};
|
|
});
|