"""
Models for wittrans.

SPDX-FileCopyrightText: 2024 Jiri Grönroos <jiri.gronroos@iki.fi>

SPDX-License-Identifier: LGPL-3.0-or-later
"""

from pathlib import Path
from typing import List, NamedTuple


class TranslationMatch(NamedTuple):
    """A single translation entry from a .mo file."""

    original: str
    translation: str
    context: str | None


class FileResult(NamedTuple):
    """Search results for a single .mo file."""

    file_path: Path
    matches: list[TranslationMatch]


class TranslationPaths(NamedTuple):
    """Container for categorized translation paths found on a Linux system."""

    system_locale: List[Path]
    user_locale: List[Path]
    system_gnome_extensions: List[Path]
    system_kde_plasmoids: List[Path]
    user_gnome_extensions: List[Path]
    user_kde_plasmoids: List[Path]
    system_flatpak: List[Path]
    user_flatpak: List[Path]


class SearchStatistics(NamedTuple):
    """Statistics related to search operation."""

    directories_searched: int
    mo_files_found: int
    total_matches: int
    search_duration_seconds: float
