import * as React from "react"; import {ColorValue, StyleProp, TextStyle} from "react-native"; export interface ILoading { readonly types: LoadingTypes readonly names: LoadingNames readonly init: (params?: LoadingInitParams[]) => void readonly has: () => boolean readonly show: (content?: string, names?: LoadingNameData) => void readonly hide: () => void readonly content: (text: string) => void readonly small: (params?: LoadingSmallParams) => React.ReactNode } export type LoadingTypeData = "system" | "icon" | "img" | "gif" | "other"; // loading 类型 export type LoadingTypes = { system: 'system', // 系统 icon: 'icon', // 图标 img: 'img', // 图片 gif: 'gif', // gif other: 'other' // 其他(自定义) } export type LoadingNameData = "start" | "finish" | "cancel" | "error"; export type LoadingNames = { start: 'start', finish: 'finish', cancel: 'cancel', error: 'error', } export type LoadingInitParams = { name: LoadingNameData type: LoadingTypeData /** * icon:iconfont 名称 * img:{uri:图片地址} or images.? */ value?: any style?: StyleProp } export type LoadingSmallParams = { color?: ColorValue m?: number style?: StyleProp } export type LoadingOperate = { hide: 'hide' show: 'show' content: 'content' } export type LoadingOperateData = "hide" | "show" | "content" export type LoadingEmitterParams = { display: boolean type: LoadingOperateData value?: React.ReactNode content?: string }