Files
DefinitelyTyped/types/svgo/svgo-tests.ts
Gilad Gray 5f4d4c1865 update SVGO types for 1.0 (#23139)
* update SVGO types for 1.0

* optional info
2018-01-23 14:42:19 -08:00

28 lines
674 B
TypeScript

import SVGO = require("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 = new SVGO({
plugins: [],
datauri: "enc",
floatPrecision: 2,
full: true,
js2svg: {
indent: 2,
pretty: true,
},
svg2js: {
trim: true,
}
});
// SVGO instance methods
svgo.optimize(`<?xml version="1.0" encoding="utf-8"?><svg></svg>`, { path: "filepath" })
.then(result => result.data, error => error);