from uuid import UUID
from datetime import datetime
from typing import Optional

class DecodeError(ValueError): ...
class InvalidUuidError(ValueError): ...

class PyUlid:
    def __repr__(self) -> str: ...
    def bytes(self) -> bytes: ...
    def timestamp(self) -> float: ...
    def datetime(self) -> datetime: ...
    def randomness(self) -> int: ...
    def str(self) -> str: ...
    def increment(self) -> Optional["PyUlid"]: ...

def new() -> PyUlid: ...
def from_string(value: str) -> PyUlid: ...
def from_uuid(value: UUID) -> PyUlid: ...
def from_datetime(value: datetime) -> PyUlid: ...
def from_timestamp(value: float) -> PyUlid: ...
def from_parts(timestamp: float, randomness: int) -> PyUlid: ...
