from typing import Any, Optional, Tuple

from .asn1 import TClass, TNumber, TType

class Tag:
    number: TNumber
    typ: TType
    cls: TClass

class Error(Exception): ...

class Encoder:
    def __init__(self) -> None: ...
    def enter(self, number: TNumber, cls: Optional[TClass] = None) -> None: ...
    def exit(self) -> None: ...
    def write(
        self, value: Any, number: Optional[TNumber] = None, typ: Optional[TType] = None, cls: Optional[TClass] = None
    ) -> None: ...
    def output(self) -> bytes: ...

class Decoder:
    def __init__(self, data: bytes) -> None: ...
    def peek(self) -> Tag: ...
    def read(self, number: Optional[TNumber] = None) -> Tuple[Tag, Any]: ...
    def eof(self) -> bool: ...
    def enter(self) -> None: ...
    def exit(self) -> None: ...
