import codecs
from typing import Optional, Tuple

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

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    @staticmethod
    def _buffer_decode(__data: bytes, __errors: Optional[str] = ..., __final: bool = ...) -> Tuple[str, int]: ...

class StreamWriter(codecs.StreamWriter):
    @staticmethod
    def encode(__str: str, __errors: Optional[str] = ...) -> Tuple[bytes, int]: ...

class StreamReader(codecs.StreamReader):
    @staticmethod
    def decode(__data: bytes, __errors: Optional[str] = ..., __final: bool = ...) -> Tuple[str, int]: ...

def getregentry() -> codecs.CodecInfo: ...
def encode(__str: str, __errors: Optional[str] = ...) -> Tuple[bytes, int]: ...
def decode(input: bytes, errors: Optional[str] = ...) -> Tuple[str, int]: ...
