from ._compat import PY2 as PY2, WIN as WIN, auto_wrap_for_ansi as auto_wrap_for_ansi, binary_streams as binary_streams, filename_to_ui as filename_to_ui, get_filesystem_encoding as get_filesystem_encoding, get_streerror as get_streerror, is_bytes as is_bytes, open_stream as open_stream, should_strip_ansi as should_strip_ansi, string_types as string_types, strip_ansi as strip_ansi, text_streams as text_streams, text_type as text_type
from .globals import resolve_color_default as resolve_color_default
from typing import Any, Optional

echo_native_types: Any

def safecall(func: Any): ...
def make_str(value: Any): ...
def make_default_short_help(help: Any, max_length: int = ...): ...

class LazyFile:
    name: Any = ...
    mode: Any = ...
    encoding: Any = ...
    errors: Any = ...
    atomic: Any = ...
    should_close: bool = ...
    def __init__(self, filename: Any, mode: str = ..., encoding: Optional[Any] = ..., errors: str = ..., atomic: bool = ...) -> None: ...
    def __getattr__(self, name: Any): ...
    def open(self): ...
    def close(self) -> None: ...
    def close_intelligently(self) -> None: ...
    def __enter__(self): ...
    def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ...
    def __iter__(self) -> Any: ...

class KeepOpenFile:
    def __init__(self, file: Any) -> None: ...
    def __getattr__(self, name: Any): ...
    def __enter__(self): ...
    def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ...
    def __iter__(self) -> Any: ...

def echo(message: Optional[Any] = ..., file: Optional[Any] = ..., nl: bool = ..., err: bool = ..., color: Optional[Any] = ...) -> None: ...
def get_binary_stream(name: Any): ...
def get_text_stream(name: Any, encoding: Optional[Any] = ..., errors: str = ...): ...
def open_file(filename: Any, mode: str = ..., encoding: Optional[Any] = ..., errors: str = ..., lazy: bool = ..., atomic: bool = ...): ...
def get_os_args(): ...
def format_filename(filename: Any, shorten: bool = ...): ...
def get_app_dir(app_name: Any, roaming: bool = ..., force_posix: bool = ...): ...
