massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / click / click / utils.pyi
1 from types import TracebackType
2 from typing import IO, Any, AnyStr, Generic, Iterator, Text, Type, TypeVar
3
4 _T = TypeVar("_T")
5
6 def _posixify(name: str) -> str: ...
7 def safecall(func: _T) -> _T: ...
8 def make_str(value: Any) -> str: ...
9 def make_default_short_help(help: str, max_length: int = ...) -> str: ...
10
11 class LazyFile(object):
12     name: str
13     mode: str
14     encoding: str | None
15     errors: str
16     atomic: bool
17     def __init__(
18         self, filename: str, mode: str = ..., encoding: str | None = ..., errors: str = ..., atomic: bool = ...
19     ) -> None: ...
20     def open(self) -> IO[Any]: ...
21     def close(self) -> None: ...
22     def close_intelligently(self) -> None: ...
23     def __enter__(self) -> LazyFile: ...
24     def __exit__(
25         self, exctype: Type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
26     ) -> None: ...
27     def __iter__(self) -> Iterator[Any]: ...
28
29 class KeepOpenFile(Generic[AnyStr]):
30     _file: IO[AnyStr]
31     def __init__(self, file: IO[AnyStr]) -> None: ...
32     def __enter__(self) -> KeepOpenFile[AnyStr]: ...
33     def __exit__(
34         self, exctype: Type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
35     ) -> None: ...
36     def __iter__(self) -> Iterator[AnyStr]: ...
37
38 def echo(
39     message: object = ..., file: IO[Text] | None = ..., nl: bool = ..., err: bool = ..., color: bool | None = ...
40 ) -> None: ...
41 def get_binary_stream(name: str) -> IO[bytes]: ...
42 def get_text_stream(name: str, encoding: str | None = ..., errors: str = ...) -> IO[str]: ...
43 def open_file(
44     filename: str, mode: str = ..., encoding: str | None = ..., errors: str = ..., lazy: bool = ..., atomic: bool = ...
45 ) -> Any: ...  # really IO | LazyFile | KeepOpenFile
46 def get_os_args() -> list[str]: ...
47 def format_filename(filename: str, shorten: bool = ...) -> str: ...
48 def get_app_dir(app_name: str, roaming: bool = ..., force_posix: bool = ...) -> str: ...