add types for react-icofont npm package (#38327)

This commit is contained in:
Ivan 2019-09-25 00:36:49 +03:00 committed by Ben Lichtman
parent 68721e9fb7
commit adc769c638
4 changed files with 56 additions and 0 deletions

18
types/react-icofont/index.d.ts vendored Normal file
View File

@ -0,0 +1,18 @@
// Type definitions for react-icofont 1.0
// Project: https://www.npmjs.com/package/react-icofont
// Definitions by: Ivan Chuyko <https://github.com/ichuyko>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
export interface IcofontProps {
icon: string;
spin?: boolean;
flip?: "h" | "v";
rotate?: "90" | "180" | "270";
size?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10";
className?: string;
}
export default class Icofont extends React.Component<IcofontProps> {}

View File

@ -0,0 +1,10 @@
import * as React from 'react';
import Icofont from "react-icofont";
class Test extends React.Component<any> {
render() {
return (
<Icofont icon="spinner-alt-4" size="3" spin={true}/>
);
}
}

View File

@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"jsx": "react",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-icofont-tests.tsx"
]
}

View File

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