import React from "react"; import {ColorValue} from "react-native"; export type IProps = { // 名称,用于找到layer readonly name: string readonly children?: React.ReactNode // 动画方式 readonly animated?: PopupLayerAnimatedName // 方向 readonly direction?: PopupLayerDirectionName // 宽度 readonly width?: number // 高度 readonly height?: number // 间隙 readonly edge?: number // 圆角 readonly borderRadius?: number // 边框颜色 readonly borderColor?: ColorValue // 是否点击隐藏 readonly isClickHide?: boolean // 背景色 readonly bg?: ColorValue // 打开回调 readonly openCallback?: (name: string) => void // 关闭回调 readonly closeCallback?: (name: string) => void } export interface IPopupLayer { // 动画类型 readonly animated: PopupLayerAnimatedType // 方向 readonly direction: PopupLayerDirectionType // 比例 readonly scale: PopupLayerScale // 显示 readonly show: (name: string, delayTime?: number) => void // 隐藏 readonly hide: (name: string, delayTime?: number) => void // 是否存在 readonly has: (name?: string) => boolean // 打开列表 readonly openingList: () => string[] } export type StorageParams = { readonly name?: string readonly display?: boolean } export type EmitterParams = { readonly display: boolean } /** * 动画 */ export type PopupLayerAnimatedType = { // 没有 readonly none: 'none' // 渐隐 readonly fade: 'fade' // 左侧 readonly left: 'left' // 右侧 readonly right: 'right' // 头部 readonly top: 'top' // 底部 readonly bottom: 'bottom' } export type PopupLayerAnimatedName = 'none' | 'fade' | 'left' | 'right' | 'top' | 'bottom'; /** * 方向 */ export type PopupLayerDirectionType = { // 没有 readonly none: 'none' // 左侧 readonly left: 'left' // 右侧 readonly right: 'right' // 头部 readonly top: 'top' // 底部 readonly bottom: 'bottom' } export type PopupLayerDirectionName = 'none' | 'left' | 'right' | 'top' | 'bottom'; /** * 比例 */ export type PopupLayerScale = { 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 }