IOweb/node_modules/@iconify/tools/lib/optimise/svgo.d.mts
2026-07-03 15:07:38 -05:00

37 lines
984 B
TypeScript

import { PluginConfig } from 'svgo';
import { SVG } from '../svg/index.mjs';
import 'cheerio';
import '@iconify/types';
import '@iconify/utils/lib/customisations/defaults';
interface CleanupIDsOption {
cleanupIDs?: string | ((id: string) => string) | false;
}
interface GetSVGOPluginOptions extends CleanupIDsOption {
animated?: boolean;
keepShapes?: boolean;
}
/**
* Get list of plugins
*/
declare function getSVGOPlugins(options: GetSVGOPluginOptions): PluginConfig[];
/**
* Options
*/
interface SVGOCommonOptions {
multipass?: boolean;
}
interface SVGOOptionsWithPlugin extends SVGOCommonOptions {
plugins: PluginConfig[];
}
interface SVGOptionsWithoutPlugin extends SVGOCommonOptions, CleanupIDsOption {
plugins?: undefined;
keepShapes?: boolean;
}
type SVGOOptions = SVGOOptionsWithPlugin | SVGOptionsWithoutPlugin;
/**
* Run SVGO on icon
*/
declare function runSVGO(svg: SVG, options?: SVGOOptions): void;
export { getSVGOPlugins, runSVGO };