__all__ = ...  # type: List[str]

# Special-cased by the parser
class Any: ...
TypeVar: Any
Optional: Any
Union: Any

AnyStr = TypeVar('AnyStr', str, bytes)
_ARGS = TypeVar('_ARGS')
_RET = TypeVar('_RET')

# "_T", "_K", and "_V" are hardcoded in abstract.py
_T = TypeVar('_T')
_K = TypeVar('_K')
_V = TypeVar('_V')
_K2 = TypeVar('_K2')
_V2 = TypeVar('_V2')
_T2 = TypeVar('_T2')
_T_IO = TypeVar('_T_IO', bound=IO)

# Used by ChainMap to approximate a variadic type variable.
_K1 = TypeVar('_K1')
_K3 = TypeVar('_K3')
_K4 = TypeVar('_K4')
_V1 = TypeVar('_V1')
_V3 = TypeVar('_V3')
_V4 = TypeVar('_V4')


Text = str


# These functions do not exist in typing.py. They are here for documentation
# purposes and to make it easier for pytype to type-check arguments to TypeVar
# and ParamSpec.
def _typevar_new(
    name: str, *constraints: type | str | None, bound: type | str | None = None,
    covariant: bool = False, contravariant: bool = False): ...
def _paramspec_new(
    name: str, *constraints: type | str | None, bound: type | str | None = None,
    covariant: bool = False, contravariant: bool = False): ...


class Callable(Generic[_ARGS, _RET], Protocol):
  __annotations__: Dict[str, Any]
  __kwdefaults__: Dict[str, Any]
  __qualname__: str
  __closure__: Optional[Tuple[Any, ...]]
  __code__: Any
  __defaults__: Optional[Tuple[Any, ...]]
  __globals__: Dict[str, Any]
  # Copied from types.FunctionType.__init__ with some types changed to Any.
  def __init__(self, code: Any, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[Any, ...]] = ...) -> None:
    self = Callable[..., Any]
  @abstractmethod
  def __call__(self, *args, **kwargs) -> _RET: ...


class Generic(object):
  __slots__ = []


# This class is the implementation of PEP 586
# (https://www.python.org/dev/peps/pep-0586/)
class Literal(Generic[_T]):
  __slots__ = []


# This class is the implementation of PEP 544
# (https://www.python.org/dev/peps/pep-0544/)
class Protocol(object):
  __slots__ = []


class SupportsInt(Protocol):
  __slots__ = []
  @abstractmethod
  def __int__(self) -> int: ...


class SupportsFloat(Protocol):
  __slots__ = []
  @abstractmethod
  def __float__(self) -> float: ...


class SupportsComplex(Protocol):
  __slots__ = []
  @abstractmethod
  def __complex__(self) -> complex: ...


class SupportsAbs(Generic[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __abs__(self) -> _T: ...


class SupportsRound(Generic[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __round__(self, ndigits: int = ...) -> _T: ...


class SupportsBytes(Protocol):
  __slots__ = []
  @abstractmethod
  def __bytes__(self) -> bytes: ...


class Reversible(Generic[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __reversed__(self) -> Iterator[_T]: ...


class Iterator(Iterable[_T], Protocol):
  __slots__ = []
  def __iter__(self) -> Iterator[_T]: ...
  @abstractmethod
  def __next__(self) -> _T: ...


class Iterable(Generic[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __iter__(self) -> Iterator[_T]: ...


class Sized(Protocol):
  __slots__ = []
  @abstractmethod
  def __len__(self) -> int: ...


class Hashable(Protocol):
  __slots__ = []
  @abstractmethod
  def __hash__(self) -> int: ...


class Container(Generic[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __contains__(self, x) -> bool: ...


class Sequence(Sized, Iterable[_T], Container[_T], Reversible[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __getitem__(self, i: int) -> _T: ...
  @abstractmethod
  def __getitem__(self, s: slice) -> Sequence[_T]: ...
  def __getslice__(self, *args, **kwargs) -> Sequence[_T]: ...
  def index(self, x) -> int: ...
  def count(self, x) -> int: ...
  def __contains__(self, x) -> bool: ...
  def __iter__(self) -> Iterator[_T]: ...
  def __reversed__(self) -> Iterator[_T]: ...


class Collection(Sized, Iterable[_T], Container[_T], Protocol):
  __slots__ = []


class Tuple(Sequence[_T]):
  __slots__ = []
  def __len__(self) -> int: ...


class MutableSequence(Sequence[_T], Protocol):
  __slots__ = []
  @overload
  @abstractmethod
  def __getitem__(self, index: int) -> _T: ...
  @overload
  @abstractmethod
  def __getitem__(self, index: slice) -> MutableSequence[_T]: ...
  @overload
  @abstractmethod
  def __setitem__(self, i: int, v: _T2) -> None:
    self = MutableSequence[Union[_T, _T2]]
  @abstractmethod
  def __setitem__(self, i: slice, v: Iterable[_T2]) -> None:
    self = MutableSequence[Union[_T, _T2]]
  @abstractmethod
  def __delitem__(self, i: Union[int, slice]) -> None: ...
  def __add__(self, x: Iterable[_T2]) -> MutableSequence[Union[_T, _T2]]: ...
  def append(self, v: _T2) -> None:
    self = MutableSequence[Union[_T, _T2]]
  def clear(self) -> None: ...
  def extend(self, iterable: Iterable[_T2]) -> None:
    self = MutableSequence[Union[_T, _T2]]
  @abstractmethod
  def insert(self, i: int, v: _T2) -> None:
    self = MutableSequence[Union[_T, _T2]]
  def reverse(self) -> None: ...
  def pop(self, index: int = ...) -> _T: ...
  def remove(self, value: _T) -> None: ...


class List(MutableSequence[_T]):
  __slots__ = []
  __hash__ = ...  # type: None
  def __len__(self) -> int: ...


# typing.Deque subclasses collections.deque and MutableSequence[_T], but there's
# no actual way to represent that without introducing an import cycle.
class Deque(MutableSequence[_T]):
  maxlen = ...  # type: Optional[int]
  def __init__(self, iterable: Iterable[_T] = ..., maxlen: Optional[int] = ...) -> None:
    self = Deque[_T]
  def appendleft(self, v: _T2) -> None:
    self = Deque[Union[_T, _T2]]
  def clear(self) -> None:
    self = Deque[nothing]
  def copy(self) -> Deque[_T]: ...
  def extendleft(self, iterable: Iterable[_T2]) -> None:
    self = Deque[Union[_T, _T2]]
  def popleft(self, index: int = ...) -> _T: ...
  def rotate(self, steps: int = ...) -> None: ...


class IO(Iterator[AnyStr]):
  name = ...  # type: str
  mode = ...  # type: str
  closed = ...  # type: bool
  newlines = ...  # type: Union[None, str, Tuple[str,...]]
  def __enter__(self: _T_IO) -> _T_IO: ...
  def __exit__(self, t, value, traceback) -> None: ...
  def __iter__(self) -> Iterator[AnyStr]: ...
  def __next__(self) -> AnyStr: ...
  def close(self) -> None: ...
  def fileno(self) -> int: ...
  def flush(self) -> None: ...
  def isatty(self) -> bool: ...
  def read(self, n: int = ...) -> AnyStr: ...
  def readable(self) -> bool: ...
  def readline(self, limit: int = ...) -> AnyStr: ...
  def readlines(self, hint: int = ...) -> list[AnyStr]: ...
  def seek(self, offset: int, whence: int = ...) -> int: ...
  def seekable(self) -> bool: ...
  def tell(self) -> int: ...
  def truncate(self, size: Optional[int] = ...) -> int: ...
  def writable(self) -> bool: ...
  def write(self, s: AnyStr) -> int: ...
  def writelines(self, lines: Iterable[AnyStr]) -> None: ...


class BinaryIO(IO[bytes]): ...


class TextIO(IO[str]):
  buffer: BinaryIO
  encoding: str
  errors: Optional[str]
  line_buffering: int
  newlines: Optional[Union[str, Tuple[str, ...]]]


class Mapping(Sized, Iterable[_K], Container[_K], Generic[_K, _V], Protocol):
  __slots__ = []
  def copy(self) -> Mapping[_K, _V]: ...
  def __contains__(self, o) -> bool: ...
  @abstractmethod
  def __getitem__(self, key: _K) -> _V: ...
  def get(self, k) -> Union[_V, NoneType]: ...
  def get(self, k, d: _V2) -> Union[_V, _V2]: ...
  # Using ItemsView here breaks if-splitting, for some reason.
  def items(self) -> AbstractSet[Tuple[_K, _V]]: ...
  def keys(self) -> KeysView[_K]: ...
  def values(self) -> ValuesView[_V]: ...


class MutableMapping(Mapping[_K, _V], Protocol):
  __slots__ = []
  def copy(self) -> MutableMapping[_K, _V]: ...
  @abstractmethod
  def __setitem__(self, k: _K2, v: _V2) -> None:
    self = MutableMapping[Union[_K, _K2], Union[_V, _V2]]
  @abstractmethod
  def __delitem__(self, k) -> None: ...
  def clear(self) -> None:
    self = MutableMapping[nothing, nothing]
  def pop(self, k, default: _V2 = ...) -> Union[_V, _V2]: ...
  def popitem(self) -> Tuple[_K, _V]: ...
  def setdefault(self, k: _K2, default: _V2 = ...) -> Union[_V, _V2]:
    self = MutableMapping[Union[_K, _K2], Union[_V, _V2]]
  def update(self, m: Mapping[_K2, _V2]) -> None:
    self = MutableMapping[Union[_K, _K2], Union[_V, _V2]]
  def update(self, m: Iterable[Tuple[_T, ...]]) -> None:
    self = MutableMapping[Union[_K, _T], Union[_V, _T]]


class Dict(MutableMapping[_K, _V]):
  __slots__ = []
  def __getitem__(self, key: _K) -> _V: ...
  def __len__(self) -> int: ...


class DefaultDict(Dict[_K, _V]): ...


class OrderedDict(Dict[_K, _V]):
  def popitem(self, last: bool = ...) -> Tuple[_K, _V]: ...
  def move_to_end(self, key: _K, last: bool = ...) -> None: ...
  def __reversed__(self) -> Iterator[_K]: ...
  def keys(self) -> KeysView[_K]: ...
  def items(self) -> ItemsView[_K, _V]: ...
  def values(self) -> ValuesView[_V]: ...


class AbstractSet(Sized, Iterable[_T], Container[_T]):
  __slots__ = []
  def __contains__(self, x) -> bool: ...
  def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T]: ...
  def __or__(self, s: AbstractSet[_T2]) -> AbstractSet[Union[_T, _T2]]: ...
  def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T]: ...
  def __xor__(self, s: AbstractSet[_T2]) -> AbstractSet[Union[_T, _T2]]: ...
  def isdisjoint(self, s: Iterable) -> bool: ...


class FrozenSet(AbstractSet[_T]):
  __slots__ = []
  def __len__(self) -> int: ...


class MutableSet(AbstractSet[_T]):
  __slots__ = []
  def add(self, x: _T2) -> None:
    self = MutableSet[Union[_T, _T2]]
  def discard(self, x) -> None: ...
  def clear(self) -> None:
    self = MutableSet[nothing]
  def pop(self) -> _T: ...
  def remove(self, element: _T) -> None: ...
  def __or__(self, s: AbstractSet[_T2]) -> MutableSet[Union[_T, _T2]]: ...
  def __and__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ...
  def __xor__(self, s: AbstractSet[_T2]) -> MutableSet[Union[_T, _T2]]: ...
  def __sub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ...


class Set(MutableSet[_T]):
  __slots__ = []
  def __len__(self) -> int: ...


# _T is the yield type, _T2 the send type, _V the return type.
class Generator(Iterator[_T], Generic[_T, _T2, _V]):
  __slots__ = []
  gi_code: Any  # Should be types.CodeType
  gi_frame: Any  # Should be types.FrameType
  gi_running: bool
  gi_yieldfrom: Optional[Generator[Any, Any, Any]]
  def __next__(self) -> _T: ...
  def send(self, value: _T2) -> _T: ...
  def throw(self, typ: BaseException, val = ..., tb = ...) -> _T: ...
  def close(self) -> None: ...


class Type(Generic[_T]): ...


# Replaced by re.Match and re.Pattern in the typing overlay.
class Match(Generic[AnyStr]): ...
class Pattern(Generic[AnyStr]): ...


# Used to mark attributes as class-level, as opposed to instance-level.
class ClassVar(Generic[_T]): ...


ByteString = Union[bytes, bytearray, memoryview]


# TODO(tsudol): Should be covariant, e.g. _T_co. traceback arg for __exit__
# should be types.TracebackType.
class ContextManager(Generic[_T], Protocol):
  @abstractmethod
  def __enter__(self) -> _T: ...
  @abstractmethod
  def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[Any]) -> Optional[bool]: ...


# Note: These *View classes technically aren't reversible until Python 3.8. But
# we pretend that they are in 3.7 so that we can use them directly as the return
# types for the corresponding OrderedDict methods rather than subclassing them.

class MappingView(Sized, Iterable[_T]):
  __slots__ = []

class KeysView(MappingView[_T], AbstractSet[_T]):
  __slots__ = []
  def __init__(self, mapping: Mapping[_T, _V]) -> None: ...
  def __contains__(self, o: object) -> bool: ...
  def __reversed__(self) -> Iterator[_T]: ...

class ValuesView(MappingView[_T]):
  __slots__ = []
  def __init__(self, mapping: Mapping[_K, _T]) -> None: ...
  def __contains__(self, o: object) -> bool: ...
  def __reversed__(self) -> Iterator[_T]: ...

class ItemsView(MappingView[Tuple[_K, _V]], AbstractSet[Tuple[_K, _V]]):
  __slots__ = []
  def __init__(self, mapping: Mapping[_K, _V]) -> None: ...
  def __contains__(self, o: object) -> bool: ...
  def __reversed__(self) -> Iterator[tuple[_K, _V]]: ...

NoReturn = nothing
Never = nothing

# We special-case this internally, we just need the class to exist within typing.
class NamedTuple:
    __slots__ = []

def _NamedTuple(typename: Text, fields: Sequence[Sequence[Union[Text, type]]]) -> Any: ...

# A more precise (but incorrect) fields type for error messages.
_NamedTupleFields = List[Tuple[Text, type]]

def NewType(name: str, tp: type) -> type: ...

def cast(typ: Type[_T], val) -> _T: ...

def overload(func: _T) -> _T: ...
def no_type_check(arg: _T) -> _T: ...
def no_type_check_decorator(decorator) -> Callable: ...
def type_check_only(arg: _T) -> _T: ...

def get_type_hints(
    obj: Any,
    globalns: dict[str, Any] | None = ...,
    localns: dict[str, Any] | None = ...,
    include_extras: bool = ...,
) -> dict[str, Any]: ...

def runtime_checkable(cls: _T) -> _T: ...

def get_origin(tp: Any) -> Optional[Any]: ...
def get_args(tp: Any) -> Tuple[Any, ...]: ...


# Strictly speaking, this should be Dict[_K, _V]. (E.g. it's legal to do
# typing.Counter()[x] = 'foobar'.) But the counts are typically integers.
class Counter(Dict[_K, int]):
  __doc__ = ...  # type: str
  fromkeys = ...  # type: classmethod
  def __add__(self, other: Counter[_K2]) -> Counter[Union[_K, _K2]]: ...
  def __and__(self, other: Counter[_K]) -> Counter[_K]: ...
  def __delitem__(self, elem) -> None: ...
  def __iadd__(self, other: Counter[_K2]) -> Counter[Union[_K, _K2]]:
    self = Counter[Union[_K, _K2]]
  def __iand__(self, other: Counter[_K]) -> Counter[_K]: ...
  def __ior__(self, other: Counter[_K2]) -> Counter[Union[_K, _K2]]:
    self = Counter[Union[_K, _K2]]
  def __isub__(self, other: Counter[_K]) -> Counter[_K]: ...
  def __init__(self, *args, **kwargs) -> None: ...
  def __missing__(self, key) -> int: ...
  def __neg__(self) -> Counter[_K]: ...
  def __or__(self, other: Counter[_K2]) -> Counter[Union[_K, _K2]]: ...
  def __pos__(self) -> Counter[_K]: ...
  def __reduce__(self) -> Tuple: ...
  def __repr__(self) -> str: ...
  def __sub__(self, other: Counter[_K]) -> Counter[_K]: ...
  def copy(self) -> Counter[_K]: ...
  def elements(self) -> Iterable[_K]: ...
  def most_common(self, n: Optional[int] = ...) -> List[Tuple[_K, int]]: ...
  def subtract(self, other: Iterable) -> None: ...
  def update(self, other: Iterable) -> None: ...
  if sys.version_info >= (3, 10):
    def __lt__(self, other: Counter) -> bool: ...
    def __le__(self, other: Counter) -> bool: ...
    def __eq__(self, other: object) -> bool: ...
    def __ne__(self, other: object) -> bool: ...
    def __ge__(self, other: Counter) -> bool: ...
    def __gt__(self, other: Counter) -> bool: ...
    def total(self) -> int: ...


class AsyncIterable(Generic[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __aiter__(self) -> AsyncIterator[_T]: ...

class AsyncIterator(AsyncIterable[_T], Protocol):
  __slots__ = []
  @abstractmethod
  def __anext__(self) -> Awaitable[_T]: ...

class ChainMap(MutableMapping[_K, _V]):
  maps: List[MutableMapping[_K, _V]]
  parents: ChainMap[_K, _V]
  def __init__(self) -> None:
    self = ChainMap[nothing, nothing]
  def __init__(self, map1: MutableMapping[_K1, _V1]) -> None:
    self = ChainMap[_K1, _V1]
  def __init__(
      self,
      map1: MutableMapping[_K1, _V1],
      map2: Mapping[_K2, _V2]
  ) -> None:
    self = ChainMap[Union[_K1, _K2], Union[_V1, _V2]]
  def __init__(
      self,
      map1: MutableMapping[_K1, _V1],
      map2: Mapping[_K2, _V2],
      map3: Mapping[_K3, _V3]
  ) -> None:
    self = ChainMap[Union[_K1, _K2, _K3], Union[_V1, _V2, _V3]]
  def __init__(
      self,
      map1: MutableMapping[_K1, _V1],
      map2: Mapping[_K2, _V2],
      map3: Mapping[_K3, _V3],
      map4: Mapping[_K4, _V4]
  ) -> None:
    self = ChainMap[Union[_K1, _K2, _K3, _K4], Union[_V1, _V2, _V3, _V4]]
  def __init__(self, *maps: MutableMapping[Any, Any]) -> None:
    self = ChainMap[Any, Any]
  def __delitem__(self, k) -> None: ...
  def __getitem__(self, key: _K) -> _V: ...
  def __iter__(self) -> Iterator[_K]: ...
  def __len__(self) -> int: ...
  def __setitem__(self, k: _K2, v: _V2) -> None:
    self = ChainMap[Union[_K, _K2], Union[_V, _V2]]
  def new_child(self, m: None = ...) -> ChainMap[_K, _V]: ...
  def new_child(
    self, m: Mapping[_K2, _V2]
  ) -> ChainMap[Union[_K, _K2], Union[_V2, _V2]]: ...

class Awaitable(Generic[_T], Protocol):
  @abstractmethod
  def __await__(self) -> Generator[Any, None, _T]: ...

class Coroutine(Awaitable[_V], Generic[_T, _T2, _V]):
  __slots__ = []
  @abstractmethod
  def send(self, value: _T2) -> _T: ...
  @abstractmethod
  def throw(self, typ: Type[BaseException], val = ..., tb = ...) -> _T: ...
  @abstractmethod
  def close(self) -> None: ...

class AsyncContextManager(Generic[_T], Protocol):
  @abstractmethod
  def __aenter__(self) -> Awaitable[_T]: ...
  @abstractmethod
  def __aexit__(self, exc_type: Optional[Type[BaseException]],
                exc_value: Optional[BaseException],
                traceback: Optional[Any]) -> Awaitable[Optional[bool]]: ...

# _T is the yield type, _T2 the send type
class AsyncGenerator(AsyncIterator[_T], Generic[_T, _T2]):
  __slots__ = []
  @abstractmethod
  def __anext__(self) -> Coroutine[Any, Any, _T]: ...
  @abstractmethod
  def asend(self, value: _T2) -> Coroutine[Any, Any, _T]: ...
  @abstractmethod
  def athrow(self, typ: Type[BaseException], val = ..., tb = ...) -> Coroutine[Any, Any, _T]: ...
  @abstractmethod
  def aclose(self) -> Coroutine[Any, Any, None]: ...

TYPE_CHECKING = ...  # type: bool

# This does not exist at runtime; it needs to be here because it's used by
# typeshed (specifically, typing_extensions.pyi).
class _Alias:
    def __getitem__(self, typeargs: Any) -> Any: ...

class ForwardRef:
    __forward_arg__: str
    __forward_code__: Any
    __forward_evaluated__: bool
    __forward_value__: Any | None
    __forward_is_argument__: bool
    __forward_is_class__: bool
    __forward_module__: Any | None
    if sys.version_info >= (3, 9):
        # The module and is_class arguments were added in later Python 3.9 versions.
        def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ...
    else:
        def __init__(self, arg: str, is_argument: bool = True) -> None: ...

    if sys.version_info >= (3, 9):
        def _evaluate(
            self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None, recursive_guard: frozenset[str]
        ) -> Any | None: ...
    else:
        def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ...

    def __eq__(self, other: object) -> bool: ...
    def __hash__(self) -> int: ...
    if sys.version_info >= (3, 11):
        def __or__(self, other: Any) -> Any: ...
        def __ror__(self, other: Any) -> Any: ...

# When adding a typing construct that is not available in all runtime versions,
# do *not* add a sys.version_info guard here, as that would prevent us from
# reusing the definition for typing_extensions. Instead, go to
# pytype/overlays/typing_overlay and add the lowest supported version to the
# typing_overlay dict.

# Python 3.8
def final(x: _T) -> _T: ...

class Final(Generic[_T]): ...

class SupportsIndex(Protocol):
    __slots__ = []
    @abstractmethod
    def __index__(self) -> int: ...

# Pytd class for typed dicts, used as the pyval for typing_extensions.TypedDict
# before 3.8 and typing.TypedDict thereafter.
class TypedDict(Mapping[str, object]):
    if sys.version_info >= (3, 9):
        __required_keys__: ClassVar[frozenset[str]]
        __optional_keys__: ClassVar[frozenset[str]]

# Internal pytd signature for the TypedDict functional constructor.
def _TypedDictFunction(name: str, fields: Dict[str, Any], *, total: bool = ...): ...

def is_typeddict(tp: object) -> bool: ...

# Python 3.9
class Annotated: ...

# Python 3.10
class TypeAlias: ...

class Concatenate: ...
class ParamSpec: ...
class ParamSpecArgs: ...
class ParamSpecKwargs: ...

class TypeGuard(bool, Generic[_T]): ...
class TypeIs(bool, Generic[_T]): ...

def is_typeddict(tp) -> bool: ...

# Python 3.11
LiteralString = str  # TODO(b/303083512): Support LiteralString
class Required(Generic[_T]): ...
class NotRequired(Generic[_T]): ...
Self = TypeVar('Self')
class TypeVarTuple: ...
class Unpack(Generic[_T]): ...

def assert_type(val, typ, /): ...
def assert_never(arg: Never, /) -> Never: ...
def reveal_type(obj, /): ...
def dataclass_transform(*, eq_default = ..., order_default = ..., kw_only_default = ..., field_specifiers = ..., **kwargs) -> Callable[[_T], _T]: ...
def get_overloads(func): ...
def clear_overloads(): ...

# Python 3.12
def override(method: _T) -> _T: ...

class TypeAliasType:
    def __init__(
        self, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()
    ) -> None: ...
    @property
    def __value__(self) -> Any: ...
    @property
    def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ...
    @property
    def __parameters__(self) -> tuple[Any, ...]: ...
    @property
    def __name__(self) -> str: ...
    # It's writable on types, but not on instances of TypeAliasType.
    @property
    def __module__(self) -> str | None: ...  # type: ignore[override]
    def __getitem__(self, parameters: Any) -> Any: ...
    def __or__(self, right: Any) -> Any: ...
    def __ror__(self, left: Any) -> Any: ...
