From 2827c09958aa6778e4499d34f5949d6f5677f2c6 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 28 Jun 2024 11:33:07 +0800 Subject: refactor: hrc.rules - > hrc.rule --- hrc/typing.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'hrc/typing.py') diff --git a/hrc/typing.py b/hrc/typing.py index b3ced30..934fc98 100644 --- a/hrc/typing.py +++ b/hrc/typing.py @@ -1,7 +1,19 @@ -from typing import TypeVar, Generic, Any, TYPE_CHECKING, Awaitable, Callable, Optional +# ruff: noqa: TCH001 +from typing import TYPE_CHECKING, Awaitable, Callable, Optional, TypeVar if TYPE_CHECKING: - from .rules import Rules - - -RulesT = TypeVar("RulesT", bound="Rules[Any]") \ No newline at end of file + from typing import Any + + from .core import Core + from .config import ConfigModel + from .event import Event + from .rule import Rule + + +StateT = TypeVar("StateT") +EventT = TypeVar("EventT", bound="Event[Any]") +RuleT = TypeVar("RuleT", bound="Rule[Any, Any, Any]") +ConfigT = TypeVar("ConfigT", bound=Optional["ConfigModel"]) + +CoreHook = Callable[["Core"], Awaitable[None]] +EventHook = Callable[["Event[Any]"], Awaitable[None]] \ No newline at end of file -- cgit v1.2.3-70-g09d2