Merge pull request #13425 from LKay/lkay/react-toggle

Add definitions for react-toggle
This commit is contained in:
Daniel Rosenwasser
2016-12-21 23:04:22 -08:00
committed by GitHub
4 changed files with 51 additions and 0 deletions

19
react-toggle/index.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for react-toggle 2.2
// Project: https://github.com/aaronshaf/react-toggle
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Component, HTMLAttributes, ReactNode } from "react";
interface ToggleIcons {
checked?: ReactNode;
unchecked?: ReactNode;
}
interface ToggleProps extends HTMLAttributes<any> {
"aria-labelledby"?: string;
"aria-label"?: string;
icons?: boolean | ToggleIcons;
}
export default class Toggle extends Component<ToggleProps, any> {}

View File

@@ -0,0 +1,10 @@
import * as React from "react"
import Toggle from "react-toggle"
class Test extends React.Component<{}, {}> {
public render() {
return (
<Toggle icons={ false } />
);
}
}

View File

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

1
react-toggle/tslint.json Normal file
View File

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