export declare const INDICATOR_STOP_WAIT_MS = 2000; export type SendIndicator = () => Promise; type Cancel = () => void; export interface IndicatorTimers { every: (callback: () => void, delay_ms: number) => Cancel; after: (callback: () => void, delay_ms: number) => Cancel; } export interface ProcessingIndicatorOptions { /** Shorter than the platform keeps the indicator up after one request. */ refreshMs: number; /** Log prefix, e.g. the transport id. */ label: string; log: { warn: (message: string) => void; }; timers?: IndicatorTimers; stopWaitMs?: number; } export interface ProcessingIndicator { /** Resolves once no indicator request is in flight, or after the wait cap. */ stop: () => Promise; } export declare function startProcessingIndicator(sendIndicator: SendIndicator, options: ProcessingIndicatorOptions): ProcessingIndicator; /** Runs `work` with the indicator up; it is fully down by the time this resolves or rejects. */ export declare function runWithProcessingIndicator(sendIndicator: SendIndicator, work: () => Promise, options: ProcessingIndicatorOptions): Promise; /** Posts only once the indicator is fully down: a request that crosses the post lands after it and puts the indicator back on an answered message. */ export declare function replyAfterProcessingIndicator(sendIndicator: SendIndicator, steps: { produce: () => Promise; post: (reply: T) => Promise; }, options: ProcessingIndicatorOptions): Promise; export {};