import type {
  SignItem,
  SignLanguagePageContent,
} from '@/shared/types/app';
import type {
  SignLanguageCategoryFilter,
  SignLanguageViewMode,
} from '@/shared/constants/signLanguage';

export interface SignLanguageCategoryOption {
  readonly value: SignLanguageCategoryFilter;
  readonly label: string;
  readonly count: number;
}

export interface SignLanguageFilters {
  readonly searchQuery: string;
  readonly categoryFilter: SignLanguageCategoryFilter;
}

export interface SignLanguageVideoModalState {
  readonly showSteps: boolean;
  readonly viewMode: SignLanguageViewMode;
  readonly gifLoaded: boolean;
  readonly gifError: boolean;
  readonly showStepGuide: () => void;
  readonly hideStepGuide: () => void;
  readonly toggleStepGuide: () => void;
  readonly setViewMode: (viewMode: SignLanguageViewMode) => void;
  readonly markGifLoaded: () => void;
  readonly markGifFailed: () => void;
}

export interface SignLanguagePage {
  readonly signs: readonly SignItem[];
  readonly filteredSigns: readonly SignItem[];
  readonly categories: readonly SignLanguageCategoryOption[];
  readonly filters: SignLanguageFilters;
  readonly learnedSignIds: ReadonlySet<string>;
  readonly learnedCount: number;
  readonly progressPercent: number;
  readonly selectedSign: SignItem | null;
  readonly pageContent: SignLanguagePageContent;
  readonly isLoading: boolean;
  readonly isSaving: boolean;
  readonly signsError: Error | null;
  readonly pageContentError: Error | null;
  readonly progressErrorMessage: string | null;
  readonly setSearchQuery: (value: string) => void;
  readonly clearSearch: () => void;
  readonly setCategoryFilter: (value: SignLanguageCategoryFilter) => void;
  readonly selectSign: (id: string) => void;
  readonly closeSign: () => void;
  readonly toggleLearned: (id: string) => Promise<void>;
}
