from typing import TypedDict, List, Dict, Optional class Detail(TypedDict): title: str content: str class Card(TypedDict, total=False): title: str content: str details: List[Detail] class Section(TypedDict): title: str content: str cards: List[Card] class PageData(TypedDict): title: Optional[str] sections: List[Section] class PageMeta(TypedDict, total=False): title: str description: str keywords: str og_description: str favicon: str twitter_image: str og_image: str class PageEntry(TypedDict, total=False): page_title: str page_subtitle: str page_cta: str page_cta_url: str meta: PageMeta active: bool PagesDict = Dict[str, PageEntry] class ParserState(TypedDict): page: PageData current_section: Optional[Section] current_card: Optional[Card] current_detail: Optional[Detail] content_buffer: List[str] detail_buffer: List[str]