/*
 * File: common.ts
 * Description: Common type definitions used across the application
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

export interface ApiResponse<T> {
  success: boolean;
  data?: T;
  error?: string;
  message?: string;
  timestamp: Date;
}

export interface PaginatedResponse<T> {
  data: T[];
  pagination: {
    page: number;
    limit: number;
    total: number;
    totalPages: number;
  };
}

export interface LoadingState {
  isLoading: boolean;
  error: string | null;
}

export interface NavigationParams {
  [key: string]: any;
}

export interface ScreenProps {
  navigation: any;
  route: {
    params: NavigationParams;
  };
}

export interface FormField {
  name: string;
  label: string;
  type: 'text' | 'email' | 'password' | 'number' | 'select' | 'date' | 'textarea';
  required: boolean;
  validation?: (value: any) => string | null;
  options?: { label: string; value: any }[];
  placeholder?: string;
  defaultValue?: any;
}

export interface ValidationError {
  field: string;
  message: string;
}

export interface AppSettings {
  theme: 'light' | 'dark' | 'auto';
  language: string;
  notifications: boolean;
  biometricAuth: boolean;
  autoLogout: boolean;
  offlineMode: boolean;
}

export interface DeviceInfo {
  id: string;
  name: string;
  platform: 'ios' | 'android';
  version: string;
  model: string;
  isTablet: boolean;
}

export interface NetworkStatus {
  isConnected: boolean;
  type: 'wifi' | 'cellular' | 'none';
  strength?: number;
}

export interface ErrorBoundaryState {
  hasError: boolean;
  error?: Error;
  errorInfo?: any;
}

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