"""type stubs for tomlkit

with all my heart, 2025-2026, mark joshwel <mark@joshwel.co>
SPDX-License-Identifier: Unlicense OR 0BSD
"""

from collections.abc import Iterator
from typing import ItemsView, KeysView, ValuesView, overload

class Item:
    @overload
    def get(self, key: str) -> "Item | None": ...
    @overload
    def get(self, key: str, default: "Item") -> "Item": ...
    def __getitem__(self, key: str) -> "Item": ...
    def __setitem__(self, key: str, value: "Item | str") -> None: ...
    def __contains__(self, key: str) -> bool: ...
    def __iter__(self) -> "Iterator[str]": ...
    def keys(self) -> KeysView[str]: ...
    def values(self) -> ValuesView["Item"]: ...
    def items(self) -> ItemsView[str, "Item"]: ...

class Container(Item):
    pass

class TOMLDocument(Container):
    @overload
    def get(self, key: str) -> "Item | None": ...
    @overload
    def get(self, key: str, default: "Item") -> "Item": ...

class Table(Container):
    @overload
    def get(self, key: str) -> "Item | None": ...
    @overload
    def get(self, key: str, default: "Item") -> "Item": ...

def parse(text: str) -> TOMLDocument: ...
def document() -> TOMLDocument: ...
def table() -> Table: ...
def dumps(doc: TOMLDocument) -> str: ...
