import { type Delivery, type Inbound, type SessionIdentity } from './gateway/index.ts'; import type { GatewayRuntime } from './runtime.ts'; import { inboundFromFeishuCardAction, type FeishuCardActionEvent } from './feishu-card.ts'; export { inboundFromFeishuCardAction }; export type { FeishuCardActionEvent }; export type FeishuMessageEvent = { sender?: { sender_id?: { open_id?: string; }; sender_type?: string; }; message?: { message_id?: string; chat_id?: string; chat_type?: string; thread_id?: string; message_type?: string; content?: string; mentions?: { mentioned_type?: string; }[]; }; }; export declare function feishuIdentity(args: { chatId: string; chatType?: string; threadId?: string; }): SessionIdentity; export declare function textFromFeishuContent(content: string | undefined): string; export declare function inboundFromFeishu(args: { user: string; chatId: string; chatType?: string; threadId?: string; text: string; id: string; mentioned?: boolean; commands?: readonly string[]; }): Inbound; export declare function inboundFromFeishuEvent(event: FeishuMessageEvent, commands: readonly string[]): Inbound | undefined; export type FeishuOutbound = { readonly chatId: string; readonly replyId?: string; readonly msgType: 'text' | 'post' | 'interactive'; readonly content: string; readonly mode: 'create' | 'patch' | 'react' | 'unreact'; readonly messageId?: string; readonly requestId?: string; readonly emoji?: string; readonly reactionId?: string; }; export type FeishuSay = (out: FeishuOutbound) => Promise<{ messageId?: string; reactionId?: string; } | void>; /** In-memory Feishu turn chrome: Typing reaction on the user's last message. */ export type FeishuLive = { lastUserMessageId: Map; typing: Map; }; /** Official Feishu post+md payload. CommonMark 0.31 + GFM. */ export declare function feishuPostContent(text: string): string; /** Detect Markdown that Feishu `text` will not render (lists, fences, headings, tables, emphasis). */ export declare function looksLikeMarkdown(text: string): boolean; /** Map one gateway chat delivery to a Feishu create/patch/react. No period-splitting. */ export declare function feishuOutboundFromDelivery(delivery: Delivery, cards: Map, live?: FeishuLive): FeishuOutbound | undefined; export declare function presentFeishuDelivery(delivery: Delivery, say: FeishuSay, cards?: Map, live?: FeishuLive): Promise; export declare function syncFeishuCatalog(runtime: GatewayRuntime, tokens: { appId: string; appSecret: string; }): Promise; export declare function runFeishu(runtime: GatewayRuntime, tokens: { appId: string; appSecret: string; }): Promise<() => Promise>;