mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add Svg definition to svg-sprite
This commit is contained in:
Vendored
+55
@@ -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. <?xml version="1.0" encoding="utf-8"?>).
|
||||
* 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 <DOCTYPE> declaration in each compiled sprite. If you provide a non-empty string here,
|
||||
* it will be used one-to-one as declaration (e.g. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">).
|
||||
* 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 <svg> element (where applicable).
|
||||
* @default true
|
||||
*/
|
||||
dimensionAttributes?: boolean;
|
||||
/**
|
||||
* Shorthand for applying custom attributes to the outermost <svg> 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 {
|
||||
|
||||
Reference in New Issue
Block a user