# Copyright (c) 2025, JINGROW and contributors
# For license information, please see license.txt

"""
Jingrow Hooks System - 现代化的钩子系统

特性：
- 配置式注册（hooks.py）
- 装饰器注册
- 同步/异步执行
- 优先级支持
- 条件过滤
- 类型安全
- 易于测试

快速开始:

1. 配置式注册 (推荐用于应用开发):
   在 hooks.py 中:
       pg_events = {
           "User": {
               "after_insert": "myapp.hooks.send_welcome_email",
           }
       }

2. 装饰器注册 (推荐用于代码中):
   from jingrow.core.hooks import hook, Priority
   
   @hook('page.User.on_update', sender='User', priority=Priority.HIGH)
   def handle_user_update(page, **kwargs):
       print(f"User {page.name} updated")

3. 发送钩子:
   from jingrow.core.hooks import execute_hook
   
   execute_hook('page.User.on_update', sender='User', page=page_obj)
"""

from .signal import Signal, signal, Priority
from .registry import HookRegistry, registry
from .loader import HookLoader, load_app_hooks, register_loaded_hooks
from .executor import HookExecutor, execute_hook, execute_hook_async
from .decorators import hook, register_hook

__all__ = [
    # Core classes
    "Signal",
    "signal",
    "Priority",
    "HookRegistry",
    "registry",
    "HookLoader",
    "load_app_hooks",
    "register_loaded_hooks",
    "HookExecutor",
    "execute_hook",
    "execute_hook_async",
    # Decorators
    "hook",
    "register_hook",
]

__version__ = "1.0.0"
