mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Merge pull request #34195 from franzmoro/master
added CheckBox to react-native
This commit is contained in:
Vendored
+31
@@ -18,6 +18,7 @@
|
||||
// Souvik Ghosh <https://github.com/souvik-ghosh>
|
||||
// Cheng Gibson <https://github.com/nossbigg>
|
||||
// Saransh Kataria <https://github.com/saranshkataria>
|
||||
// Francesco Moro <https://github.com/franzmoro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -7292,6 +7293,36 @@ export interface CameraRollStatic {
|
||||
getPhotos(params: GetPhotosParamType): Promise<GetPhotosReturnType>;
|
||||
}
|
||||
|
||||
// https://facebook.github.io/react-native/docs/checkbox.html
|
||||
export interface CheckBoxProps extends ViewProps {
|
||||
/**
|
||||
* If true the user won't be able to toggle the checkbox. Default value is false.
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Used in case the props change removes the component.
|
||||
*/
|
||||
onChange?: (value: boolean) => void;
|
||||
|
||||
/**
|
||||
* Invoked with the new value when the value changes.
|
||||
*/
|
||||
onValueChange?: (value: boolean) => void;
|
||||
|
||||
/**
|
||||
* Used to locate this view in end-to-end tests.
|
||||
*/
|
||||
testID?: string;
|
||||
|
||||
/**
|
||||
* The value of the checkbox. If true the checkbox will be turned on. Default value is false.
|
||||
*/
|
||||
value?: boolean;
|
||||
}
|
||||
|
||||
export class CheckBox extends React.Component<CheckBoxProps> {}
|
||||
|
||||
/** Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android */
|
||||
export interface ClipboardStatic {
|
||||
getString(): Promise<string>;
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
BackAndroid,
|
||||
BackHandler,
|
||||
Button,
|
||||
CheckBox,
|
||||
ColorPropType,
|
||||
DataSourceAssetCallback,
|
||||
DeviceEventEmitterStatic,
|
||||
@@ -534,6 +535,16 @@ class MaskedViewTest extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const CheckboxTest = () => (
|
||||
<CheckBox
|
||||
testID="testId"
|
||||
disabled={false}
|
||||
onChange={value => { console.log(value); }}
|
||||
onValueChange={value => { console.log(value); }}
|
||||
value={true}
|
||||
/>
|
||||
);
|
||||
|
||||
class InputAccessoryViewTest extends React.Component {
|
||||
render() {
|
||||
const uniqueID = "foobar";
|
||||
|
||||
Reference in New Issue
Block a user