done first version

This commit is contained in:
Konstantin Vulsonov
2018-09-20 00:58:06 +03:00
parent 0e4fd31a5d
commit ff1ce12bb7
13 changed files with 160 additions and 70 deletions

60
src/config.d.ts vendored
View File

@@ -1,19 +1,3 @@
declare type SVGOConfig = [
{
removeAttrs: {
attrs: string
}
},
{
removeViewBox: boolean
}
]
export interface SvgOptimizeConfig {
attrs?: string;
removeViewBox?: boolean
}
export interface SVGOResponse {
data: string;
info: { [propname: string]: string }
@@ -27,5 +11,47 @@ export interface OptimizedResponse {
export interface MainConfig {
source: string;
result: string;
optimize?: SvgOptimizeConfig
optimize?: SVGOConfig
}
interface SVGOConfig extends Iterable<{ [prop: string]: boolean }>{
removeDoctype?: boolean;
removeXMLProcInst?: boolean;
removeComments?: boolean;
removeMetadata?: boolean;
removeXMLNS?: boolean;
removeEditorsNSData?: boolean;
cleanupAttrs?: boolean;
inlineStyles?: boolean;
minifyStyles?: boolean;
convertStyleToAttrs?: boolean;
cleanupIDs?: boolean;
removeRasterImages?: boolean;
removeUselessDefs?: boolean;
cleanupNumericValues?: boolean;
cleanupListOfValues?: boolean;
convertColors?: boolean;
removeUnknownsAndDefaults?: boolean;
removeNonInheritableGroupAttrs?: boolean;
removeUselessStrokeAndFill?: boolean;
removeViewBox?: boolean;
cleanupEnableBackground?: boolean;
removeHiddenElems?: boolean;
removeEmptyText?: boolean;
convertShapeToPath?: boolean;
moveElemsAttrsToGroup?: boolean;
moveGroupAttrsToElems?: boolean;
collapseGroups?: boolean;
convertPathData?: boolean;
convertTransform?: boolean;
removeEmptyAttrs?: boolean;
removeEmptyContainers?: boolean;
mergePaths?: boolean;
removeUnusedNS?: boolean;
sortAttrs?: boolean;
removeTitle?: boolean;
removeDesc?: boolean;
removeDimensions?: boolean;
removeStyleElement?: boolean;
removeScriptElement?: boolean;
}