import * as React from "react"; import {StyleProp, TextStyle} from "react-native"; export interface INavigation { // 是否有可用的导航 readonly canGoBack: () => boolean readonly go: (routeName: string, data?: object, params?: NavParams) => void readonly back: (params?: NavParams) => void readonly empty: (routeName: string, params?: NavParams) => void readonly popToTop: (params?: NavParams) => void } export type NavParams = { // 延长时间 timer?: number // 执行方法 callback?: () => void } /** * nav 底部导航 */ export interface INavBottomTabs { readonly hasDisplay: () => boolean readonly setIcon: (pageName: string, component: any, title: string, data: string, params?: NavBottomTabsParams) => void readonly setImage: (pageName: string, component: any, title: string, data: number, params?: NavBottomTabsParams) => void readonly end: (style?: StyleProp) => React.ReactNode } export type NavBottomTabs = { readonly show: () => void readonly hide: () => void readonly hasDisplay: () => boolean } export type NavBottomTabsData = { name: string title: string component: any type: 'icon' | 'image' data: string | number select: string | number size: number titleSize: number titleStyle: StyleProp barStyle: HeaderBarStyle | undefined hasWeight: boolean } export type NavBottomTabsParams = { select?: string size?: number titleSize?: number titleStyle?: StyleProp, barStyle?: HeaderBarStyle hasWeight?: boolean } /** * nav 页面导航 */ export interface INavScreen { type: NavScreenType setInitialRouteName: (routeName: string) => void set: (pageName: string, component: any, type?: NavScreenTypeData) => void end: () => React.ReactNode } export type NavScreenType = { default: 0 fade: 1 } export type NavScreenTypeData = 0 | 1 export type NavScreenData = { name: string component: any type: NavScreenTypeData }