@uiw/react-native
Version:
UIW for React Native
53 lines (52 loc) • 1.4 kB
TypeScript
import React from 'react';
import { View, ViewProps, ModalProps, Animated } from 'react-native';
import { xLocation } from './utils';
export interface TooltipProps extends ModalProps {
/** cloud 元素 */
title: React.ReactNode;
/** 子元素 */
children: JSX.Element;
/** 点击类型 */
toggleAction?: 'onPress' | 'onLongPress' | 'onPressIn' | 'onPressOut';
/** 高度 这个是必须的 */
height?: number | 'auto';
/** 宽度 这个是必须的 */
width?: number | 'auto';
/** 背景色 */
backgroundColor?: string;
/** 圆角大小 */
borderRadius?: number;
/**
* 打开时触发
*/
onOpen?: Function;
/**
* 关闭时触发
*/
onClose?: Function;
isDown?: boolean;
triangle?: number;
fadeAnim?: any;
isStart?: any;
refCloud?: any;
}
export interface style extends ViewProps {
width?: number | 'auto';
height?: number | 'auto';
left?: number;
top?: number;
position?: 'absolute' | 'relative';
zIndex?: number;
}
declare function Tooltip(props: TooltipProps): React.JSX.Element;
declare namespace Tooltip {
var defaultProps: {
fadeAnim: Animated.Value[];
refFollow: React.RefObject<View>;
refCloud: React.RefObject<View>;
isDown: boolean;
isStart: xLocation;
triangle: number;
};
}
export default Tooltip;