mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add gulp-svg-sprite
This commit is contained in:
parent
5f48028783
commit
de0d7f205e
51
gulp-svg-sprite/gulp-svg-sprite-tests.ts
Normal file
51
gulp-svg-sprite/gulp-svg-sprite-tests.ts
Normal file
@ -0,0 +1,51 @@
|
||||
/// <reference path="gulp-svg-sprite.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
/// <reference path="../svg-sprite/svg-sprite.d.ts" />
|
||||
|
||||
import svgSprite = require('gulp-svg-sprite');
|
||||
import spriter = require('svg-sprite');
|
||||
import gulp = require('gulp')
|
||||
|
||||
let config: spriter.Config;
|
||||
|
||||
// Basic configuration example
|
||||
config = {
|
||||
mode : {
|
||||
css : { // Activate the «css» mode
|
||||
render : {
|
||||
css : true // Activate CSS output (with default options)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
gulp.src('**/*.svg', {cwd: 'path/to/assets'})
|
||||
.pipe(svgSprite(config))
|
||||
.pipe(gulp.dest('out'));
|
||||
|
||||
|
||||
config = {
|
||||
shape : {
|
||||
dimension : { // Set maximum dimensions
|
||||
maxWidth : 32,
|
||||
maxHeight : 32
|
||||
},
|
||||
spacing : { // Add padding
|
||||
padding : 10
|
||||
},
|
||||
dest : 'out/intermediate-svg' // Keep the intermediate files
|
||||
},
|
||||
mode : {
|
||||
view : { // Activate the «view» mode
|
||||
bust : false,
|
||||
render : {
|
||||
scss : true // Activate Sass output (with default options)
|
||||
}
|
||||
},
|
||||
symbol : true // Activate the «symbol» mode
|
||||
}
|
||||
};
|
||||
|
||||
gulp.src('**/*.svg', {cwd: 'path/to/assets'})
|
||||
.pipe(svgSprite(config))
|
||||
.pipe(gulp.dest('out'));
|
||||
22
gulp-svg-sprite/gulp-svg-sprite.d.ts
vendored
Normal file
22
gulp-svg-sprite/gulp-svg-sprite.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Type definitions for gulp-svg-sprite
|
||||
// Project: https://github.com/jkphl/gulp-svg-sprite
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../svg-sprite/svg-sprite.d.ts" />
|
||||
|
||||
declare module "gulp-svg-sprite" {
|
||||
import spriter = require('svg-sprite');
|
||||
|
||||
namespace svgSprite {
|
||||
interface SvgSprite {
|
||||
(options?: spriter.Config): NodeJS.ReadWriteStream;
|
||||
}
|
||||
}
|
||||
|
||||
var svgSprite: svgSprite.SvgSprite;
|
||||
|
||||
export = svgSprite;
|
||||
}
|
||||
|
||||
4
svg-sprite/svg-sprite.d.ts
vendored
4
svg-sprite/svg-sprite.d.ts
vendored
@ -291,12 +291,12 @@ declare module "svg-sprite" {
|
||||
* which all reside in the directory tmpl/css. Example: {css: true, scss: {dest: '_sprite.scss'}}
|
||||
* @default {}
|
||||
*/
|
||||
render?: { [key: string]: RenderingConfiguration };
|
||||
render?: { [key: string]: RenderingConfiguration|boolean };
|
||||
/**
|
||||
* Enabling this will trigger the creation of an HTML document demoing the usage of the sprite. Please see below for details on [rendering configurations](#rendering-configurations).
|
||||
* @default false
|
||||
*/
|
||||
example?: RenderingConfiguration;
|
||||
example?: RenderingConfiguration|boolean;
|
||||
/**
|
||||
* Specify svg-sprite which output mode to use with this configuration
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user