massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / calendar.pyi
1 import datetime
2 import sys
3 from time import struct_time
4 from typing import Any, Iterable, Optional, Sequence, Tuple
5
6 _LocaleType = Tuple[Optional[str], Optional[str]]
7
8 class IllegalMonthError(ValueError):
9     def __init__(self, month: int) -> None: ...
10     def __str__(self) -> str: ...
11
12 class IllegalWeekdayError(ValueError):
13     def __init__(self, weekday: int) -> None: ...
14     def __str__(self) -> str: ...
15
16 def isleap(year: int) -> bool: ...
17 def leapdays(y1: int, y2: int) -> int: ...
18 def weekday(year: int, month: int, day: int) -> int: ...
19 def monthrange(year: int, month: int) -> tuple[int, int]: ...
20
21 class Calendar:
22     firstweekday: int
23     def __init__(self, firstweekday: int = ...) -> None: ...
24     def getfirstweekday(self) -> int: ...
25     def setfirstweekday(self, firstweekday: int) -> None: ...
26     def iterweekdays(self) -> Iterable[int]: ...
27     def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ...
28     def itermonthdays2(self, year: int, month: int) -> Iterable[tuple[int, int]]: ...
29     def itermonthdays(self, year: int, month: int) -> Iterable[int]: ...
30     def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ...
31     def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ...
32     def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ...
33     def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
34     def yeardays2calendar(self, year: int, width: int = ...) -> list[list[tuple[int, int]]]: ...
35     def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
36     if sys.version_info >= (3, 7):
37         def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ...
38         def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ...
39
40 class TextCalendar(Calendar):
41     def prweek(self, theweek: int, width: int) -> None: ...
42     def formatday(self, day: int, weekday: int, width: int) -> str: ...
43     def formatweek(self, theweek: int, width: int) -> str: ...
44     def formatweekday(self, day: int, width: int) -> str: ...
45     def formatweekheader(self, width: int) -> str: ...
46     def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ...
47     def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ...
48     def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ...
49     def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ...
50     def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
51
52 def firstweekday() -> int: ...
53 def monthcalendar(year: int, month: int) -> list[list[int]]: ...
54 def prweek(theweek: int, width: int) -> None: ...
55 def week(theweek: int, width: int) -> str: ...
56 def weekheader(width: int) -> str: ...
57 def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ...
58 def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ...
59 def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ...
60 def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
61
62 class HTMLCalendar(Calendar):
63     def formatday(self, day: int, weekday: int) -> str: ...
64     def formatweek(self, theweek: int) -> str: ...
65     def formatweekday(self, day: int) -> str: ...
66     def formatweekheader(self) -> str: ...
67     def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
68     def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
69     def formatyear(self, theyear: int, width: int = ...) -> str: ...
70     def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ...
71     if sys.version_info >= (3, 7):
72         cssclasses: list[str]
73         cssclass_noday: str
74         cssclasses_weekday_head: list[str]
75         cssclass_month_head: str
76         cssclass_month: str
77         cssclass_year: str
78         cssclass_year_head: str
79
80 class different_locale:
81     def __init__(self, locale: _LocaleType) -> None: ...
82     def __enter__(self) -> _LocaleType: ...
83     def __exit__(self, *args: Any) -> None: ...
84
85 class LocaleTextCalendar(TextCalendar):
86     def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ...
87     def formatweekday(self, day: int, width: int) -> str: ...
88     def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ...
89
90 class LocaleHTMLCalendar(HTMLCalendar):
91     def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ...
92     def formatweekday(self, day: int) -> str: ...
93     def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
94
95 c: TextCalendar
96
97 def setfirstweekday(firstweekday: int) -> None: ...
98 def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
99 def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
100 def timegm(tuple: Tuple[int, ...] | struct_time) -> int: ...
101
102 # Data attributes
103 day_name: Sequence[str]
104 day_abbr: Sequence[str]
105 month_name: Sequence[str]
106 month_abbr: Sequence[str]
107
108 # Below constants are not in docs or __all__, but enough people have used them
109 # they are now effectively public.
110
111 MONDAY: int
112 TUESDAY: int
113 WEDNESDAY: int
114 THURSDAY: int
115 FRIDAY: int
116 SATURDAY: int
117 SUNDAY: int