diff --git a/types/svg-sprite-loader/index.d.ts b/types/svg-sprite-loader/index.d.ts new file mode 100644 index 0000000000..b192e8bd01 --- /dev/null +++ b/types/svg-sprite-loader/index.d.ts @@ -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 +// 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; diff --git a/types/svg-sprite-loader/plugin.d.ts b/types/svg-sprite-loader/plugin.d.ts new file mode 100644 index 0000000000..183d5009a6 --- /dev/null +++ b/types/svg-sprite-loader/plugin.d.ts @@ -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}; + } +} diff --git a/types/svg-sprite-loader/svg-sprite-loader-tests.ts b/types/svg-sprite-loader/svg-sprite-loader-tests.ts new file mode 100644 index 0000000000..e8c16de710 --- /dev/null +++ b/types/svg-sprite-loader/svg-sprite-loader-tests.ts @@ -0,0 +1,7 @@ +import SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); + +new SpriteLoaderPlugin(); + +new SpriteLoaderPlugin({ plainSprite: true }); + +new SpriteLoaderPlugin({ spriteAttrs: { testAttr: 'testValue' } }); diff --git a/types/svg-sprite-loader/tsconfig.json b/types/svg-sprite-loader/tsconfig.json new file mode 100644 index 0000000000..89cd036620 --- /dev/null +++ b/types/svg-sprite-loader/tsconfig.json @@ -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" + ] +} diff --git a/types/svg-sprite-loader/tslint.json b/types/svg-sprite-loader/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/svg-sprite-loader/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }