"""Type definitions for distributed collections."""

from __future__ import annotations

from typing import Any, Literal, Protocol

type Consistency = Literal["strong", "eventual"]


class Registry(Protocol):
    """Protocol satisfied by DistributedRegistry and IPCRegistry."""

    def dict(self, name: str, *, consistency: Consistency | None = None) -> Any: ...
    def set(self, name: str, *, consistency: Consistency | None = None) -> Any: ...
    def counter(self, name: str, *, consistency: Consistency | None = None) -> Any: ...
    def queue(self, name: str) -> Any: ...
    def barrier(self, name: str, n: int) -> Any: ...
    def lock(self, name: str) -> Any: ...
    def cleanup(self) -> None: ...
