Skip to content

Commit

Permalink
Add stubs for "click-web" package
Browse files Browse the repository at this point in the history
  • Loading branch information
pyhedgehog committed Dec 6, 2024
1 parent 98f070a commit 248ce05
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"stubs/caldav",
"stubs/cffi",
"stubs/click-default-group",
"stubs/click-web",
"stubs/commonmark",
"stubs/corus",
"stubs/dateparser",
Expand Down
2 changes: 2 additions & 0 deletions stubs/click-web/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = "0.8.*"
upstream_repository = "https://github.com/fredrik-corneliusson/click-web"
9 changes: 9 additions & 0 deletions stubs/click-web/click_web/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
2 changes: 2 additions & 0 deletions stubs/click-web/click_web/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class ClickWebException(Exception): ...
class CommandNotFound(ClickWebException): ...
16 changes: 16 additions & 0 deletions stubs/click-web/click_web/web_click_types.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import typing as t

import click

class EmailParamType(click.ParamType):
def convert(self, value: t.Any, param: click.Parameter | None, ctx: click.Context | None) -> t.Any: ...

class PasswordParamType(click.ParamType):
def convert(self, value: t.Any, param: click.Parameter | None, ctx: click.Context | None) -> t.Any: ...

class TextAreaParamType(click.ParamType):
def convert(self, value: t.Any, param: click.Parameter | None, ctx: click.Context | None) -> t.Any: ...

EMAIL_TYPE: EmailParamType
PASSWORD_TYPE: PasswordParamType
TEXTAREA_TYPE: TextAreaParamType

0 comments on commit 248ce05

Please sign in to comment.