from __future__ import annotations

from collections.abc import AsyncIterator, Coroutine, Iterator
from typing import Any

class BytesRingBuffer:
    def __init__(
        self,
        max_capacity: int,
        disable_async: bool = False,
        only_insert_unique: bool = False,
    ) -> None: ...
    def raw(self, copy: bool = True) -> list[bytes]: ...
    def unwrapped(self) -> list[bytes]: ...
    def overwrite_latest(self, item: bytes, increment_count: bool = False) -> None: ...
    def insert(self, item: bytes) -> None: ...
    def insert_batch(self, items: list[bytes]) -> None: ...
    def contains(self, item: bytes) -> bool: ...
    def consume(self) -> bytes: ...
    def consume_all(self) -> list[bytes]: ...
    def consume_iterable(self) -> Iterator[bytes]: ...
    def aconsume(self) -> Coroutine[Any, Any, bytes]: ...
    def aconsume_iterable(self) -> AsyncIterator[bytes]: ...
    def peekright(self) -> bytes: ...
    def peekleft(self) -> bytes: ...
    def clear(self) -> None: ...
    def is_empty(self) -> bool: ...
    def is_full(self) -> bool: ...
    def __contains__(self, item: bytes) -> bool: ...
    def __len__(self) -> int: ...
    def __getitem__(self, idx: int) -> bytes: ...

class BytesRingBufferFast:
    def __init__(
        self,
        max_capacity: int,
        disable_async: bool = False,
        only_insert_unique: bool = False,
        expected_item_size: int = 128,
        buffer_percent: float = 25.0,
    ) -> None: ...
    def raw(self, copy: bool = True) -> list[bytes]: ...
    def unwrapped(self) -> list[bytes]: ...
    def overwrite_latest(self, item: bytes, increment_count: bool = False) -> None: ...
    def insert(self, item: bytes) -> None: ...
    def insert_char(self, item: bytes, item_len: int) -> None: ...
    def insert_batch(self, items: list[bytes]) -> None: ...
    def contains(self, item: bytes) -> bool: ...
    def consume(self) -> bytes: ...
    def consume_all(self) -> list[bytes]: ...
    def consume_iterable(self) -> Iterator[bytes]: ...
    def aconsume(self) -> Coroutine[Any, Any, bytes]: ...
    def aconsume_iterable(self) -> AsyncIterator[bytes]: ...
    def peekright(self) -> bytes: ...
    def peekleft(self) -> bytes: ...
    def clear(self) -> None: ...
    def is_empty(self) -> bool: ...
    def is_full(self) -> bool: ...
    def __contains__(self, item: bytes) -> bool: ...
    def __len__(self) -> int: ...
    def __getitem__(self, idx: int) -> bytes: ...
