/**
 * ============================================
 * SHARED TYPES PACKAGE
 * ============================================
 * 
 * TypeScript type definitions shared between
 * frontend and backend applications
 * 
 * Usage:
 *   import type { User, Exercise, ApiResponse } from '@math-platform/shared-types';
 *   import { ApplicationError } from '@math-platform/shared-types';
 * 
 * Or import specific modules:
 *   import type { LoginRequest, LoginResponse } from '@math-platform/shared-types/auth';
 */

// ============================================
// AUTH
// ============================================
export type {
  LoginRequest,
  LoginResponse,
  RegisterRequest,
  RegisterResponse,
  RefreshTokenRequest,
  RefreshTokenResponse,
  ChangePasswordRequest,
  User,
  UserRole,
  JwtPayload,
  AuthTokens,
} from './auth';

// ============================================
// EXERCISE
// ============================================
export type {
  ExerciseType,
  ExerciseDifficulty,
  ExerciseStatus,
  TopicType,
  ModuleType,
  Exercise,
  ExerciseOption,
  SolutionStep,
  SubmitAttemptRequest,
  SubmitAttemptResponse,
  AchievementUnlock,
  ExerciseAttempt,
  ExerciseContent,
  LatexFormula,
  ExerciseHint,
  MultipleChoiceOption,
  CalculationStep,
} from './exercise';

// ============================================
// MODULE
// ============================================
export type {
  Module,
  ModuleExample,
  ModuleExerciseRef,
  ModuleAnswer,
  Topic,
  TheoryContent,
  TheorySection,
  Formula,
  TheoryContentDetailed,
  KeyPoint,
  CommonMistake,
} from './module';

// ============================================
// PROGRESS
// ============================================
export type {
  UserProgress,
  ModuleProgress,
  ProgressMetrics,
  UserStatistics,
  Activity,
  ActivityType,
} from './progress';

// ============================================
// ACHIEVEMENT
// ============================================
export type {
  AchievementCategory,
  AchievementRarity,
  Achievement,
  AchievementMetadata,
  UserAchievement,
  UserAchievementProgress,
  AchievementBadge,
} from './achievement';

// ============================================
// RANKING
// ============================================
export type {
  RankingEntry,
  GlobalRanking,
  UserRankingPosition,
  RankingFilters,
} from './ranking';

// ============================================
// API
// ============================================
export type {
  ApiResponse,
  ApiError,
  ApiMeta,
  PaginationParams,
  PaginatedResponse,
  PaginationInfo,
  FilterOptions,
  SortOptions,
} from './api';

// ============================================
// ERROR
// ============================================
export type {
  ErrorCode,
  AppError,
} from './error';

// Export error classes as values (not types)
export {
  ApplicationError,
  ValidationError,
  AuthenticationError,
  AuthorizationError,
  NotFoundError,
  ConflictError,
  RateLimitError,
} from './error';

// ============================================
// UTILS
// ============================================
export type {
  WithId,
  WithTimestamps,
  PartialBy,
  Nullable,
  Optional,
  UUID,
  ISO8601Date,
  Email,
  AsyncReturnType,
  NullableKeys,
  EmptyObject,
  StringRecord,
} from './utils';
