diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index be0163441020..7a2fda7dab78 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -38,6 +38,7 @@ "stubs/caldav", "stubs/cffi", "stubs/click-default-group", + "stubs/click-web", "stubs/commonmark", "stubs/corus", "stubs/dateparser", diff --git a/stubs/click-web/METADATA.toml b/stubs/click-web/METADATA.toml new file mode 100644 index 000000000000..8153c7eece59 --- /dev/null +++ b/stubs/click-web/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.8.*" +upstream_repository = "https://github.com/fredrik-corneliusson/click-web" diff --git a/stubs/click-web/click_web/__init__.pyi b/stubs/click-web/click_web/__init__.pyi new file mode 100644 index 000000000000..9e43b4a356e6 --- /dev/null +++ b/stubs/click-web/click_web/__init__.pyi @@ -0,0 +1,9 @@ +import types + +import click +import flask +import jinja2 + +jinja_env: jinja2.Environment + +def create_click_web_app(module: types.ModuleType, command: click.BaseCommand, root: str = "/") -> flask.Flask: ... diff --git a/stubs/click-web/click_web/exceptions.pyi b/stubs/click-web/click_web/exceptions.pyi new file mode 100644 index 000000000000..172a2026a871 --- /dev/null +++ b/stubs/click-web/click_web/exceptions.pyi @@ -0,0 +1,2 @@ +class ClickWebException(Exception): ... +class CommandNotFound(ClickWebException): ... diff --git a/stubs/click-web/click_web/web_click_types.pyi b/stubs/click-web/click_web/web_click_types.pyi new file mode 100644 index 000000000000..3cfe56e58a91 --- /dev/null +++ b/stubs/click-web/click_web/web_click_types.pyi @@ -0,0 +1,14 @@ +import click + +class EmailParamType(click.ParamType): + def convert(self, value: str, param: click.Parameter, ctx: click.Context) -> str: ... + +class PasswordParamType(click.ParamType): + def convert(self, value: str, param: click.Parameter, ctx: click.Context) -> str: ... + +class TextAreaParamType(click.ParamType): + def convert(self, value: str, param: click.Parameter, ctx: click.Context) -> str: ... + +EMAIL_TYPE: EmailParamType +PASSWORD_TYPE: PasswordParamType +TEXTAREA_TYPE: TextAreaParamType