UNPKG

4.42 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, Switch as NativeSwitch, ViewStyle } from 'react-native';
3declare type Props = React.ComponentPropsWithRef<typeof NativeSwitch> & {
4 /**
5 * Disable toggling the switch.
6 */
7 disabled?: boolean;
8 /**
9 * Value of the switch, true means 'on', false means 'off'.
10 */
11 value?: boolean;
12 /**
13 * Custom color for switch.
14 */
15 color?: string;
16 /**
17 * Callback called with the new value when it changes.
18 */
19 onValueChange?: Function;
20 style?: StyleProp<ViewStyle>;
21 /**
22 * @optional
23 */
24 theme: ReactNativePaper.Theme;
25};
26declare const _default: (React.ComponentClass<Pick<Props, "ref" | "style" | "pointerEvents" | "color" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "disabled" | "value" | "onValueChange" | "thumbColor" | "trackColor" | "ios_backgroundColor" | "onTintColor" | "thumbTintColor" | "tintColor"> & {
27 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
28}, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & (({ value, disabled, onValueChange, color, theme, ...rest }: Props) => JSX.Element)) | (React.FunctionComponent<Props> & (({ value, disabled, onValueChange, color, theme, ...rest }: Props) => JSX.Element)), {}>) | (React.FunctionComponent<Pick<Props, "ref" | "style" | "pointerEvents" | "color" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "disabled" | "value" | "onValueChange" | "thumbColor" | "trackColor" | "ios_backgroundColor" | "onTintColor" | "thumbTintColor" | "tintColor"> & {
29 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
30}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & (({ value, disabled, onValueChange, color, theme, ...rest }: Props) => JSX.Element)) | (React.FunctionComponent<Props> & (({ value, disabled, onValueChange, color, theme, ...rest }: Props) => JSX.Element)), {}>);
31export default _default;
32
\No newline at end of file