/**
 * Card phase state machine types and helpers for Feishu streaming cards.
 *
 * Defines the lifecycle phases a card transitions through (idle → creating →
 * streaming → completed/aborted/terminated/creation_failed) along with
 * validated transitions and throttle constants.
 */
export declare const CARD_PHASES: {
    readonly idle: "idle";
    readonly creating: "creating";
    readonly streaming: "streaming";
    readonly completed: "completed";
    readonly aborted: "aborted";
    readonly terminated: "terminated";
    readonly creation_failed: "creation_failed";
};
export type CardPhase = (typeof CARD_PHASES)[keyof typeof CARD_PHASES];
export declare const TERMINAL_PHASES: ReadonlySet<CardPhase>;
/**
 * Why a terminal phase was entered.
 *
 * - `normal`          — streaming completed successfully.
 * - `error`           — an error occurred during reply generation.
 * - `abort`           — explicitly cancelled by the caller.
 * - `unavailable`     — source message was deleted/recalled.
 * - `creation_failed` — card creation failed, falling back to static delivery.
 */
export type TerminalReason = 'normal' | 'error' | 'abort' | 'unavailable' | 'creation_failed';
export declare const PHASE_TRANSITIONS: Record<CardPhase, ReadonlySet<CardPhase>>;
/**
 * Throttle intervals for card updates.
 *
 * - `CARDKIT_MS`          — CardKit `cardElement.content()`, designed for streaming.
 * - `PATCH_MS`            — `im.message.patch`, strict rate limits (code 230020).
 * - `LONG_GAP_THRESHOLD_MS` — After a long idle gap, defer the first flush briefly.
 * - `BATCH_AFTER_GAP_MS`  — Batching window after a long gap.
 * - `REASONING_STATUS_MS` — Throttle for reasoning status updates.
 */
export declare const THROTTLE_CONSTANTS: {
    readonly CARDKIT_MS: 100;
    readonly PATCH_MS: 1500;
    readonly LONG_GAP_THRESHOLD_MS: 2000;
    readonly BATCH_AFTER_GAP_MS: 300;
    readonly REASONING_STATUS_MS: 1500;
};
/** Returns `true` if the phase is terminal (no further transitions). */
export declare function isTerminalPhase(phase: CardPhase): boolean;
/**
 * Transition from `current` to `target` phase.
 *
 * Validates the transition against `PHASE_TRANSITIONS` and returns the target
 * phase. Throws if the transition is not allowed.
 */
export declare function transitionPhase(current: CardPhase, target: CardPhase): CardPhase;
