from _typeshed import Incomplete
from collections.abc import Iterator
from typing import Any, TypeAlias

def tag_in_exception(tag: BaseTag) -> Iterator[None]: ...

TagType: TypeAlias
TagListType: Incomplete

def Tag(arg: TagType, arg2: int | None = None) -> BaseTag: ...

class BaseTag(int):
    def __le__(self, other: Any) -> Any: ...
    def __lt__(self, other: Any) -> Any: ...
    def __ge__(self, other: Any) -> Any: ...
    def __gt__(self, other: Any) -> Any: ...
    def __eq__(self, other: Any) -> Any: ...
    def __ne__(self, other: Any) -> Any: ...
    __hash__: Incomplete
    @property
    def json_key(self) -> str: ...
    @property
    def group(self) -> int: ...
    @property
    def element(self) -> int: ...
    elem = element
    @property
    def is_private(self) -> bool: ...
    @property
    def is_private_creator(self) -> bool: ...
    @property
    def private_creator(self) -> BaseTag: ...

def TupleTag(group_elem: tuple[int, int]) -> BaseTag: ...

ItemTag: Incomplete
ItemDelimiterTag: Incomplete
SequenceDelimiterTag: Incomplete
TAG_PIXREP: Incomplete
TAG_CHARSET: Incomplete
