UNPKG

@uiw/react-native

Version:
57 lines (56 loc) 1.43 kB
import React from 'react'; import { ViewProps, ModalProps } from 'react-native'; 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; } export interface style extends ViewProps { width?: number | 'auto'; height?: number | 'auto'; left?: number; top?: number; position?: 'absolute' | 'relative'; zIndex?: number; } interface TooltipState { modalVisible: boolean; /** 云 */ cloudStyle: style; /** 根盒子 */ followStyle: style; /** modal 根盒子 */ modalViewStyle: style; } export default class Tooltip extends React.Component<TooltipProps, TooltipState> { private fadeAnim; private refFollow; private refCloud; private isDown; private isStart; private triangle; constructor(props: TooltipProps); onOpen: () => void; onClose: () => void; render(): JSX.Element; } export {};