export interface SlackWebhookRequest { path: string; rawBody: string; contentType: string; signature: string; timestamp: string; } export interface SlackWebhookResponse { status: number; body?: unknown; text?: string; contentType?: string; } export type SlackWebhookHandler = (req: SlackWebhookRequest) => Promise; export declare function normalizeSlackWebhookPath(rawPath: string | undefined): string; export declare function registerSlackWebhookHandler(params: { path: string; accountId: string; handler: SlackWebhookHandler; }): () => void; export declare function listRegisteredSlackWebhookPaths(): string[]; export declare function dispatchSlackWebhookRequest(req: SlackWebhookRequest): Promise; /** * Verify Slack's `X-Slack-Signature` (`v0=`) and 5-minute replay window. */ export declare function verifySlackRequestSignature(params: { signingSecret: string; rawBody: string; timestamp: string; signature: string; nowSec?: number; }): boolean; export type ParsedSlackWebhookPayload = { kind: 'url_verification'; challenge: string; } | { kind: 'events_api'; payload: Record; } | { kind: 'interactive'; payload: Record; } | { kind: 'slash_commands'; payload: Record; } | { kind: 'unknown'; }; export declare function parseSlackWebhookPayload(rawBody: string, contentType: string): ParsedSlackWebhookPayload;