from _typeshed import ReadableBuffer
from typing import Literal
from cramjam import Buffer, BufferInput, BufferOutput

def decompress(data: BufferInput, output_len: int | None = None) -> Buffer: ...
def compress(data: BufferInput, level: int | None = None, output_len: int | None = None) -> Buffer: ...
def compress_into(input: BufferInput, output: BufferOutput, level: int | None = None) -> int: ...
def decompress_into(input: BufferInput, output: BufferOutput) -> int: ...
def decompress_block(data: BufferInput, output_len: int | None = None) -> Buffer: ...
def compress_block(
    data: BufferInput,
    output_len: int | None = None,
    mode: Literal["default", "fast", "high_compression"] | None = None,
    acceleration: int | None = None,
    compression: int | None = None,
    store_size: bool | None = None,
) -> Buffer: ...
def decompress_block_into(input: BufferInput, output: BufferOutput, output_len: int | None = None) -> int: ...
def compress_block_into(
    data: BufferInput,
    output: BufferOutput,
    mode: Literal["default", "fast", "high_compression"] | None = None,
    acceleration: int | None = None,
    compression: int | None = None,
    store_size: bool | None = None,
) -> int: ...
def compress_block_bound(src: BufferInput) -> int: ...

class Compressor:
    def __init__(
        self,
        level: int | None = None,
        content_checksum: bool | None = None,
        block_linked: bool | None = None,
    ) -> None: ...
    def compress(self, input: ReadableBuffer) -> int: ...
    def flush(self) -> Buffer: ...
    def finish(self) -> Buffer: ...

class Decompressor:
    def __init__(self) -> None: ...
    def len(self) -> int: ...
    def decompress(self, input: BufferInput) -> int: ...
    def flush(self) -> Buffer: ...
    def finish(self) -> Buffer: ...
    def __len__(self) -> int: ...
    def __contains__(self, x: BufferInput) -> bool: ...
    def __repr__(self) -> str: ...
    def __bool__(self) -> bool: ...
