change hook parse typing

This commit is contained in:
yanyongyu 2022-02-04 11:12:17 +08:00
parent ec9e8511b7
commit e720584044
No known key found for this signature in database
GPG Key ID: 796D8A7FB73396EB

View File

@ -72,7 +72,7 @@ RUN_POSTPCS_PARAMS = [
def event_preprocessor(func: T_EventPreProcessor) -> T_EventPreProcessor:
"""事件预处理。装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。"""
_event_preprocessors.add(
Dependent[None].parse(call=func, allow_types=EVENT_PCS_PARAMS)
Dependent[Any].parse(call=func, allow_types=EVENT_PCS_PARAMS)
)
return func
@ -80,7 +80,7 @@ def event_preprocessor(func: T_EventPreProcessor) -> T_EventPreProcessor:
def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor:
"""事件后处理。装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。"""
_event_postprocessors.add(
Dependent[None].parse(call=func, allow_types=EVENT_PCS_PARAMS)
Dependent[Any].parse(call=func, allow_types=EVENT_PCS_PARAMS)
)
return func
@ -88,7 +88,7 @@ def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor:
def run_preprocessor(func: T_RunPreProcessor) -> T_RunPreProcessor:
"""运行预处理。装饰一个函数,使它在每次事件响应器运行前执行。"""
_run_preprocessors.add(
Dependent[None].parse(call=func, allow_types=RUN_PREPCS_PARAMS)
Dependent[Any].parse(call=func, allow_types=RUN_PREPCS_PARAMS)
)
return func
@ -96,7 +96,7 @@ def run_preprocessor(func: T_RunPreProcessor) -> T_RunPreProcessor:
def run_postprocessor(func: T_RunPostProcessor) -> T_RunPostProcessor:
"""运行后处理。装饰一个函数,使它在每次事件响应器运行后执行。"""
_run_postprocessors.add(
Dependent[None].parse(call=func, allow_types=RUN_POSTPCS_PARAMS)
Dependent[Any].parse(call=func, allow_types=RUN_POSTPCS_PARAMS)
)
return func