/**
 * Auto-refresh composable: drives a countdown that fires a `reload()` at a configurable
 * interval (in seconds), with four pause sources — document visibility, external paused
 * ref, in-flight loading, and user toggle. Designed for `<ModelTable>` and
 * `<ModelIterator>` but composable-shaped so any consumer can use it.
 */
import { type ComputedRef, type MaybeRefOrGetter, type Ref } from 'vue';
export interface UseAutoRefreshOptions {
    /** Polling interval. Number ⇒ seconds. `true` ⇒ `defaultSeconds`. Falsy ⇒ disabled. */
    interval: MaybeRefOrGetter<number | boolean | undefined>;
    /**
     * Function called when a tick fires. If it returns a Promise it is awaited before the
     * countdown resets, so the next cycle starts only after the reload has settled (rather
     * than restarting while data is still in flight). Overlapping reloads are prevented by the
     * `isLoading` gate below, which freezes ticks for as long as a request is in flight — wire
     * it for that guarantee, since the per-second timer itself keeps ticking during a slow reload.
     */
    reload: () => void | Promise<void>;
    /**
     * Optional. While true the countdown freezes and ticks are suppressed. Wire this to the
     * model's loading flag. Note: a model that never clears `isLoading` (e.g. an error path
     * that leaves it set) will halt polling — by design, since polling-while-loading is the
     * thing this gate prevents.
     */
    isLoading?: Ref<boolean>;
    /** Optional external pause signal (e.g. dialog open). */
    paused?: Ref<boolean>;
    /** Seconds used when `interval === true`. Defaults to 60. */
    defaultSeconds?: number;
}
export interface UseAutoRefreshHandle {
    enabled: ComputedRef<boolean>;
    isActive: ComputedRef<boolean>;
    isLoading: ComputedRef<boolean>;
    intervalSeconds: ComputedRef<number>;
    remainingSeconds: Ref<number>;
    isUserPaused: Ref<boolean>;
    togglePause: () => void;
    reset: () => void;
    reload: () => void | Promise<void>;
}
export declare function useAutoRefresh(opts: UseAutoRefreshOptions): UseAutoRefreshHandle;
