import { InternalReporterInterface } from '../abstract-reporter'; import { LoggerInterface } from '../../utils/logger'; export interface FallbackCoordinatorCallbacks { onUpstreamFailure?: () => void; onFallbackFailure?: () => void; onFallbackActivated?: () => void; onDisabled?: () => void; } /** * Encapsulates the upstream → fallback → disabled cascade used across all * `QaseReporter` lifecycle methods. Keeps both reporters' state (useFallback * / disabled) in one place instead of spreading try/catch blocks everywhere. */ export declare class FallbackCoordinator { private readonly logger; private readonly upstream; private readonly fallback; private readonly callbacks; private useFallback; private disabled; private onDisabledFired; constructor(logger: LoggerInterface, upstream: InternalReporterInterface | undefined, fallback: InternalReporterInterface | undefined, callbacks?: FallbackCoordinatorCallbacks); isDisabled(): boolean; isUsingFallback(): boolean; setDisabled(value: boolean): void; setUseFallback(value: boolean): void; getUpstream(): InternalReporterInterface | undefined; getFallback(): InternalReporterInterface | undefined; /** * Clear the disabled / useFallback flags so the coordinator can be reused * for a fresh test run. Does not re-arm the `onDisabled` callback — it * only fires once per coordinator lifetime regardless of resets. */ reset(): void; /** * Run `op` on the currently active reporter. On upstream failure, switch to * the fallback (copying accumulated results over once) and retry. On * fallback failure, disable the coordinator. * * Returns the operation's result, or `undefined` if the coordinator is * disabled or the operation produced no value. */ run(op: (reporter: InternalReporterInterface) => Promise, opName: string): Promise; private disable; private activateFallback; private runOnFallback; }