ErisPulse 2.3.3.dev0__py3-none-any.whl → 2.3.4.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. ErisPulse/Core/Bases/__init__.pyi +14 -0
  2. ErisPulse/Core/Bases/adapter.py +13 -1
  3. ErisPulse/Core/Bases/adapter.pyi +140 -0
  4. ErisPulse/Core/Bases/module.pyi +52 -0
  5. ErisPulse/Core/Event/__init__.pyi +26 -0
  6. ErisPulse/Core/Event/base.pyi +62 -0
  7. ErisPulse/Core/Event/command.pyi +113 -0
  8. ErisPulse/Core/Event/exceptions.pyi +43 -0
  9. ErisPulse/Core/Event/message.pyi +93 -0
  10. ErisPulse/Core/Event/meta.pyi +92 -0
  11. ErisPulse/Core/Event/notice.pyi +108 -0
  12. ErisPulse/Core/Event/request.pyi +76 -0
  13. ErisPulse/Core/Event/wrapper.py +2 -3
  14. ErisPulse/Core/Event/wrapper.pyi +403 -0
  15. ErisPulse/Core/__init__.py +16 -13
  16. ErisPulse/Core/__init__.pyi +16 -0
  17. ErisPulse/Core/_self_config.pyi +72 -0
  18. ErisPulse/Core/adapter.pyi +229 -0
  19. ErisPulse/Core/config.pyi +70 -0
  20. ErisPulse/Core/exceptions.pyi +60 -0
  21. ErisPulse/Core/lifecycle.py +6 -1
  22. ErisPulse/Core/lifecycle.pyi +92 -0
  23. ErisPulse/Core/logger.pyi +168 -0
  24. ErisPulse/Core/module.pyi +178 -0
  25. ErisPulse/Core/router.pyi +120 -0
  26. ErisPulse/Core/storage.pyi +273 -0
  27. ErisPulse/__init__.py +10 -9
  28. ErisPulse/__init__.pyi +309 -0
  29. ErisPulse/__main__.pyi +24 -0
  30. ErisPulse/sdk_protocol.py +143 -0
  31. ErisPulse/sdk_protocol.pyi +97 -0
  32. ErisPulse/utils/__init__.py +1 -1
  33. ErisPulse/utils/__init__.pyi +16 -0
  34. ErisPulse/utils/cli/__init__.py +11 -0
  35. ErisPulse/utils/cli/__init__.pyi +13 -0
  36. ErisPulse/utils/cli/__main__.py +225 -0
  37. ErisPulse/utils/cli/__main__.pyi +81 -0
  38. ErisPulse/utils/cli/base.py +52 -0
  39. ErisPulse/utils/cli/base.pyi +50 -0
  40. ErisPulse/utils/cli/commands/__init__.py +6 -0
  41. ErisPulse/utils/cli/commands/__init__.pyi +12 -0
  42. ErisPulse/utils/cli/commands/init.py +400 -0
  43. ErisPulse/utils/cli/commands/init.pyi +82 -0
  44. ErisPulse/utils/cli/commands/install.py +307 -0
  45. ErisPulse/utils/cli/commands/install.pyi +70 -0
  46. ErisPulse/utils/cli/commands/list.py +165 -0
  47. ErisPulse/utils/cli/commands/list.pyi +56 -0
  48. ErisPulse/utils/cli/commands/list_remote.py +128 -0
  49. ErisPulse/utils/cli/commands/list_remote.pyi +47 -0
  50. ErisPulse/utils/cli/commands/run.py +112 -0
  51. ErisPulse/utils/cli/commands/run.pyi +48 -0
  52. ErisPulse/utils/cli/commands/self_update.py +237 -0
  53. ErisPulse/utils/cli/commands/self_update.pyi +59 -0
  54. ErisPulse/utils/cli/commands/uninstall.py +37 -0
  55. ErisPulse/utils/cli/commands/uninstall.pyi +37 -0
  56. ErisPulse/utils/cli/commands/upgrade.py +62 -0
  57. ErisPulse/utils/cli/commands/upgrade.pyi +38 -0
  58. ErisPulse/utils/cli/registry.py +112 -0
  59. ErisPulse/utils/cli/registry.pyi +99 -0
  60. ErisPulse/utils/console.pyi +20 -0
  61. ErisPulse/utils/package_manager.pyi +224 -0
  62. ErisPulse/utils/reload_handler.pyi +64 -0
  63. {erispulse-2.3.3.dev0.dist-info → erispulse-2.3.4.dev0.dist-info}/METADATA +6 -20
  64. erispulse-2.3.4.dev0.dist-info/RECORD +89 -0
  65. {erispulse-2.3.3.dev0.dist-info → erispulse-2.3.4.dev0.dist-info}/licenses/LICENSE +3 -3
  66. ErisPulse/Core/ux.py +0 -635
  67. ErisPulse/utils/cli.py +0 -1097
  68. erispulse-2.3.3.dev0.dist-info/RECORD +0 -35
  69. {erispulse-2.3.3.dev0.dist-info → erispulse-2.3.4.dev0.dist-info}/WHEEL +0 -0
  70. {erispulse-2.3.3.dev0.dist-info → erispulse-2.3.4.dev0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,14 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for __init__.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 基础模块
9
+
10
+ 提供核心基类定义,包括适配器和模块基类
11
+ """
12
+
13
+ from .adapter import SendDSL, BaseAdapter
14
+ from .module import BaseModule
@@ -72,7 +72,19 @@ class SendDSL:
72
72
  >>> adapter.Send.To("123").Using("bot1").Text("Hello") # 支持乱序
73
73
  """
74
74
  return self.__class__(self._adapter, self._target_type, self._target_id, account_id)
75
-
75
+
76
+ def Account(self, account_id: Union[str, int]) -> 'SendDSL':
77
+ """
78
+ 设置发送账号
79
+
80
+ :param _account_id: 发送账号
81
+ :return: SendDSL实例
82
+
83
+ :example:
84
+ >>> adapter.Send.Account("bot1").To("123").Text("Hello")
85
+ >>> adapter.Send.To("123").Account("bot1").Text("Hello") # 支持乱序
86
+ """
87
+ return self.__class__(self._adapter, self._target_type, self._target_id, account_id)
76
88
 
77
89
  class BaseAdapter:
78
90
  """
@@ -0,0 +1,140 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for adapter.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 适配器基础模块
9
+
10
+ 提供适配器和消息发送DSL的基类实现
11
+
12
+ {!--< tips >!--}
13
+ 1. 用于实现与不同平台的交互接口
14
+ 2. 提供统一的消息发送DSL风格接口
15
+ {!--< /tips >!--}
16
+ """
17
+
18
+ import asyncio
19
+ from typing import Any, Optional, Union, Awaitable
20
+
21
+ class SendDSL:
22
+ """
23
+ 消息发送DSL基类
24
+
25
+ 用于实现 Send.To(...).Func(...) 风格的链式调用接口
26
+
27
+ {!--< tips >!--}
28
+ 1. 子类应实现具体的消息发送方法(如Text, Image等)
29
+ 2. 通过__getattr__实现动态方法调用
30
+ {!--< /tips >!--}
31
+ """
32
+ def __init__(self: None, adapter: BaseAdapter, target_type: Optional[str] = ..., target_id: Optional[str] = ..., account_id: Optional[str] = ...) -> ...:
33
+ """
34
+ 初始化DSL发送器
35
+
36
+ :param adapter: 所属适配器实例
37
+ :param target_type: 目标类型(可选)
38
+ :param target_id: 目标ID(可选)
39
+ :param _account_id: 发送账号(可选)
40
+ """
41
+ ...
42
+ def To(self: object, target_type: str = ..., target_id: Union[(str, int)] = ...) -> SendDSL:
43
+ """
44
+ 设置消息目标
45
+
46
+ :param target_type: 目标类型(可选)
47
+ :param target_id: 目标ID(可选)
48
+ :return: SendDSL实例
49
+
50
+ :example:
51
+ >>> adapter.Send.To("user", "123").Text("Hello")
52
+ >>> adapter.Send.To("123").Text("Hello") # 简化形式
53
+ """
54
+ ...
55
+ def Using(self: object, account_id: Union[(str, int)]) -> SendDSL:
56
+ """
57
+ 设置发送账号
58
+
59
+ :param _account_id: 发送账号
60
+ :return: SendDSL实例
61
+
62
+ :example:
63
+ >>> adapter.Send.Using("bot1").To("123").Text("Hello")
64
+ >>> adapter.Send.To("123").Using("bot1").Text("Hello") # 支持乱序
65
+ """
66
+ ...
67
+ def Account(self: object, account_id: Union[(str, int)]) -> SendDSL:
68
+ """
69
+ 设置发送账号
70
+
71
+ :param _account_id: 发送账号
72
+ :return: SendDSL实例
73
+
74
+ :example:
75
+ >>> adapter.Send.Account("bot1").To("123").Text("Hello")
76
+ >>> adapter.Send.To("123").Account("bot1").Text("Hello") # 支持乱序
77
+ """
78
+ ...
79
+
80
+ class BaseAdapter:
81
+ """
82
+ 适配器基类
83
+
84
+ 提供与外部平台交互的标准接口,子类必须实现必要方法
85
+
86
+ {!--< tips >!--}
87
+ 1. 必须实现call_api, start和shutdown方法
88
+ 2. 可以自定义Send类实现平台特定的消息发送逻辑
89
+ 3. 通过on装饰器注册事件处理器
90
+ 4. 支持OneBot12协议的事件处理
91
+ {!--< /tips >!--}
92
+ """
93
+ def __init__(self: None) -> ...:
94
+ ...
95
+ async def call_api(self: object, endpoint: str, **params: Any) -> Any:
96
+ """
97
+ 调用平台API的抽象方法
98
+
99
+ :param endpoint: API端点
100
+ :param params: API参数
101
+ :return: API调用结果
102
+ :raises NotImplementedError: 必须由子类实现
103
+ """
104
+ ...
105
+ async def start(self: object) -> None:
106
+ """
107
+ 启动适配器的抽象方法
108
+
109
+ :raises NotImplementedError: 必须由子类实现
110
+ """
111
+ ...
112
+ async def shutdown(self: object) -> None:
113
+ """
114
+ 关闭适配器的抽象方法
115
+
116
+ :raises NotImplementedError: 必须由子类实现
117
+ """
118
+ ...
119
+ async def emit(self: object) -> None:
120
+ ...
121
+ def send(self: object, target_type: str, target_id: str, message: Any, **kwargs: Any) -> asyncio.Task:
122
+ """
123
+ 发送消息的便捷方法,返回一个 asyncio Task
124
+
125
+ :param target_type: 目标类型
126
+ :param target_id: 目标ID
127
+ :param message: 消息内容
128
+ :param kwargs: 其他参数
129
+ - method: 发送方法名(默认为"Text")
130
+ :return: asyncio.Task 对象,用户可以自主决定是否等待
131
+
132
+ :raises AttributeError: 当发送方法不存在时抛出
133
+
134
+ :example:
135
+ >>> task = adapter.send("user", "123", "Hello")
136
+ >>> # 用户可以选择等待: result = await task
137
+ >>> # 或者不等待让其在后台执行
138
+ >>> await adapter.send("group", "456", "Hello", method="Markdown") # 直接等待
139
+ """
140
+ ...
@@ -0,0 +1,52 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for module.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 模块基础模块
9
+
10
+ 提供模块基类定义和标准接口
11
+ """
12
+
13
+ class BaseModule:
14
+ """
15
+ 模块基类
16
+
17
+ 提供模块加载和卸载的标准接口
18
+ """
19
+ def should_eager_load() -> bool:
20
+ """
21
+ 模块是否应该在启动时加载
22
+ 默认为False(即懒加载)
23
+
24
+ :return: 是否应该在启动时加载
25
+ """
26
+ ...
27
+ async def on_load(self: object, event: dict) -> bool:
28
+ """
29
+ 当模块被加载时调用
30
+
31
+ :param event: 事件内容
32
+ :return: 处理结果
33
+
34
+ {!--< tips >!--}
35
+ 其中,event事件内容为:
36
+ `{ "module_name": "模块名" }`
37
+ {!--< /tips >!--}
38
+ """
39
+ ...
40
+ async def on_unload(self: object, event: dict) -> bool:
41
+ """
42
+ 当模块被卸载时调用
43
+
44
+ :param event: 事件内容
45
+ :return: 处理结果
46
+
47
+ {!--< tips >!--}
48
+ 其中,event事件内容为:
49
+ `{ "module_name": "模块名" }`
50
+ {!--< /tips >!--}
51
+ """
52
+ ...
@@ -0,0 +1,26 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for __init__.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 事件处理模块
9
+
10
+ 提供统一的事件处理接口,支持命令、消息、通知、请求和元事件处理
11
+
12
+ {!--< tips >!--}
13
+ 1. 所有事件处理都基于OneBot12标准事件格式
14
+ 2. 通过装饰器方式注册事件处理器
15
+ 3. 支持优先级和条件过滤
16
+ {!--< /tips >!--}
17
+ """
18
+
19
+ from .command import command
20
+ from .message import message
21
+ from .notice import notice
22
+ from .request import request
23
+ from .meta import meta
24
+ from .wrapper import Event
25
+ from . import exceptions
26
+ from .. import config
@@ -0,0 +1,62 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for base.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 事件处理基础模块
9
+
10
+ 提供事件处理的核心功能,包括事件注册和处理
11
+
12
+ {!--< tips >!--}
13
+ 1. 所有事件处理都基于OneBot12标准事件格式
14
+ 2. 通过适配器系统进行事件分发和接收
15
+ {!--< /tips >!--}
16
+ """
17
+
18
+ from .. import adapter, logger
19
+ from typing import Callable, Any, Dict, List
20
+ import asyncio
21
+ from .wrapper import Event
22
+
23
+ class BaseEventHandler:
24
+ """
25
+ 基础事件处理器
26
+
27
+ 提供事件处理的基本功能,包括处理器注册和注销
28
+ """
29
+ def __init__(self: None, event_type: str, module_name: str = ...) -> ...:
30
+ """
31
+ 初始化事件处理器
32
+
33
+ :param event_type: 事件类型
34
+ :param module_name: 模块名称
35
+ """
36
+ ...
37
+ def register(self: object, handler: Callable, priority: int = ..., condition: Callable = ...) -> ...:
38
+ """
39
+ 注册事件处理器
40
+
41
+ :param handler: 事件处理器函数
42
+ :param priority: 处理器优先级,数值越小优先级越高
43
+ :param condition: 处理器条件函数,返回True时才会执行处理器
44
+ """
45
+ ...
46
+ def unregister(self: object, handler: Callable) -> bool:
47
+ """
48
+ 注销事件处理器
49
+
50
+ :param handler: 要注销的事件处理器
51
+ :return: 是否成功注销
52
+ """
53
+ ...
54
+ def __call__(self: object, priority: int = ..., condition: Callable = ...) -> ...:
55
+ """
56
+ 装饰器方式注册事件处理器
57
+
58
+ :param priority: 处理器优先级
59
+ :param condition: 处理器条件函数
60
+ :return: 装饰器函数
61
+ """
62
+ ...
@@ -0,0 +1,113 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for command.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 命令处理模块
9
+
10
+ 提供基于装饰器的命令注册和处理功能
11
+
12
+ {!--< tips >!--}
13
+ 1. 支持命令别名和命令组
14
+ 2. 支持命令权限控制
15
+ 3. 支持命令帮助系统
16
+ 4. 支持等待用户回复交互
17
+ {!--< /tips >!--}
18
+ """
19
+
20
+ from .base import BaseEventHandler
21
+ from .. import adapter, config, logger
22
+ from typing import Callable, Union, List, Dict, Any, Optional, Awaitable
23
+ import asyncio
24
+
25
+ class CommandHandler:
26
+ """
27
+ 命令处理器
28
+
29
+ 提供命令注册、处理和管理功能
30
+ """
31
+ def __init__(self: None) -> ...:
32
+ ...
33
+ def __call__(self: object, name: Union[(str, List[str])] = ..., aliases: List[str] = ..., group: str = ..., priority: int = ..., permission: Callable = ..., help: str = ..., usage: str = ..., hidden: bool = ...) -> ...:
34
+ """
35
+ 命令装饰器
36
+
37
+ :param name: 命令名称,可以是字符串或字符串列表
38
+ :param aliases: 命令别名列表
39
+ :param group: 命令组名称
40
+ :param priority: 处理器优先级
41
+ :param permission: 权限检查函数,返回True时允许执行命令
42
+ :param help: 命令帮助信息
43
+ :param usage: 命令使用方法
44
+ :param hidden: 是否在帮助中隐藏命令
45
+ :return: 装饰器函数
46
+ """
47
+ ...
48
+ def unregister(self: object, handler: Callable) -> bool:
49
+ """
50
+ 注销命令处理器
51
+
52
+ :param handler: 要注销的命令处理器
53
+ :return: 是否成功注销
54
+ """
55
+ ...
56
+ async def wait_reply(self: object, event: Dict[(str, Any)], prompt: str = ..., timeout: float = ..., callback: Callable[([Dict[(str, Any)]], Awaitable[Any])] = ..., validator: Callable[([Dict[(str, Any)]], bool)] = ...) -> Optional[Dict[(str, Any)]]:
57
+ """
58
+ 等待用户回复
59
+
60
+ :param event: 原始事件数据
61
+ :param prompt: 提示消息,如果提供会发送给用户
62
+ :param timeout: 等待超时时间(秒)
63
+ :param callback: 回调函数,当收到回复时执行
64
+ :param validator: 验证函数,用于验证回复是否有效
65
+ :return: 用户回复的事件数据,如果超时则返回None
66
+ """
67
+ ...
68
+ async def _check_pending_reply(self: object, event: Dict[(str, Any)]) -> ...:
69
+ """
70
+ 检查是否是等待回复的消息
71
+
72
+ :param event: 消息事件数据
73
+ """
74
+ ...
75
+ def get_command(self: object, name: str) -> Optional[Dict]:
76
+ """
77
+ 获取命令信息
78
+
79
+ :param name: 命令名称
80
+ :return: 命令信息字典,如果不存在则返回None
81
+ """
82
+ ...
83
+ def get_commands(self: object) -> Dict[(str, Dict)]:
84
+ """
85
+ 获取所有命令
86
+
87
+ :return: 命令信息字典
88
+ """
89
+ ...
90
+ def get_group_commands(self: object, group: str) -> List[str]:
91
+ """
92
+ 获取命令组中的命令
93
+
94
+ :param group: 命令组名称
95
+ :return: 命令名称列表
96
+ """
97
+ ...
98
+ def get_visible_commands(self: object) -> Dict[(str, Dict)]:
99
+ """
100
+ 获取所有可见命令(非隐藏命令)
101
+
102
+ :return: 可见命令信息字典
103
+ """
104
+ ...
105
+ def help(self: object, command_name: str = ..., show_hidden: bool = ...) -> str:
106
+ """
107
+ 生成帮助信息
108
+
109
+ :param command_name: 命令名称,如果为None则生成所有命令的帮助
110
+ :param show_hidden: 是否显示隐藏命令
111
+ :return: 帮助信息字符串
112
+ """
113
+ ...
@@ -0,0 +1,43 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for exceptions.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 事件系统异常处理模块
9
+
10
+ 提供事件系统中可能发生的各种异常类型定义
11
+ """
12
+
13
+ class EventException(Exception):
14
+ """
15
+ 事件系统基础异常
16
+
17
+ 所有事件系统相关异常的基类
18
+ """
19
+ ...
20
+
21
+ class CommandException(EventException):
22
+ """
23
+ 命令处理异常
24
+
25
+ 当命令处理过程中发生错误时抛出
26
+ """
27
+ ...
28
+
29
+ class EventHandlerException(EventException):
30
+ """
31
+ 事件处理器异常
32
+
33
+ 当事件处理器执行过程中发生错误时抛出
34
+ """
35
+ ...
36
+
37
+ class EventNotFoundException(EventException):
38
+ """
39
+ 事件未找到异常
40
+
41
+ 当尝试获取不存在的事件处理器时抛出
42
+ """
43
+ ...
@@ -0,0 +1,93 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for message.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 消息处理模块
9
+
10
+ 提供基于装饰器的消息事件处理功能
11
+
12
+ {!--< tips >!--}
13
+ 1. 支持私聊、群聊消息分类处理
14
+ 2. 支持@消息特殊处理
15
+ 3. 支持自定义条件过滤
16
+ {!--< /tips >!--}
17
+ """
18
+
19
+ from .base import BaseEventHandler
20
+ from typing import Callable, Dict, Any
21
+
22
+ class MessageHandler:
23
+ """
24
+ 消息事件处理器
25
+
26
+ 提供不同类型消息事件的处理功能
27
+ """
28
+ def __init__(self: None) -> ...:
29
+ ...
30
+ def on_message(self: object, priority: int = ...) -> ...:
31
+ """
32
+ 消息事件装饰器
33
+
34
+ :param priority: 处理器优先级
35
+ :return: 装饰器函数
36
+ """
37
+ ...
38
+ def remove_message_handler(self: object, handler: Callable) -> bool:
39
+ """
40
+ 取消注册消息事件处理器
41
+
42
+ :param handler: 要取消注册的处理器
43
+ :return: 是否成功取消注册
44
+ """
45
+ ...
46
+ def on_private_message(self: object, priority: int = ...) -> ...:
47
+ """
48
+ 私聊消息事件装饰器
49
+
50
+ :param priority: 处理器优先级
51
+ :return: 装饰器函数
52
+ """
53
+ ...
54
+ def remove_private_message_handler(self: object, handler: Callable) -> bool:
55
+ """
56
+ 取消注册私聊消息事件处理器
57
+
58
+ :param handler: 要取消注册的处理器
59
+ :return: 是否成功取消注册
60
+ """
61
+ ...
62
+ def on_group_message(self: object, priority: int = ...) -> ...:
63
+ """
64
+ 群聊消息事件装饰器
65
+
66
+ :param priority: 处理器优先级
67
+ :return: 装饰器函数
68
+ """
69
+ ...
70
+ def remove_group_message_handler(self: object, handler: Callable) -> bool:
71
+ """
72
+ 取消注册群聊消息事件处理器
73
+
74
+ :param handler: 要取消注册的处理器
75
+ :return: 是否成功取消注册
76
+ """
77
+ ...
78
+ def on_at_message(self: object, priority: int = ...) -> ...:
79
+ """
80
+ @消息事件装饰器
81
+
82
+ :param priority: 处理器优先级
83
+ :return: 装饰器函数
84
+ """
85
+ ...
86
+ def remove_at_message_handler(self: object, handler: Callable) -> bool:
87
+ """
88
+ 取消注册@消息事件处理器
89
+
90
+ :param handler: 要取消注册的处理器
91
+ :return: 是否成功取消注册
92
+ """
93
+ ...
@@ -0,0 +1,92 @@
1
+ # type: ignore
2
+ #
3
+ # Auto-generated type stub for meta.py
4
+ # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
+ #
6
+
7
+ """
8
+ ErisPulse 元事件处理模块
9
+
10
+ 提供基于装饰器的元事件处理功能
11
+
12
+ {!--< tips >!--}
13
+ 1. 支持连接、断开连接等生命周期事件
14
+ 2. 适用于系统状态监控和初始化操作
15
+ {!--< /tips >!--}
16
+ """
17
+
18
+ from .base import BaseEventHandler
19
+ from typing import Callable, Dict, Any
20
+
21
+ class MetaHandler:
22
+ """
23
+ 元事件处理器
24
+
25
+ 提供元事件处理功能,如连接、断开连接等
26
+ """
27
+ def __init__(self: None) -> ...:
28
+ ...
29
+ def on_meta(self: object, priority: int = ...) -> ...:
30
+ """
31
+ 通用元事件装饰器
32
+
33
+ :param priority: 处理器优先级
34
+ :return: 装饰器函数
35
+ """
36
+ ...
37
+ def remove_meta_handler(self: object, handler: Callable) -> bool:
38
+ """
39
+ 取消注册通用元事件处理器
40
+
41
+ :param handler: 要取消注册的处理器
42
+ :return: 是否成功取消注册
43
+ """
44
+ ...
45
+ def on_connect(self: object, priority: int = ...) -> ...:
46
+ """
47
+ 连接事件装饰器
48
+
49
+ :param priority: 处理器优先级
50
+ :return: 装饰器函数
51
+ """
52
+ ...
53
+ def remove_connect_handler(self: object, handler: Callable) -> bool:
54
+ """
55
+ 取消注册连接事件处理器
56
+
57
+ :param handler: 要取消注册的处理器
58
+ :return: 是否成功取消注册
59
+ """
60
+ ...
61
+ def on_disconnect(self: object, priority: int = ...) -> ...:
62
+ """
63
+ 断开连接事件装饰器
64
+
65
+ :param priority: 处理器优先级
66
+ :return: 装饰器函数
67
+ """
68
+ ...
69
+ def remove_disconnect_handler(self: object, handler: Callable) -> bool:
70
+ """
71
+ 取消注册断开连接事件处理器
72
+
73
+ :param handler: 要取消注册的处理器
74
+ :return: 是否成功取消注册
75
+ """
76
+ ...
77
+ def on_heartbeat(self: object, priority: int = ...) -> ...:
78
+ """
79
+ 心跳事件装饰器
80
+
81
+ :param priority: 处理器优先级
82
+ :return: 装饰器函数
83
+ """
84
+ ...
85
+ def remove_heartbeat_handler(self: object, handler: Callable) -> bool:
86
+ """
87
+ 取消注册心跳事件处理器
88
+
89
+ :param handler: 要取消注册的处理器
90
+ :return: 是否成功取消注册
91
+ """
92
+ ...