Added type for @svgr/rollup (#39007)

* added types for @types/svgr/rollup

* fixed formatting

* added typescript version

* fixed typo

* added reference type

* updated typescript version

* added package json
This commit is contained in:
Max Boguslavsky 2019-10-11 00:53:50 +03:00 committed by Armando Aguirre
parent a88a306eff
commit 6ce6f59e47
5 changed files with 66 additions and 0 deletions

22
types/svgr__rollup/index.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
// Type definitions for @svgr/rollup 4.3
// Project: https://github.com/smooth-code/svgr/tree/master/packages/rollup
// Definitions by: Nick <https://github.com/fobdy>
// Max Boguslavskiy <https://github.com/maxbogus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
/// <reference types='node' />
import { Plugin } from 'rollup';
declare namespace svgrRollup {
interface Options {
include?: string;
exclude: string;
babel: boolean;
}
}
declare function svgrRollup(options?: svgrRollup.Options): Plugin;
export = svgrRollup;

View File

@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"rollup": "^1.23.1"
}
}

View File

@ -0,0 +1,10 @@
import svgr, { Options } from '@svgr/rollup';
// test data
const partialOptions: Options = { exclude: '', babel: true };
const fullOptions: Options = { include: '', exclude: '', babel: true };
// tests
svgr();
svgr(partialOptions);
svgr(fullOptions);

View File

@ -0,0 +1,27 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"paths": {
"@svgr/rollup": ["svgr__rollup"]
},
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"svgr__rollup-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }