from typing import Any, Generic, Hashable, Iterator, OrderedDict, TypeVar, overload

_K = TypeVar("_K", bound=Hashable)
_V = TypeVar("_V")
_T = TypeVar("_T")

class LRU(Generic[_K, _V]):
    cache: OrderedDict[_K, _V]
    __slots__ = ("max_size", "cache", "__size")

    def __init__(self, max_size: int = -1) -> None: ...
    @overload
    def get(self, key: _K) -> _V | None: ...
    @overload
    def get(self, key: _K, default: _T) -> _V | _T: ...
    def __getitem__(self, item: _K) -> _V: ...
    def set(self, key: _K, value: Any) -> None: ...
    def __setitem__(self, key: _K, value: Any) -> None: ...
    def delete(self, key: _K) -> None: ...
    def has_key(self, key: _K) -> bool: ...
    def clear(self) -> None: ...
    def __len__(self) -> int: ...
    def __contains__(self, item: _K): ...
    def __iter__(self) -> Iterator[_K]: ...
    def __repr__(self) -> str: ...
    def peek_first_item(self) -> tuple[_K, _V] | None: ...
    def keys(self) -> list[_K]: ...
    def values(self) -> list[_V]: ...
    def items(self, size: int = -1) -> list[tuple[_K, _V]]: ...
