import codecs
from _typeshed import ReadableBuffer

HEXDIGITS: str

def hex_encode(data: str, errors: str = ...) -> tuple[bytes, int]: ...
def hex_decode(data: bytes, errors: str = ...) -> tuple[str, int]: ...

class Codec(codecs.Codec):
    def encode(self, data: str, errors: str = ...) -> tuple[bytes, int]: ...
    def decode(self, data: bytes, errors: str = ...) -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
    state: int
    def encode(self, data: str, final: bool = ...) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, data: ReadableBuffer, final: bool = ...) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...
