Skip to content

Commit e1e43b0

Browse files
committed
refactor(question.py): extend question types for preview hooks
1 parent d8ba22d commit e1e43b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

commitizen/question.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,28 @@ class ListQuestion(TypedDict, total=False):
1414
message: str
1515
choices: list[Choice]
1616
use_shortcuts: bool
17+
filter: Callable[[str], str]
18+
bottom_toolbar: Callable[[], str]
19+
validate: Callable[[str], bool | str]
1720

1821

1922
class InputQuestion(TypedDict, total=False):
2023
type: Literal["input"]
2124
name: str
2225
message: str
2326
filter: Callable[[str], str]
27+
bottom_toolbar: Callable[[], str]
28+
validate: Callable[[str], bool | str]
2429

2530

26-
class ConfirmQuestion(TypedDict):
31+
class ConfirmQuestion(TypedDict, total=False):
2732
type: Literal["confirm"]
2833
name: str
2934
message: str
3035
default: bool
36+
filter: Callable[[str], str]
37+
bottom_toolbar: Callable[[], str]
38+
validate: Callable[[str], bool | str]
3139

3240

3341
CzQuestion = ListQuestion | InputQuestion | ConfirmQuestion

0 commit comments

Comments
 (0)