import type { WebhookEvent } from './types';
/** Options for parsing a webhook event. */
export interface ParseWebhookEventOptions {
    /** Raw request body (string or Buffer). */
    payload: string | Buffer;
    /** HMAC-SHA256 signature from `x-amigo-request-signature` header. */
    signature?: string;
    /** Timestamp from `x-amigo-request-timestamp` header (ms). */
    timestamp?: string;
    /** Webhook destination secret for signature verification. */
    secret?: string;
    /**
     * Maximum age of the webhook event in milliseconds.
     * Events older than this are rejected to prevent replay attacks.
     * @default 300_000 (5 minutes)
     */
    maxAge?: number;
}
/** Error thrown when webhook verification fails. */
export declare class WebhookVerificationError extends Error {
    constructor(message: string);
}
/**
 * Parse and optionally verify a webhook event payload.
 *
 * If `signature`, `timestamp`, and `secret` are all provided, the
 * payload's HMAC-SHA256 signature is verified before parsing.
 *
 * @throws {WebhookVerificationError} If signature verification fails or the event is too old.
 * @returns The typed webhook event.
 */
export declare function parseWebhookEvent(options: ParseWebhookEventOptions): WebhookEvent;
/**
 * Verify the HMAC-SHA256 signature of a webhook payload.
 *
 * @throws {WebhookVerificationError} If the signature does not match.
 */
export declare function verifySignature(body: string, timestamp: string, signature: string, secret: string): void;
