massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / winreg.pyi
1 from _typeshed import Self
2 from types import TracebackType
3 from typing import Any, Type, Union
4 from typing_extensions import final
5
6 _KeyType = Union[HKEYType, int]
7
8 def CloseKey(__hkey: _KeyType) -> None: ...
9 def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ...
10 def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ...
11 def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ...
12 def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ...
13 def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ...
14 def DeleteValue(__key: _KeyType, __value: str) -> None: ...
15 def EnumKey(__key: _KeyType, __index: int) -> str: ...
16 def EnumValue(__key: _KeyType, __index: int) -> tuple[str, Any, int]: ...
17 def ExpandEnvironmentStrings(__str: str) -> str: ...
18 def FlushKey(__key: _KeyType) -> None: ...
19 def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ...
20 def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
21 def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
22 def QueryInfoKey(__key: _KeyType) -> tuple[int, int, int]: ...
23 def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ...
24 def QueryValueEx(__key: _KeyType, __name: str) -> tuple[Any, int]: ...
25 def SaveKey(__key: _KeyType, __file_name: str) -> None: ...
26 def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ...
27 def SetValueEx(
28     __key: _KeyType, __value_name: str | None, __reserved: Any, __type: int, __value: str | int
29 ) -> None: ...  # reserved is ignored
30 def DisableReflectionKey(__key: _KeyType) -> None: ...
31 def EnableReflectionKey(__key: _KeyType) -> None: ...
32 def QueryReflectionKey(__key: _KeyType) -> bool: ...
33
34 HKEY_CLASSES_ROOT: int
35 HKEY_CURRENT_USER: int
36 HKEY_LOCAL_MACHINE: int
37 HKEY_USERS: int
38 HKEY_PERFORMANCE_DATA: int
39 HKEY_CURRENT_CONFIG: int
40 HKEY_DYN_DATA: int
41
42 KEY_ALL_ACCESS: int
43 KEY_WRITE: int
44 KEY_READ: int
45 KEY_EXECUTE: int
46 KEY_QUERY_VALUE: int
47 KEY_SET_VALUE: int
48 KEY_CREATE_SUB_KEY: int
49 KEY_ENUMERATE_SUB_KEYS: int
50 KEY_NOTIFY: int
51 KEY_CREATE_LINK: int
52
53 KEY_WOW64_64KEY: int
54 KEY_WOW64_32KEY: int
55
56 REG_BINARY: int
57 REG_DWORD: int
58 REG_DWORD_LITTLE_ENDIAN: int
59 REG_DWORD_BIG_ENDIAN: int
60 REG_EXPAND_SZ: int
61 REG_LINK: int
62 REG_MULTI_SZ: int
63 REG_NONE: int
64 REG_QWORD: int
65 REG_QWORD_LITTLE_ENDIAN: int
66 REG_RESOURCE_LIST: int
67 REG_FULL_RESOURCE_DESCRIPTOR: int
68 REG_RESOURCE_REQUIREMENTS_LIST: int
69 REG_SZ: int
70
71 REG_CREATED_NEW_KEY: int  # undocumented
72 REG_LEGAL_CHANGE_FILTER: int  # undocumented
73 REG_LEGAL_OPTION: int  # undocumented
74 REG_NOTIFY_CHANGE_ATTRIBUTES: int  # undocumented
75 REG_NOTIFY_CHANGE_LAST_SET: int  # undocumented
76 REG_NOTIFY_CHANGE_NAME: int  # undocumented
77 REG_NOTIFY_CHANGE_SECURITY: int  # undocumented
78 REG_NO_LAZY_FLUSH: int  # undocumented
79 REG_OPENED_EXISTING_KEY: int  # undocumented
80 REG_OPTION_BACKUP_RESTORE: int  # undocumented
81 REG_OPTION_CREATE_LINK: int  # undocumented
82 REG_OPTION_NON_VOLATILE: int  # undocumented
83 REG_OPTION_OPEN_LINK: int  # undocumented
84 REG_OPTION_RESERVED: int  # undocumented
85 REG_OPTION_VOLATILE: int  # undocumented
86 REG_REFRESH_HIVE: int  # undocumented
87 REG_WHOLE_HIVE_VOLATILE: int  # undocumented
88
89 error = OSError
90
91 # Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason
92 @final
93 class HKEYType:
94     def __bool__(self) -> bool: ...
95     def __int__(self) -> int: ...
96     def __enter__(self: Self) -> Self: ...
97     def __exit__(
98         self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
99     ) -> bool | None: ...
100     def Close(self) -> None: ...
101     def Detach(self) -> int: ...