@mxlabs/okxnotify
Version:
OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle
31 lines (30 loc) • 761 B
TypeScript
import { FEISHU_CUSTOM_EVENT_TYPE } from './constant';
/**
* 飞书自定义事件执行路由器
*/
export interface FeishuRouterEventItem {
type: FEISHU_CUSTOM_EVENT_TYPE;
handler: (payload: any) => Promise<{
text: string;
title: string;
}>;
}
export declare class FeishuRouter {
private router;
constructor(options: {
router?: Array<FeishuRouterEventItem>;
});
/**
* 注册路由,保留最新注册的 handler
* @param routers 路由列表
*/
register(routers: Array<FeishuRouterEventItem>): void;
/**
* 执行路由
* @param payload
*/
invoke<T>(eventType: FEISHU_CUSTOM_EVENT_TYPE, payload: T): Promise<{
text: string;
title: string;
}>;
}