mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
[rc-switch] Add new definition
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for rc-switch 1.8
|
||||
// Project: http://github.com/react-component/switch
|
||||
// Definitions by: Karol Majewski <https://github.com/karol-majewski>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface Props {
|
||||
autoFocus?: boolean;
|
||||
checked?: boolean;
|
||||
checkedChildren: React.ReactNode;
|
||||
className?: string;
|
||||
defaultChecked?: boolean;
|
||||
disabled?: boolean;
|
||||
loadingIcon?: React.ReactNode;
|
||||
onChange?: (checked: boolean) => void;
|
||||
onClick?: (checked: boolean) => void;
|
||||
prefixCls?: string;
|
||||
tabIndex?: number;
|
||||
unCheckedChildren: React.ReactNode;
|
||||
}
|
||||
|
||||
export default class Switch extends React.Component<Props> {}
|
||||
@@ -0,0 +1,31 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import Switch, { Props } from 'rc-switch';
|
||||
|
||||
/**
|
||||
* Only required props.
|
||||
*/
|
||||
React.createElement(Switch, {
|
||||
checkedChildren: 'hello',
|
||||
disabled: false,
|
||||
onChange: console.log,
|
||||
unCheckedChildren: 'world'
|
||||
});
|
||||
|
||||
/**
|
||||
* All accepted props.
|
||||
*/
|
||||
React.createElement(Switch, {
|
||||
autoFocus: false,
|
||||
checked: false,
|
||||
checkedChildren: 'hello',
|
||||
className: 'switch',
|
||||
defaultChecked: false,
|
||||
disabled: false,
|
||||
loadingIcon: 0,
|
||||
onChange: console.log,
|
||||
onClick: console.log,
|
||||
prefixCls: 'rc-',
|
||||
tabIndex: 0,
|
||||
unCheckedChildren: 'world',
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"rc-switch-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user