"""Shared data types.""" from __future__ import annotations from typing import NamedTuple, TypedDict try: # Python < 3.11 from typing_extensions import NotRequired except ImportError: # pragma: no cover # Python >= 3.11 from typing import NotRequired class ImageItem(TypedDict): url: str name: str sheet: NotRequired[str] row: NotRequired[int] column: NotRequired[str] class DuplicateRecord(TypedDict): url: str sheet: str row: int column: str name: str original_sheet: str original_row: int original_column: str original_name: str class WhiteBackgroundRecord(TypedDict): url: str name: str sheet: str row: int column: str class WorkbookParseResult(NamedTuple): items: list[ImageItem] summary: str duplicates: list[DuplicateRecord] duplicates_text: str class ProcessResult(NamedTuple): files: list[str] | None zip_path: str | None message: str tmp_dir: str | None white_bg_text: str = ""