@uiw/react-native
Version:
UIW for React Native
34 lines (33 loc) • 891 B
TypeScript
import React from 'react';
import { Animated, SwitchProps as SwitchPropsDefault, ViewStyle } from 'react-native';
export interface SwitchProps extends SwitchPropsDefault {
trackStyle?: ViewStyle;
thumbStyle?: ViewStyle;
checked?: boolean;
color?: string;
/**
* 设置大小
*/
size?: 'small' | 'default' | 'large';
}
export interface SwitchState {
checked: boolean;
borderValue: Animated.Value;
translateXValue: Animated.Value;
bgOpacity: Animated.Value;
containerSize: {
width: number;
height: number;
};
control: 'props' | 'state';
animatedStart: (checked: boolean) => void;
}
declare function Switch(props: SwitchProps): React.JSX.Element;
declare namespace Switch {
var defaultProps: {
checked: boolean;
size: string;
onValueChange: () => void;
};
}
export default Switch;