from __future__ import annotations

class HPACKError(Exception): ...
class OversizedHeaderListError(Exception): ...

class Encoder:
    def __init__(self) -> None: ...
    @property
    def header_table_size(self) -> int: ...
    @header_table_size.setter
    def header_table_size(self, value: int) -> None: ...
    def encode(
        self,
        headers: list[tuple[bytes, bytes, bool]],
        huffman: bool | None = None,
    ) -> bytes: ...
    def add(
        self,
        header: tuple[bytes, bytes],
        sensitive: bool,
        huffman: bool | None = None,
    ) -> bytes: ...

class Decoder:
    def __init__(self, max_header_list_size: int | None = None) -> None: ...
    @property
    def header_table_size(self) -> int: ...
    @header_table_size.setter
    def header_table_size(self, value: int) -> None: ...
    @property
    def max_allowed_table_size(self) -> int: ...
    @max_allowed_table_size.setter
    def max_allowed_table_size(self, value: int) -> None: ...
    @property
    def max_header_list_size(self) -> int: ...
    @max_header_list_size.setter
    def max_header_list_size(self, value: int) -> None: ...
    def decode(
        self, data: bytes, raw: bool | None = None
    ) -> list[tuple[bytes | str, bytes | str, bool]]: ...
