mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Added type definitions for react-loader-spinner (#40080)
* Added type definitions for react-loader-spinner * Added version reference of react-loader-spinner to 3.1 * Changed TypeScript version reference to 3.6 * Removed JSDoc for possible types * Removed I prefix on the LoaderProps interface
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
60bd0fc81e
commit
ed6743ecbe
+39
@@ -0,0 +1,39 @@
|
||||
// Type definitions for react-loader-spinner 3.1
|
||||
// Project: https://github.com/mhnpd/react-loader-spinner
|
||||
// Definitions by: Rayhan Wirjowerdojo <https://github.com/rayhanw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.6
|
||||
|
||||
import { FC } from 'react';
|
||||
|
||||
type Types =
|
||||
| 'Audio'
|
||||
| 'BallTriangle'
|
||||
| 'Bars'
|
||||
| 'Circles'
|
||||
| 'Grid'
|
||||
| 'Hearts'
|
||||
| 'Oval'
|
||||
| 'Puff'
|
||||
| 'Rings'
|
||||
| 'TailSpin'
|
||||
| 'ThreeDots'
|
||||
| 'Watch'
|
||||
| 'RevolvingDot'
|
||||
| 'Triangle'
|
||||
| 'Plane'
|
||||
| 'MutatingDots'
|
||||
| 'None'
|
||||
| 'NotSpecified';
|
||||
|
||||
interface LoaderProps {
|
||||
type?: Types;
|
||||
color?: string;
|
||||
timeout?: number; // in milliseconds
|
||||
height?: number;
|
||||
width?: number;
|
||||
visible?: boolean | string;
|
||||
}
|
||||
|
||||
declare const Loader: FC<LoaderProps>;
|
||||
export default Loader;
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import Loader from 'react-loader-spinner';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<div>
|
||||
<Loader type="Audio" color="#8000FF" timeout={3000} height={80} width={80} visible={true} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"jsx": "react",
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"test/react-loader-spinner-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user