Merge pull request #26210 from rynclark/svg-sprite-loader

Add typings for svg-sprite-loader
This commit is contained in:
Daniel Rosenwasser
2018-06-01 15:13:55 -07:00
committed by GitHub
5 changed files with 62 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for svg-sprite-loader 3.9
// Project: https://github.com/kisenka/svg-sprite-loader/releases
// Definitions by: Ryan Clark <https://github.com/rynclark>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { loader } from 'webpack';
export = SVGSpriteLoader;
declare function SVGSpriteLoader(
this: loader.LoaderContext,
source: string | Buffer
): string | Buffer | void | undefined;
+16
View File
@@ -0,0 +1,16 @@
import { Plugin } from 'webpack';
export = SVGSpriteLoaderPlugin;
declare class SVGSpriteLoaderPlugin extends Plugin {
constructor(options?: SVGSpriteLoaderPlugin.Options);
}
declare namespace SVGSpriteLoaderPlugin {
interface Options {
/** Render plain sprite without styles and usages */
plainSprite?: boolean;
/** Custom tag attributes for the svg */
spriteAttrs?: {[key: string]: any};
}
}
@@ -0,0 +1,7 @@
import SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
new SpriteLoaderPlugin();
new SpriteLoaderPlugin({ plainSprite: true });
new SpriteLoaderPlugin({ spriteAttrs: { testAttr: 'testValue' } });
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"plugin.d.ts",
"svg-sprite-loader-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }