import type { ServiceInstanceInfo, LaneManager, LaneManagerOptions, LaneInfo, RequestLog } from "./types";

/**
 * 多泳道管理器模块
 *
 * 此模块提供了基于 Nacos 的服务注册、发现和请求路由功能，
 * 用于在 Nuxt3 应用中实现多泳道架构。
 *
 * 主要功能：
 * 1. 服务注册与发现：将服务实例注册到 Nacos，并从 Nacos 获取目标泳道的服务实例
 * 2. 跨泳道请求转发：将请求转发到目标泳道的服务实例
 * 3. 健康检查：提供健康检查接口
 *
 * @module multi-lane-manager
 */

// 导出核心类型
export type { ServiceInstanceInfo, LaneManager, LaneManagerOptions, LaneInfo, RequestLog };

// 导出所有类型
export type * from "./types";

// 导出核心功能
export { default as nitroPlugin } from "./runtime/nitro-plugin";
export { createServerMiddleware } from "./runtime/server-utils";
export {
  registerServiceInstance,
  deregisterServiceInstance,
  getNacosLaneInstances
} from "./utils/nacos";

// 导出配置和日志工具
export { getConfig, updateConfigPort } from "./utils/config";
export { createLogger, logger } from "./utils/logger";
export * from "./utils/defaults";

/**
 * 版本变更说明：
 * 1. 移除了 export * from "./runtime" 以便更精确控制导出内容
 * 2. 移除了 createServerMiddleware as createLaneMiddleware 的别名导出
 * 3. 移除了旧的 createLaneManager 工厂函数定义
 * 4. 添加了 nitroPlugin 导出，用于在 Nitro 服务器启动时注册服务
 * 5. 移除了 nuxtPlugin 导出，完全使用 Nitro 插件实现服务注册
 * 6. 添加了配置和日志工具的导出，方便用户自定义配置和日志
 *
 * 如果您使用了这些已移除的 API，请更新您的代码以使用新的导出。
 */
