mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-29 01:45:49 +08:00
32 lines
725 B
TypeScript
32 lines
725 B
TypeScript
import SVGO from "svgo";
|
|
|
|
// Various constructor options.
|
|
let svgo = new SVGO();
|
|
svgo = new SVGO({});
|
|
svgo = new SVGO({ plugins: [] });
|
|
svgo = new SVGO({ plugins: [{ cleanupAttrs: {} }] });
|
|
svgo = new SVGO({ datauri: "base64" });
|
|
svgo = new SVGO({ floatPrecision: 2 });
|
|
svgo = new SVGO({ full: true });
|
|
|
|
// SVGO options
|
|
const options: SVGO.Options = {
|
|
plugins: [],
|
|
datauri: "enc",
|
|
floatPrecision: 2,
|
|
full: true,
|
|
js2svg: {
|
|
indent: 2,
|
|
pretty: true,
|
|
},
|
|
svg2js: {
|
|
trim: true,
|
|
}
|
|
};
|
|
|
|
svgo = new SVGO(options);
|
|
|
|
// SVGO instance methods
|
|
svgo.optimize(`<?xml version="1.0" encoding="utf-8"?><svg></svg>`, { path: "filepath" })
|
|
.then(result => result.data, error => error);
|