"""This is an automatically generated stub for `date.capnp`."""

from __future__ import annotations

from collections.abc import Iterator
from contextlib import contextmanager
from io import BufferedWriter
from typing import Any, BinaryIO

class Date:
    @property
    def year(self) -> int: ...
    @property
    def month(self) -> int: ...
    @property
    def day(self) -> int: ...
    @staticmethod
    @contextmanager
    def from_bytes(
        data: bytes,
        traversal_limit_in_words: int | None = ...,
        nesting_limit: int | None = ...,
    ) -> Iterator[DateReader]: ...
    @staticmethod
    def from_bytes_packed(
        data: bytes,
        traversal_limit_in_words: int | None = ...,
        nesting_limit: int | None = ...,
    ) -> DateReader: ...
    @staticmethod
    def new_message(
        num_first_segment_words: int | None = None,
        allocate_seg_callable: Any = None,
        year: int | None = None,
        month: int | None = None,
        day: int | None = None,
    ) -> DateBuilder: ...
    @staticmethod
    def read(
        file: BinaryIO,
        traversal_limit_in_words: int | None = ...,
        nesting_limit: int | None = ...,
    ) -> DateReader: ...
    @staticmethod
    def read_packed(
        file: BinaryIO,
        traversal_limit_in_words: int | None = ...,
        nesting_limit: int | None = ...,
    ) -> DateReader: ...
    def to_dict(self) -> dict[str, Any]: ...

class DateReader(Date):
    def as_builder(self) -> DateBuilder: ...

class DateBuilder(Date):
    @property
    def year(self) -> int: ...
    @year.setter
    def year(self, value: int) -> None: ...
    @property
    def month(self) -> int: ...
    @month.setter
    def month(self, value: int) -> None: ...
    @property
    def day(self) -> int: ...
    @day.setter
    def day(self, value: int) -> None: ...
    @staticmethod
    def from_dict(dictionary: dict[str, Any]) -> DateBuilder: ...
    def copy(self) -> DateBuilder: ...
    def to_bytes(self) -> bytes: ...
    def to_bytes_packed(self) -> bytes: ...
    def to_segments(self) -> list[bytes]: ...
    def as_reader(self) -> DateReader: ...
    @staticmethod
    def write(file: BufferedWriter) -> None: ...
    @staticmethod
    def write_packed(file: BufferedWriter) -> None: ...
