/**
 * 导航基础设施类型定义
 */

import { NavigationContainerRef, Route } from '@react-navigation/native';
import type {
  RootStackParamList,
  MainTabParamList,
  HomeStackParamList,
  MessageStackParamList,
  ScheduleStackParamList,
  ProfileStackParamList,
  AuthStackParamList,
} from '../../navigation/types';

// ==================== 导航服务类型 ====================
export interface NavigationServiceInterface {
  setNavigationRef(ref: NavigationContainerRef<any> | null): void;
  isNavigationReady(): boolean;
  navigate(routeName: string, params?: any): void;
  goBack(): void;
  getCurrentRoute(): Route<string> | null;
  getCurrentRouteName(): string | null;
  reset(routes: { name: string; params?: any }[], index?: number): void;
  replace(routeName: string, params?: any): void;
  navigateToRoot(): void;
  navigateToAuth(): void;
}

// ==================== Tab 类型 ====================
export type TabName = 'HomeTab' | 'MessageTab' | 'ScheduleTab' | 'ProfileTab';

export interface NavItemConfig {
  name: TabName;
  label: string;
  icon: string;
  iconOutline: string;
}

// ==================== 导航配置常量 ====================
export const NAVIGATION_CONSTANTS = {
  SIDEBAR_WIDTH_DESKTOP: 240,
  SIDEBAR_WIDTH_TABLET: 200,
  SIDEBAR_COLLAPSED_WIDTH: 72,
  MOBILE_TAB_FLOATING_MARGIN: 12,
  LAST_ACTIVE_TAB_KEY: 'last_active_tab',
} as const;

// ==================== 重新导出导航类型 ====================
export type {
  RootStackParamList,
  MainTabParamList,
  HomeStackParamList,
  MessageStackParamList,
  ScheduleStackParamList,
  ProfileStackParamList,
  AuthStackParamList,
};
