UNPKG

2.28 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.ComponentType<Pick<import("react-native").SwitchProps & React.RefAttributes<NativeSwitch> & {
27 /**
28 * Disable toggling the switch.
29 */
30 disabled?: boolean | undefined;
31 /**
32 * Value of the switch, true means 'on', false means 'off'.
33 */
34 value?: boolean | undefined;
35 /**
36 * Custom color for switch.
37 */
38 color?: string | undefined;
39 /**
40 * Callback called with the new value when it changes.
41 */
42 onValueChange?: Function | undefined;
43 style?: StyleProp<ViewStyle>;
44 /**
45 * @optional
46 */
47 theme: ReactNativePaper.Theme;
48}, "color" | keyof import("react-native").SwitchProps | keyof React.RefAttributes<NativeSwitch>> & {
49 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
50}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<import("react-native").SwitchProps & React.RefAttributes<NativeSwitch> & {
51 /**
52 * Disable toggling the switch.
53 */
54 disabled?: boolean | undefined;
55 /**
56 * Value of the switch, true means 'on', false means 'off'.
57 */
58 value?: boolean | undefined;
59 /**
60 * Custom color for switch.
61 */
62 color?: string | undefined;
63 /**
64 * Callback called with the new value when it changes.
65 */
66 onValueChange?: Function | undefined;
67 style?: StyleProp<ViewStyle>;
68 /**
69 * @optional
70 */
71 theme: ReactNativePaper.Theme;
72}> & (({ value, disabled, onValueChange, color, theme, ...rest }: Props) => JSX.Element), {}>;
73export default _default;
74
\No newline at end of file