from array import array
from mmap import mmap
from typing import Optional, Union

class LZOError(Exception): ...
class InputNotConsumed(LZOError): ...

class EResult:
    LookbehindOverrun = ...
    OutputOverrun = ...
    InputOverrun = ...
    Error = ...
    InputNotConsumed = ...

_BufferType = Union[array[int], bytes, bytearray, memoryview, mmap]

class LZOCompressor:
    def compress(self, data: _BufferType) -> bytes: ...
    @staticmethod
    def decompress(
        data: _BufferType, output_size_hint: Optional[int] = None
    ) -> bytes: ...
