mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
click.option's defined type as return type of callable (#2505)
This commit is contained in:
committed by
Sebastian Rittau
parent
cec2202550
commit
4ed42f899e
34
third_party/2and3/click/decorators.pyi
vendored
34
third_party/2and3/click/decorators.pyi
vendored
@@ -1,5 +1,5 @@
|
||||
from distutils.version import Version
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union, Text
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union, Text, overload
|
||||
|
||||
from click.core import Command, Group, Argument, Option, Parameter, Context, _ConvertibleType
|
||||
|
||||
@@ -88,6 +88,7 @@ def argument(
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def option(
|
||||
*param_decls: str,
|
||||
cls: Type[Option] = ...,
|
||||
@@ -118,6 +119,37 @@ def option(
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def option(
|
||||
*param_decls: str,
|
||||
cls: Type[Option] = ...,
|
||||
# Option
|
||||
show_default: bool = ...,
|
||||
prompt: Union[bool, Text] = ...,
|
||||
confirmation_prompt: bool = ...,
|
||||
hide_input: bool = ...,
|
||||
is_flag: Optional[bool] = ...,
|
||||
flag_value: Optional[Any] = ...,
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: _T = ...,
|
||||
help: Optional[str] = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
required: bool = ...,
|
||||
callback: Optional[Callable[[Context, Union[Option, Parameter], Union[bool, int, str]], _T]] = ...,
|
||||
nargs: Optional[int] = ...,
|
||||
metavar: Optional[str] = ...,
|
||||
expose_value: bool = ...,
|
||||
is_eager: bool = ...,
|
||||
envvar: Optional[Union[str, List[str]]] = ...,
|
||||
# User-defined
|
||||
**kwargs: Any,
|
||||
) -> Callable[[_F], _F]:
|
||||
...
|
||||
|
||||
|
||||
def confirmation_option(
|
||||
*param_decls: str,
|
||||
cls: Type[Option] = ...,
|
||||
|
||||
Reference in New Issue
Block a user