mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 04:41:30 +08:00
Add defaults for third-party stubs A-D (#9952)
This commit is contained in:
@@ -25,15 +25,15 @@ class ConsoleMenu:
|
||||
previous_active_menu: ConsoleMenu | None
|
||||
def __init__(
|
||||
self,
|
||||
title: str | Callable[[], str] | None = ...,
|
||||
subtitle: str | Callable[[], str] | None = ...,
|
||||
screen: Screen | None = ...,
|
||||
formatter: MenuFormatBuilder | None = ...,
|
||||
prologue_text: str | Callable[[], str] | None = ...,
|
||||
epilogue_text: str | Callable[[], str] | None = ...,
|
||||
clear_screen: bool = ...,
|
||||
show_exit_option: bool = ...,
|
||||
exit_option_text: str = ...,
|
||||
title: str | Callable[[], str] | None = None,
|
||||
subtitle: str | Callable[[], str] | None = None,
|
||||
screen: Screen | None = None,
|
||||
formatter: MenuFormatBuilder | None = None,
|
||||
prologue_text: str | Callable[[], str] | None = None,
|
||||
epilogue_text: str | Callable[[], str] | None = None,
|
||||
clear_screen: bool = True,
|
||||
show_exit_option: bool = True,
|
||||
exit_option_text: str = "Exit",
|
||||
exit_menu_char: str | None = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
@@ -45,15 +45,15 @@ class ConsoleMenu:
|
||||
def add_exit(self) -> bool: ...
|
||||
def remove_exit(self) -> bool: ...
|
||||
def is_selected_item_exit(self) -> bool: ...
|
||||
def start(self, show_exit_option: bool | None = ...) -> None: ...
|
||||
def show(self, show_exit_option: bool | None = ...) -> None: ...
|
||||
def start(self, show_exit_option: bool | None = None) -> None: ...
|
||||
def show(self, show_exit_option: bool | None = None) -> None: ...
|
||||
def draw(self) -> None: ...
|
||||
def is_running(self) -> bool: ...
|
||||
def wait_for_start(self, timeout: float | None = ...) -> bool: ...
|
||||
def wait_for_start(self, timeout: float | None = None) -> bool: ...
|
||||
def is_alive(self) -> bool: ...
|
||||
def pause(self) -> None: ...
|
||||
def resume(self) -> None: ...
|
||||
def join(self, timeout: float | None = ...) -> None: ...
|
||||
def join(self, timeout: float | None = None) -> None: ...
|
||||
def get_input(self) -> int: ...
|
||||
def process_user_input(self) -> int | None: ...
|
||||
def go_to(self, option: int) -> None: ...
|
||||
@@ -92,6 +92,6 @@ class ExitItem(MenuItem):
|
||||
def __init__(
|
||||
self, text: str | Callable[[], str] = "Exit", menu: ConsoleMenu | None = None, menu_char: str | None = None
|
||||
) -> None: ...
|
||||
def show(self, index: int, available_width: None = ...) -> str: ...
|
||||
def show(self, index: int, available_width: None = None) -> str: ...
|
||||
|
||||
def clear_terminal() -> None: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class MenuMargins:
|
||||
def __init__(self, top: int = ..., left: int = ..., bottom: int = ..., right: int = ...) -> None: ...
|
||||
def __init__(self, top: int = 1, left: int = 2, bottom: int = 0, right: int = 2) -> None: ...
|
||||
@property
|
||||
def left(self) -> int: ...
|
||||
@left.setter
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class MenuPadding:
|
||||
def __init__(self, top: int = ..., left: int = ..., bottom: int = ..., right: int = ...) -> None: ...
|
||||
def __init__(self, top: int = 1, left: int = 2, bottom: int = 1, right: int = 2) -> None: ...
|
||||
@property
|
||||
def left(self) -> int: ...
|
||||
@left.setter
|
||||
|
||||
@@ -5,11 +5,11 @@ from consolemenu.format.menu_padding import MenuPadding as MenuPadding
|
||||
class MenuStyle:
|
||||
def __init__(
|
||||
self,
|
||||
margins: MenuMargins | None = ...,
|
||||
padding: MenuPadding | None = ...,
|
||||
border_style: MenuBorderStyle | None = ...,
|
||||
border_style_type: int | None = ...,
|
||||
border_style_factory: MenuBorderStyleFactory | None = ...,
|
||||
margins: MenuMargins | None = None,
|
||||
padding: MenuPadding | None = None,
|
||||
border_style: MenuBorderStyle | None = None,
|
||||
border_style_type: int | None = None,
|
||||
border_style_factory: MenuBorderStyleFactory | None = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def margins(self) -> MenuMargins: ...
|
||||
|
||||
@@ -14,10 +14,10 @@ class FunctionItem(ExternalItem):
|
||||
self,
|
||||
text: str,
|
||||
function: Callable[..., Any],
|
||||
args: Sequence[Any] | None = ...,
|
||||
kwargs: Mapping[str, Any] | None = ...,
|
||||
menu: ConsoleMenu | None = ...,
|
||||
should_exit: bool = ...,
|
||||
args: Sequence[Any] | None = None,
|
||||
kwargs: Mapping[str, Any] | None = None,
|
||||
menu: ConsoleMenu | None = None,
|
||||
should_exit: bool = False,
|
||||
menu_char: str | None = None,
|
||||
) -> None: ...
|
||||
def action(self) -> None: ...
|
||||
|
||||
@@ -8,10 +8,10 @@ def ansilen(s: str) -> int: ...
|
||||
class Dimension:
|
||||
width: int
|
||||
height: int
|
||||
def __init__(self, width: int = ..., height: int = ..., dimension: Dimension | None = ...) -> None: ...
|
||||
def __init__(self, width: int = 0, height: int = 0, dimension: Dimension | None = None) -> None: ...
|
||||
|
||||
class MenuComponent:
|
||||
def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = ...) -> None: ...
|
||||
def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = None) -> None: ...
|
||||
@property
|
||||
def max_dimension(self) -> Dimension: ...
|
||||
@property
|
||||
@@ -30,7 +30,7 @@ class MenuComponent:
|
||||
def outer_horizontals(self) -> str: ...
|
||||
def outer_horizontal_border_bottom(self) -> str: ...
|
||||
def outer_horizontal_border_top(self) -> str: ...
|
||||
def row(self, content: str = ..., align: str = ..., indent_len: int = ...) -> str: ...
|
||||
def row(self, content: str = "", align: str = "left", indent_len: int = 0) -> str: ...
|
||||
|
||||
class MenuHeader(MenuComponent):
|
||||
title: str
|
||||
@@ -41,12 +41,12 @@ class MenuHeader(MenuComponent):
|
||||
def __init__(
|
||||
self,
|
||||
menu_style: MenuStyle,
|
||||
max_dimension: Dimension | None = ...,
|
||||
title: str | None = ...,
|
||||
title_align: str = ...,
|
||||
subtitle: str | None = ...,
|
||||
subtitle_align: str = ...,
|
||||
show_bottom_border: bool = ...,
|
||||
max_dimension: Dimension | None = None,
|
||||
title: str | None = None,
|
||||
title_align: str = "left",
|
||||
subtitle: str | None = None,
|
||||
subtitle_align: str = "left",
|
||||
show_bottom_border: bool = False,
|
||||
) -> None: ...
|
||||
def generate(self) -> Generator[str, None, None]: ...
|
||||
|
||||
@@ -58,11 +58,11 @@ class MenuTextSection(MenuComponent):
|
||||
def __init__(
|
||||
self,
|
||||
menu_style: MenuStyle,
|
||||
max_dimension: Dimension | None = ...,
|
||||
text: str | None = ...,
|
||||
text_align: str = ...,
|
||||
show_top_border: bool = ...,
|
||||
show_bottom_border: bool = ...,
|
||||
max_dimension: Dimension | None = None,
|
||||
text: str | None = None,
|
||||
text_align: str = "left",
|
||||
show_top_border: bool = False,
|
||||
show_bottom_border: bool = False,
|
||||
) -> None: ...
|
||||
def generate(self) -> Generator[str, None, None]: ...
|
||||
|
||||
@@ -71,9 +71,9 @@ class MenuItemsSection(MenuComponent):
|
||||
def __init__(
|
||||
self,
|
||||
menu_style: MenuStyle,
|
||||
max_dimension: Dimension | None = ...,
|
||||
items: list[MenuItem] | None = ...,
|
||||
items_align: str = ...,
|
||||
max_dimension: Dimension | None = None,
|
||||
items: list[MenuItem] | None = None,
|
||||
items_align: str = "left",
|
||||
) -> None: ...
|
||||
@property
|
||||
def items(self) -> list[MenuItem]: ...
|
||||
@@ -91,7 +91,7 @@ class MenuFooter(MenuComponent):
|
||||
def generate(self) -> Generator[str, None, None]: ...
|
||||
|
||||
class MenuPrompt(MenuComponent):
|
||||
def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = ..., prompt_string: str = ...) -> None: ...
|
||||
def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = None, prompt_string: str = ">>") -> None: ...
|
||||
@property
|
||||
def prompt(self) -> str: ...
|
||||
@prompt.setter
|
||||
|
||||
@@ -12,7 +12,7 @@ from consolemenu.menu_component import (
|
||||
)
|
||||
|
||||
class MenuFormatBuilder:
|
||||
def __init__(self, max_dimension: Dimension | None = ...) -> None: ...
|
||||
def __init__(self, max_dimension: Dimension | None = None) -> None: ...
|
||||
def set_border_style(self, border_style: MenuBorderStyle) -> MenuFormatBuilder: ...
|
||||
def set_border_style_type(self, border_style_type: MenuBorderStyleType) -> MenuFormatBuilder: ...
|
||||
def set_border_style_factory(self, border_style_factory: MenuBorderStyleFactory) -> MenuFormatBuilder: ...
|
||||
@@ -20,8 +20,8 @@ class MenuFormatBuilder:
|
||||
def set_left_margin(self, left_margin: int) -> MenuFormatBuilder: ...
|
||||
def set_right_margin(self, right_margin: int) -> MenuFormatBuilder: ...
|
||||
def set_top_margin(self, top_margin: int) -> MenuFormatBuilder: ...
|
||||
def set_title_align(self, align: str = ...) -> MenuFormatBuilder: ...
|
||||
def set_subtitle_align(self, align: str = ...) -> MenuFormatBuilder: ...
|
||||
def set_title_align(self, align: str = "left") -> MenuFormatBuilder: ...
|
||||
def set_subtitle_align(self, align: str = "left") -> MenuFormatBuilder: ...
|
||||
def set_header_left_padding(self, x: int) -> MenuFormatBuilder: ...
|
||||
def set_header_right_padding(self, x: int) -> MenuFormatBuilder: ...
|
||||
def set_header_bottom_padding(self, x: int) -> MenuFormatBuilder: ...
|
||||
@@ -37,19 +37,19 @@ class MenuFormatBuilder:
|
||||
def set_items_top_padding(self, x: int) -> MenuFormatBuilder: ...
|
||||
def show_item_bottom_border(self, item_text: str, flag: bool) -> MenuFormatBuilder: ...
|
||||
def show_item_top_border(self, item_text: str, flag: bool) -> MenuFormatBuilder: ...
|
||||
def set_prologue_text_align(self, align: str = ...) -> MenuFormatBuilder: ...
|
||||
def set_prologue_text_align(self, align: str = "left") -> MenuFormatBuilder: ...
|
||||
def show_prologue_top_border(self, flag: bool) -> MenuFormatBuilder: ...
|
||||
def show_prologue_bottom_border(self, flag: bool) -> MenuFormatBuilder: ...
|
||||
def set_epilogue_text_align(self, align: str = ...) -> MenuFormatBuilder: ...
|
||||
def set_epilogue_text_align(self, align: str = "left") -> MenuFormatBuilder: ...
|
||||
def show_epilogue_top_border(self, flag: bool) -> MenuFormatBuilder: ...
|
||||
def show_epilogue_bottom_border(self, flag: bool) -> MenuFormatBuilder: ...
|
||||
def set_prompt(self, prompt: MenuPrompt) -> MenuFormatBuilder: ...
|
||||
def clear_data(self) -> None: ...
|
||||
def format(
|
||||
self,
|
||||
title: str | None = ...,
|
||||
subtitle: str | None = ...,
|
||||
prologue_text: str | None = ...,
|
||||
epilogue_text: str | None = ...,
|
||||
items: list[MenuItem] | None = ...,
|
||||
title: str | None = None,
|
||||
subtitle: str | None = None,
|
||||
prologue_text: str | None = None,
|
||||
epilogue_text: str | None = None,
|
||||
items: list[MenuItem] | None = None,
|
||||
) -> str: ...
|
||||
|
||||
@@ -7,15 +7,15 @@ class MultiSelectMenu(ConsoleMenu):
|
||||
ack_item_completion: bool
|
||||
def __init__(
|
||||
self,
|
||||
title: str | None = ...,
|
||||
subtitle: str | None = ...,
|
||||
formatter: MenuFormatBuilder | None = ...,
|
||||
prologue_text: str | None = ...,
|
||||
epilogue_text: str | None = ...,
|
||||
ack_item_completion: bool = ...,
|
||||
show_exit_option: bool = ...,
|
||||
exit_option_text: str = ...,
|
||||
clear_screen: bool = ...,
|
||||
title: str | None = None,
|
||||
subtitle: str | None = None,
|
||||
formatter: MenuFormatBuilder | None = None,
|
||||
prologue_text: str | None = None,
|
||||
epilogue_text: str | None = None,
|
||||
ack_item_completion: bool = True,
|
||||
show_exit_option: bool = True,
|
||||
exit_option_text: str = "Exit",
|
||||
clear_screen: bool = True,
|
||||
) -> None: ...
|
||||
def append_item(self, item: MenuItem) -> None: ...
|
||||
current_option: int
|
||||
|
||||
@@ -11,37 +11,37 @@ class InputResult(NamedTuple):
|
||||
class PromptFormatter:
|
||||
@staticmethod
|
||||
def format_prompt(
|
||||
prompt: str | None = ...,
|
||||
default: str | None = ...,
|
||||
enable_quit: bool = ...,
|
||||
quit_string: str = ...,
|
||||
quit_message: str = ...,
|
||||
prompt: str | None = None,
|
||||
default: str | None = None,
|
||||
enable_quit: bool = False,
|
||||
quit_string: str = "q",
|
||||
quit_message: str = "(enter q to Quit)",
|
||||
) -> str: ...
|
||||
|
||||
class PromptUtils:
|
||||
def __init__(self, screen: Screen, prompt_formatter: PromptFormatter | None = ...) -> None: ...
|
||||
def __init__(self, screen: Screen, prompt_formatter: PromptFormatter | None = None) -> None: ...
|
||||
@property
|
||||
def screen(self) -> Screen: ...
|
||||
def clear(self) -> None: ...
|
||||
def confirm_answer(self, answer: str, message: str | None = ...) -> bool: ...
|
||||
def enter_to_continue(self, message: str | None = ...) -> None: ...
|
||||
def confirm_answer(self, answer: str, message: str | None = None) -> bool: ...
|
||||
def enter_to_continue(self, message: str | None = None) -> None: ...
|
||||
def input(
|
||||
self,
|
||||
prompt: str | None = ...,
|
||||
default: str | None = ...,
|
||||
validators: Iterable[BaseValidator] | None = ...,
|
||||
enable_quit: bool = ...,
|
||||
quit_string: str = ...,
|
||||
quit_message: str = ...,
|
||||
prompt: str | None = None,
|
||||
default: str | None = None,
|
||||
validators: Iterable[BaseValidator] | None = None,
|
||||
enable_quit: bool = False,
|
||||
quit_string: str = "q",
|
||||
quit_message: str = "(enter q to Quit)",
|
||||
) -> InputResult: ...
|
||||
def input_password(self, message: str | None = ...) -> str: ...
|
||||
def input_password(self, message: str | None = None) -> str: ...
|
||||
def printf(self, *args: Any) -> None: ...
|
||||
def println(self, *args: Any) -> None: ...
|
||||
def prompt_and_confirm_password(self, message: str) -> str: ...
|
||||
def prompt_for_bilateral_choice(self, prompt: str, option1: str, option2: str) -> str: ...
|
||||
def prompt_for_trilateral_choice(self, prompt: str, option1: str, option2: str, option3: str) -> str: ...
|
||||
def prompt_for_yes_or_no(self, prompt: str) -> bool: ...
|
||||
def prompt_for_numbered_choice(self, choices: Sequence[str], title: str | None = ..., prompt: str = ...) -> int: ...
|
||||
def prompt_for_numbered_choice(self, choices: Sequence[str], title: str | None = None, prompt: str = ">") -> int: ...
|
||||
def validate_input(self, input_string: str, validators: BaseValidator) -> bool: ...
|
||||
|
||||
class UserQuit(Exception): ...
|
||||
|
||||
@@ -10,7 +10,7 @@ class Screen:
|
||||
def clear() -> None: ...
|
||||
@staticmethod
|
||||
def flush() -> None: ...
|
||||
def input(self, prompt: str = ...) -> str: ...
|
||||
def input(self, prompt: str = "") -> str: ...
|
||||
@staticmethod
|
||||
def printf(*args: Any) -> None: ...
|
||||
@staticmethod
|
||||
|
||||
@@ -9,23 +9,23 @@ class SelectionMenu(ConsoleMenu):
|
||||
def __init__(
|
||||
self,
|
||||
strings: Iterable[str],
|
||||
title: str | None = ...,
|
||||
subtitle: str | None = ...,
|
||||
screen: Screen | None = ...,
|
||||
formatter: MenuFormatBuilder | None = ...,
|
||||
prologue_text: str | None = ...,
|
||||
epilogue_text: str | None = ...,
|
||||
show_exit_option: bool = ...,
|
||||
exit_option_text: str = ...,
|
||||
clear_screen: bool = ...,
|
||||
title: str | None = None,
|
||||
subtitle: str | None = None,
|
||||
screen: Screen | None = None,
|
||||
formatter: MenuFormatBuilder | None = None,
|
||||
prologue_text: str | None = None,
|
||||
epilogue_text: str | None = None,
|
||||
show_exit_option: bool = True,
|
||||
exit_option_text: str = "Exit",
|
||||
clear_screen: bool = True,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def get_selection(
|
||||
cls,
|
||||
strings: Iterable[str],
|
||||
title: str = ...,
|
||||
subtitle: str | None = ...,
|
||||
show_exit_option: bool = ...,
|
||||
_menu: ConsoleMenu | None = ...,
|
||||
title: str = "Select an option",
|
||||
subtitle: str | None = None,
|
||||
show_exit_option: bool = True,
|
||||
_menu: ConsoleMenu | None = None,
|
||||
) -> int: ...
|
||||
def append_string(self, string: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user