from typing import Any, List, Mapping, Optional, Tuple, overload

_Option = Tuple[str, Optional[str], str]
_GR = Tuple[List[str], OptionDummy]

def fancy_getopt(
    options: List[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: List[str] | None
) -> List[str] | _GR: ...
def wrap_text(text: str, width: int) -> List[str]: ...

class FancyGetopt:
    def __init__(self, option_table: List[_Option] | None = ...) -> None: ...
    # TODO kinda wrong, `getopt(object=object())` is invalid
    @overload
    def getopt(self, args: List[str] | None = ...) -> _GR: ...
    @overload
    def getopt(self, args: List[str] | None, object: Any) -> List[str]: ...
    def get_option_order(self) -> List[Tuple[str, str]]: ...
    def generate_help(self, header: str | None = ...) -> List[str]: ...

class OptionDummy: ...
