import type { ChannelAdapter, IncomingMessage, OutgoingMessage } from "./types.js";
interface FeishuOptions {
    /** Feishu / Lark App ID (cli_...) */
    appId: string;
    /** Feishu / Lark App Secret */
    appSecret: string;
    /** Verification token from Feishu Event Subscription page (for v1 challenge) */
    verificationToken?: string;
    /** Encrypt key — if set, Feishu encrypts the event payload */
    encryptKey?: string;
    /** HTTP port for receiving Feishu event webhooks */
    port: number;
    /** Optional allow-list of Feishu open_id / union_id / user_id strings */
    allowedUserIds?: string[];
}
/**
 * Feishu (Lark) channel adapter.
 *
 * Setup steps in the Feishu Open Platform (open.feishu.cn):
 *   1. Go to your app → "事件订阅" (Event Subscriptions).
 *   2. Set Request URL to https://<tunnel>:<port>/feishu  (expose via ngrok / cloudflare).
 *   3. Subscribe to: im.message.receive_v1
 *   4. Under "权限管理" add: im:message (receive) + im:message:send_as_bot (send)
 *   5. Release / publish a new version so scopes take effect.
 *   6. Add the bot to a group or let users DM it.
 *
 * Inbound events:
 *   - Feishu sends a JSON POST to your endpoint.
 *   - If encryptKey is set the body is AES-CBC encrypted; we decrypt it.
 *   - We reply with the challenge on URL verification and 200 on events.
 *
 * Outbound:
 *   - We get a tenant_access_token via client credentials and POST to
 *     /open-apis/im/v1/messages.
 */
export declare class FeishuChannel implements ChannelAdapter {
    readonly name = "feishu";
    private opts;
    private server?;
    private handler?;
    private tokenCache?;
    private seenMessageIds;
    constructor(opts: FeishuOptions);
    start(handler: (msg: IncomingMessage) => Promise<void>): Promise<void>;
    stop(): Promise<void>;
    send(msg: OutgoingMessage): Promise<void>;
    private onRequest;
    private handleEvent;
    private getTenantAccessToken;
    private decrypt;
}
export {};
//# sourceMappingURL=feishu.d.ts.map