mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
Merge pull request #13425 from LKay/lkay/react-toggle
Add definitions for react-toggle
This commit is contained in:
19
react-toggle/index.d.ts
vendored
Normal file
19
react-toggle/index.d.ts
vendored
Normal 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> {}
|
||||
10
react-toggle/react-toggle-tests.tsx
Normal file
10
react-toggle/react-toggle-tests.tsx
Normal 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 } />
|
||||
);
|
||||
}
|
||||
}
|
||||
21
react-toggle/tsconfig.json
Normal file
21
react-toggle/tsconfig.json
Normal 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
1
react-toggle/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user