[lunardate] Add stubs (#14650)

This commit is contained in:
Semyon Moroz
2025-08-27 10:20:32 +00:00
committed by GitHub
parent 5509c51832
commit 49facf2de3
2 changed files with 42 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
version = "0.2.*"
upstream_repository = "https://github.com/lidaobing/python-lunardate"
+40
View File
@@ -0,0 +1,40 @@
import datetime
from _typeshed import ConvertibleToInt
from typing import Final, SupportsIndex, overload
__version__: Final[str]
__all__ = ["LunarDate"]
class LunarDate:
year: int
month: int
day: int
isLeapMonth: bool
def __init__(self, year: int, month: int, day: int, isLeapMonth: bool | None = False) -> None: ...
@staticmethod
def leapMonthForYear(year: int) -> int | None: ...
@staticmethod
def fromSolarDate(year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> LunarDate: ...
def toSolarDate(self) -> datetime.date: ...
@overload
def __sub__(self, other: LunarDate | datetime.date) -> datetime.timedelta: ...
@overload
def __sub__(self, other: datetime.timedelta) -> LunarDate: ...
def __rsub__(self, other: datetime.date) -> datetime.timedelta: ...
def __add__(self, other: datetime.timedelta) -> LunarDate: ...
def __radd__(self, other: datetime.timedelta) -> LunarDate: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self, other: LunarDate | datetime.date) -> bool: ...
def __le__(self, other: object) -> bool: ...
def __gt__(self, other: object) -> bool: ...
def __ge__(self, other: LunarDate | datetime.date) -> bool: ...
@classmethod
def today(cls) -> LunarDate: ...
yearInfos: Final[list[int]]
def yearInfo2yearDay(yearInfo: ConvertibleToInt) -> int: ...
yearDays: Final[list[int]]
def day2LunarDate(offset: ConvertibleToInt) -> None: ...