diff --git a/svg-sprite/svg-sprite.d.ts b/svg-sprite/svg-sprite.d.ts index 72c8eb1f2..4c441be3c 100644 --- a/svg-sprite/svg-sprite.d.ts +++ b/svg-sprite/svg-sprite.d.ts @@ -12,6 +12,7 @@ declare module "svg-sprite" { import File = require('vinyl'); namespace sprite { + import Function = Stream.Function; interface SVGSpriterConstructor extends NodeJS.EventEmitter { new(config: Config): SVGSpriter; } @@ -153,7 +154,61 @@ declare module "svg-sprite" { } interface Svg { + /** + * Output an XML declaration at the very beginning of each compiled sprite. + * If you provide a non-empty string here, it will be used one-to-one as declaration (e.g. ). + * If you set this to TRUE, *svg-sprite* will look at the registered shapes for an XML declaration and use the first one it can find. + * @default true + */ + xmlDeclaration: boolean|string; + /** + * Include a declaration in each compiled sprite. If you provide a non-empty string here, + * it will be used one-to-one as declaration (e.g. ). + * If you set this to TRUE, *svg-sprite* will look at the registered shapes for a DOCTYPE declaration and use the first one it can find. + * @default true + */ + doctypeDeclaration: boolean|string; + /** + * In order to avoid ID clashes, the default behavior is to namespace all IDs in the source SVGs before compiling them into a sprite. + * Each ID is prepended with a unique string. In some situations, it might be desirable to disable ID namespacing, e.g. when you want to script the resulting sprite. + * Just set svg.namespaceIDs to FALSE then and be aware that you might also want to disable SVGO's ID minification (shape.transform.svgo.plugins: [{cleanupIDs: false}]). + * @default true + */ + namespaceIDs?: boolean; + /** + * In order to avoid CSS class name ambiguities, the default behavior is to namespace CSS class names in the source SVGs before compiling them into a sprite. + * Each class name is prepended with a unique string. Disable this option to keep the class names untouched. + * @default true + */ + namespaceClassnames?: boolean; + /** + * If truthy, width and height attributes will be set on the sprite's element (where applicable). + * @default true + */ + dimensionAttributes?: boolean; + /** + * Shorthand for applying custom attributes to the outermost element. + * Please be aware that certain attributes (e.g. viewBox) will be calculated dynamically and override custom rootAttributes in any case. + */ + rootAttributes?: any; + /** + * Floating point precision for CSS positioning values (defaults to -1 meaning highest possible precision). + */ + precision?: number; + /** + * Callback (or list of callbacks) that will be applied to the resulting SVG sprites as global [post-processing transformation](#svg-sprite-customization). + * transform: Function∣Array + */ + transform?: SvgTransformer|SvgTransformer[]; + } + interface SvgTransformer { + /** + * Custom sprite SVG transformation + * @param svg Sprite SVG + * @return Processed SVG + */ + (svg: string): string; } interface Mode {