import { EventLog } from './events/append.js';
import type { WorkflowEvent } from './events/schema.js';
import { type Snapshot } from './events/replay.js';
import { type RunChatBinding } from './loader.js';
export type WorkflowEventCallback = (event: WorkflowEvent) => void | Promise<void>;
export type WorkflowEventWatcherOptions = {
    runsDir?: string;
    onError?: (err: unknown) => void;
    pollIntervalMs?: number;
    useFsWatch?: boolean;
};
export declare class WorkflowEventWatcher {
    private readonly onNewEvent;
    private readonly opts;
    readonly runId: string;
    readonly log: EventLog;
    readonly ready: Promise<void>;
    private watcher?;
    private pollTimer?;
    private lastSeq;
    private draining;
    private pendingDrain;
    private closed;
    constructor(runId: string, onNewEvent: WorkflowEventCallback, opts?: WorkflowEventWatcherOptions);
    close(): void;
    drain(): Promise<void>;
    private start;
}
export type WorkflowFanoutDeps = {
    runsDir?: string;
    binding?: RunChatBinding;
    snapshot?: Snapshot;
    sendCard?: (larkAppId: string, chatId: string, cardJson: string, msgType: 'interactive') => Promise<string>;
};
export declare function handleWorkflowFanoutEvent(event: WorkflowEvent, deps?: WorkflowFanoutDeps): Promise<string | undefined>;
//# sourceMappingURL=fanout.d.ts.map