/*
 * File: navigationTypes.ts
 * Description: TypeScript types for Settings module navigation
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

import { StackNavigationProp } from '@react-navigation/stack';
import { UserProfile, UserPreferences } from '../../../shared/types';

/**
 * SettingsStackParamList - Defines the parameter list for Settings stack navigator
 * 
 * This interface defines all the screens available in the Settings module
 * and their associated navigation parameters.
 */
export type SettingsStackParamList = {
  // Settings screen - Main settings with profile and preferences
  SettingScreen: SettingsScreenParams;
  
  // Profile Edit screen - Edit user profile information
  // ProfileEdit: ProfileEditScreenParams;
  
  // Security Settings screen - Security and privacy settings
  
  // About screen - App information and version
  AppInfoScreen: AppInfoScreenParams;

  // Change Password screen - Change user password
  ChangePasswordScreen: ChangePasswordScreenParams;

  // Edit Profile screen - Edit user profile information
  EditProfileScreen: EditProfileScreenParams;
  
  // Help & Support screen - Help documentation and support
  // HelpSupport: HelpSupportScreenParams;
};

/**
 * SettingsNavigationProp - Type for navigation prop in Settings screens
 * 
 * This type provides type-safe navigation methods for screens
 * within the Settings module.
 */
export type SettingsNavigationProp = StackNavigationProp<SettingsStackParamList>;

/**
 * SettingsScreenProps - Base props interface for Settings screens
 * 
 * This interface provides the common props that all Settings screens
 * will receive, including navigation and route.
 */
export interface SettingsScreenProps<T extends keyof SettingsStackParamList> {
  navigation: SettingsNavigationProp;
  route: {
    key: string;
    name: T;
    params: SettingsStackParamList[T];
  };
}

// ============================================================================
// SCREEN PARAMETER TYPES
// ============================================================================

/**
 * SettingsScreenParams
 * 
 * Purpose: Parameters passed to the main settings screen
 * 
 * Parameters:
 * - section: Optional section to navigate to within settings
 * - refresh: Optional flag to force refresh
 */
export interface SettingsScreenParams {
  section?: 'profile' | 'security' | 'notifications' | 'clinical' | 'privacy' | 'accessibility' | 'about' | 'help';
  refresh?: boolean;
}

/**
 * ProfileEditScreenParams
 * 
 * Purpose: Parameters for the profile edit screen
 * 
 * Parameters:
 * - profile: Optional profile data to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface ProfileEditScreenParams {
  profile?: UserProfile;
  fromScreen?: keyof SettingsStackParamList;
}

/**
 * SecuritySettingsScreenParams
 * 
 * Purpose: Parameters for the security settings screen
 * 
 * Parameters:
 * - showBiometricSetup: Optional flag to show biometric setup
 * - fromScreen: Optional source screen for back navigation
 */
export interface SecuritySettingsScreenParams {
  showBiometricSetup?: boolean;
  fromScreen?: keyof SettingsStackParamList;
}

/**
 * NotificationSettingsScreenParams
 * 
 * Purpose: Parameters for the notification settings screen
 * 
 * Parameters:
 * - preferences: Optional notification preferences to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface NotificationSettingsScreenParams {
  preferences?: UserPreferences['notificationPreferences'];
  fromScreen?: keyof SettingsStackParamList;
}

/**
 * ClinicalPreferencesScreenParams
 * 
 * Purpose: Parameters for the clinical preferences screen
 * 
 * Parameters:
 * - preferences: Optional clinical preferences to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface ClinicalPreferencesScreenParams {
  preferences?: UserPreferences['clinicalPreferences'];
  fromScreen?: keyof SettingsStackParamList;
}

/**
 * PrivacySettingsScreenParams
 * 
 * Purpose: Parameters for the privacy settings screen
 * 
 * Parameters:
 * - preferences: Optional privacy preferences to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface PrivacySettingsScreenParams {
  preferences?: UserPreferences['privacyPreferences'];
  fromScreen?: keyof SettingsStackParamList;
}

/**
 * AccessibilitySettingsScreenParams
 * 
 * Purpose: Parameters for the accessibility settings screen
 * 
 * Parameters:
 * - preferences: Optional accessibility preferences to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface AccessibilitySettingsScreenParams {
  preferences?: UserPreferences['accessibilityPreferences'];
  fromScreen?: keyof SettingsStackParamList;
}

/**
 * AboutScreenParams
 * 
 * Purpose: Parameters for the about screen
 * 
 * Parameters:
 * - showChangelog: Optional flag to show changelog
 * - showLicenses: Optional flag to show licenses
 */
export interface AboutScreenParams {
  showChangelog?: boolean;
  showLicenses?: boolean;
}

/**
 * HelpSupportScreenParams
 * 
 * Purpose: Parameters for the help and support screen
 * 
 * Parameters:
 * - topic: Optional help topic to navigate to
 * - showContact: Optional flag to show contact form
 */
export interface HelpSupportScreenParams {
  topic?: 'faq' | 'troubleshooting' | 'contact' | 'feedback';
  showContact?: boolean;
}

// ============================================================================
// SCREEN-SPECIFIC PROPS TYPES
// ============================================================================

/**
 * SettingsScreenProps - Props for SettingsScreen component
 */
export type SettingsScreenProps = SettingsScreenProps<'Settings'>;

/**
 * ProfileEditScreenProps - Props for ProfileEditScreen component
 */
export type ProfileEditScreenProps = SettingsScreenProps<'ProfileEdit'>;

/**
 * SecuritySettingsScreenProps - Props for SecuritySettingsScreen component
 */
export type SecuritySettingsScreenProps = SettingsScreenProps<'SecuritySettings'>;

/**
 * NotificationSettingsScreenProps - Props for NotificationSettingsScreen component
 */
export type NotificationSettingsScreenProps = SettingsScreenProps<'NotificationSettings'>;

/**
 * ClinicalPreferencesScreenProps - Props for ClinicalPreferencesScreen component
 */
export type ClinicalPreferencesScreenProps = SettingsScreenProps<'ClinicalPreferences'>;

/**
 * PrivacySettingsScreenProps - Props for PrivacySettingsScreen component
 */
export type PrivacySettingsScreenProps = SettingsScreenProps<'PrivacySettings'>;

/**
 * AccessibilitySettingsScreenProps - Props for AccessibilitySettingsScreen component
 */
export type AccessibilitySettingsScreenProps = SettingsScreenProps<'AccessibilitySettings'>;

/**
 * AboutScreenProps - Props for AboutScreen component
 */
export type AppInfoScreenParams = SettingsScreenProps<'AppInfoScreen'>

/**
 * ChangePasswordScreenProps - Props for ChangePasswordScreen component
 */
export type ChangePasswordScreenProps = SettingsScreenProps<'ChangePasswordScreen'>;


/**
 * EditProfileScreenProps - Props for EditProfileScreen component
 */
export type EditProfileScreenProps = SettingsScreenProps<'EditProfileScreen'>;




/**
 * HelpSupportScreenProps - Props for HelpSupportScreen component
 */
export type HelpSupportScreenProps = SettingsScreenProps<'HelpSupport'>;

/*
 * End of File: navigationTypes.ts
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */ 