This commit is contained in:
2026-01-29 02:22:48 +03:00
parent 9aa99352fe
commit 107530a4b1
7 changed files with 209 additions and 145 deletions
+16 -4
View File
@@ -1,10 +1,17 @@
__all__ = ["NonStandardBehaviorHandler", "EmptyCommandHandler", "Printer", "DescriptionMessageGenerator", "HandlerFunc"]
__all__ = [
"NonStandardBehaviorHandler",
"EmptyCommandHandler",
"MostSimilarCommandGetter",
"Printer",
"DescriptionMessageGenerator",
"HandlerFunc",
]
from typing import Any, Protocol, TypeVar
from typing import Any, ParamSpec, Protocol, TypeVar
from argenta.response import Response
T = TypeVar("T", contravariant=True)
P = ParamSpec("P")
T = TypeVar("T", contravariant=True)
class NonStandardBehaviorHandler(Protocol[T]):
@@ -22,6 +29,11 @@ class Printer(Protocol):
raise NotImplementedError
class MostSimilarCommandGetter(Protocol):
def __call__(self, _unknown_trigger: str, /) -> str | None:
raise NotImplementedError
class DescriptionMessageGenerator(Protocol):
def __call__(self, _command: str, _description: str, /) -> str:
raise NotImplementedError