massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / time.pyi
1 import sys
2 from types import SimpleNamespace
3 from typing import Any, NamedTuple, Tuple
4 from typing_extensions import final
5
6 _TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]
7
8 altzone: int
9 daylight: int
10 timezone: int
11 tzname: tuple[str, str]
12
13 if sys.version_info >= (3, 7):
14     if sys.platform == "linux":
15         CLOCK_BOOTTIME: int
16     if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
17         CLOCK_PROF: int  # FreeBSD, NetBSD, OpenBSD
18         CLOCK_UPTIME: int  # FreeBSD, OpenBSD
19
20 if sys.platform != "win32":
21     CLOCK_MONOTONIC: int
22     CLOCK_MONOTONIC_RAW: int
23     CLOCK_PROCESS_CPUTIME_ID: int
24     CLOCK_REALTIME: int
25     CLOCK_THREAD_CPUTIME_ID: int
26     if sys.platform != "linux" and sys.platform != "darwin":
27         CLOCK_HIGHRES: int  # Solaris only
28
29 if sys.version_info >= (3, 8) and sys.platform == "darwin":
30     CLOCK_UPTIME_RAW: int
31
32 if sys.version_info >= (3, 9) and sys.platform == "linux":
33     CLOCK_TAI: int
34
35 class _struct_time(NamedTuple):
36     tm_year: int
37     tm_mon: int
38     tm_mday: int
39     tm_hour: int
40     tm_min: int
41     tm_sec: int
42     tm_wday: int
43     tm_yday: int
44     tm_isdst: int
45     @property
46     def n_fields(self) -> int: ...
47     @property
48     def n_sequence_fields(self) -> int: ...
49     @property
50     def n_unnamed_fields(self) -> int: ...
51
52 @final
53 class struct_time(_struct_time):
54     def __init__(
55         self,
56         o: tuple[int, int, int, int, int, int, int, int, int]
57         | tuple[int, int, int, int, int, int, int, int, int, str]
58         | tuple[int, int, int, int, int, int, int, int, int, str, int],
59         _arg: Any = ...,
60     ) -> None: ...
61     def __new__(
62         cls,
63         o: tuple[int, int, int, int, int, int, int, int, int]
64         | tuple[int, int, int, int, int, int, int, int, int, str]
65         | tuple[int, int, int, int, int, int, int, int, int, str, int],
66         _arg: Any = ...,
67     ) -> struct_time: ...
68     @property
69     def tm_zone(self) -> str: ...
70     @property
71     def tm_gmtoff(self) -> int: ...
72
73 def asctime(t: _TimeTuple | struct_time = ...) -> str: ...
74
75 if sys.version_info < (3, 8):
76     def clock() -> float: ...
77
78 def ctime(secs: float | None = ...) -> str: ...
79 def gmtime(secs: float | None = ...) -> struct_time: ...
80 def localtime(secs: float | None = ...) -> struct_time: ...
81 def mktime(t: _TimeTuple | struct_time) -> float: ...
82 def sleep(secs: float) -> None: ...
83 def strftime(format: str, t: _TimeTuple | struct_time = ...) -> str: ...
84 def strptime(string: str, format: str = ...) -> struct_time: ...
85 def time() -> float: ...
86
87 if sys.platform != "win32":
88     def tzset() -> None: ...  # Unix only
89
90 def get_clock_info(name: str) -> SimpleNamespace: ...
91 def monotonic() -> float: ...
92 def perf_counter() -> float: ...
93 def process_time() -> float: ...
94
95 if sys.platform != "win32":
96     def clock_getres(clk_id: int) -> float: ...  # Unix only
97     def clock_gettime(clk_id: int) -> float: ...  # Unix only
98     def clock_settime(clk_id: int, time: float) -> None: ...  # Unix only
99
100 if sys.version_info >= (3, 7):
101     if sys.platform != "win32":
102         def clock_gettime_ns(clock_id: int) -> int: ...
103         def clock_settime_ns(clock_id: int, time: int) -> int: ...
104     def monotonic_ns() -> int: ...
105     def perf_counter_ns() -> int: ...
106     def process_time_ns() -> int: ...
107     def time_ns() -> int: ...
108     def thread_time() -> float: ...
109     def thread_time_ns() -> int: ...