💡 补充 params 模块的类型注解 (#1458)

This commit is contained in:
Akirami 2022-12-10 00:12:28 +08:00 committed by GitHub
parent cd9e30bd52
commit c4286f1f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,7 @@ def RegexStr() -> str:
return Depends(_regex_str, use_cache=False) return Depends(_regex_str, use_cache=False)
def _regex_group(state: T_State): def _regex_group(state: T_State) -> Tuple[Any, ...]:
return state[REGEX_GROUP] return state[REGEX_GROUP]
@ -165,7 +165,7 @@ def RegexGroup() -> Tuple[Any, ...]:
return Depends(_regex_group, use_cache=False) return Depends(_regex_group, use_cache=False)
def _regex_dict(state: T_State): def _regex_dict(state: T_State) -> Dict[str, Any]:
return state[REGEX_DICT] return state[REGEX_DICT]
@ -213,7 +213,7 @@ def Keyword() -> str:
def Received(id: Optional[str] = None, default: Any = None) -> Any: def Received(id: Optional[str] = None, default: Any = None) -> Any:
"""`receive` 事件参数""" """`receive` 事件参数"""
def _received(matcher: "Matcher"): def _received(matcher: "Matcher") -> Any:
return matcher.get_receive(id or "", default) return matcher.get_receive(id or "", default)
return Depends(_received, use_cache=False) return Depends(_received, use_cache=False)