import { TSingleResource } from '../../localTypes/k8s';
export type TConnStatus = 'connecting' | 'open' | 'closed';
/**
 * Parameters that define which resource collection we are listing/watching.
 * These map to common Kubernetes list params and discovery fields.
 */
export type TUseListWatchQuery = {
    namespace?: string;
    apiGroup?: string;
    apiVersion: string;
    plural: string;
    fieldSelector?: string;
    labelSelector?: string;
    initialLimit?: number;
    initialContinue?: string;
};
/**
 * Hook configuration flags and callbacks.
 */
export type TUseListWatchOptions = {
    /** Base WebSocket URL or path (http[s] will be auto-upgraded to ws[s]) */
    wsUrl: string;
    /** Page size for subsequent SCROLL requests */
    pageSize?: number;
    /** Temporarily pause applying ADDED/MODIFIED/DELETED updates */
    paused?: boolean;
    /** Skip applying DELETED events when true */
    ignoreRemove?: boolean;
    /** Optional connection status observer */
    onStatus?: (s: TConnStatus) => void;
    /** Optional error observer */
    onError?: (msg: string) => void;
    /** If true, auto-fetch all remaining pages after snapshot */
    autoDrain?: boolean;
    /** If false, reset state when URL or query changes */
    preserveStateOnUrlChange?: boolean;
    /** Gate the hook on/off. When false, no WebSocket is opened. */
    isEnabled?: boolean;
    /** What to list/watch */
    query: TUseListWatchQuery;
};
/**
 * Values returned from the hook for rendering and control.
 */
export type TUseListWatchReturn = {
    state: {
        order: string[];
        byKey: Record<string, TSingleResource>;
    };
    total: number;
    hasMore: boolean;
    continueToken?: string;
    status: TConnStatus;
    lastError?: string;
    hasInitial: boolean;
    setPaused: (v: boolean) => void;
    setIgnoreRemove: (v: boolean) => void;
    /** Ask the server for the next page (if any) */
    sendScroll: () => void;
    /** Drain multiple pages sequentially (client-side pagination helper) */
    drainAll: (opts?: {
        maxPages?: number;
        maxItems?: number;
    }) => Promise<number>;
    /** Manually reconnect the socket (cancels any pending auto-reconnect) */
    reconnect: () => void;
    /** Change the base WebSocket URL (will reconnect if enabled) */
    setUrl: (next: string) => void;
    /** Update the list/watch query (will reconnect if enabled) */
    setQuery: (q: TUseListWatchQuery) => void;
    debugTick?: number;
};
export declare const useListWatch: ({ wsUrl, pageSize, paused, ignoreRemove, onStatus, onError, autoDrain, preserveStateOnUrlChange, isEnabled, query, }: TUseListWatchOptions) => TUseListWatchReturn;
