import * as React from "react"; import {ColorValue} from "react-native"; export type IProps = { } export type IPopup = { readonly names: PopupNames readonly direction: PopupDirection readonly widthScale: PopupWidthScale readonly heightScale: PopupHeightScale /** * 初始化 */ readonly init: (params?: PopupInitParams[]) => void readonly has: () => boolean readonly show: (name: PopupNamesData, value?: any) => void readonly hide: () => void readonly view: (value: string | React.ReactNode) => void readonly select: (list: any[], params?: PopupSelectParams) => void readonly tip: (value: string | React.ReactNode, params?: PopupTipsParams) => void readonly err: (value: string | React.ReactNode) => void } /** * 参数 */ export type PopupParams = {} export type PopupSelectParams = { readonly title?: string readonly titleSize?: number readonly titleColor?: ColorValue readonly desc?: string readonly descColor?: ColorValue readonly textName?: string hasCancel?: boolean // 最大可视长度 maxSize?: number // 选中key readonly selectKey?: number readonly callback?: (key: number) => void } export type PopupTipsParams = { /** * 背景色 */ readonly bg?: ColorValue /** * 线条颜色 */ readonly lineColor?: ColorValue /** * 字体颜色 */ readonly color?: ColorValue /** * 显示时间 */ readonly timer?: number } /** * 初始化参数 */ export type PopupInitParams = { readonly name: PopupNamesData readonly direction: PopupDirectionData space?: number } export type PopupEmitterParams = { display: boolean direction?: PopupDirectionData /** * 边距 */ space?: number value?: any } /** * 名称 */ export type PopupNames = { readonly view: 'view' readonly select: 'select' readonly tip: 'tip' readonly err: 'err' } export type PopupNamesData = 'view' | 'select' | 'tip' | 'err' /** * 方向 */ export type PopupDirection = { readonly left: 'left' readonly right: 'right' readonly top: 'top' readonly bottom: 'bottom' } export type PopupDirectionData = 'left' | 'right' | 'top' | 'bottom' /** * 宽度比例 */ export type PopupWidthScale = { readonly 30: 0.3 readonly 40: 0.4 readonly 50: 0.5 readonly 60: 0.6 readonly 70: 0.7 readonly 80: 0.8 readonly 90: 0.9 readonly 100: 1 } /** * 高度比例 */ export type PopupHeightScale = { readonly 30: 0.3 readonly 40: 0.4 readonly 50: 0.5 readonly 60: 0.6 readonly 70: 0.7 readonly 80: 0.8 readonly 90: 0.9 readonly 100: 1 }