/**
 * @packageDocumentation
 * @module k8s-resource-list
 */
import { HttpErrorResponse } from '@angular/common/http';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs';
import { WatchAPIResponse } from '../api/types';
import { StringMap } from '../types/commons';
import { KubernetesResource, KubernetesResourceList, Status } from '../types/k8s';
import { K8SResourceList } from './k8s-resource-list';
export declare type Watcher<R extends KubernetesResource, Q> = (seedVersion: string, params?: Q) => Observable<WatchAPIResponse<R>>;
export declare type InsertFn<R> = (items: R[], res: R, hasMore: boolean) => R[];
export interface WatcherParams<R extends KubernetesResource, Q> {
    list: K8SResourceList<R>;
    watcher: Watcher<R, Q>;
    insertFn?: InsertFn<R>;
}
interface BaseConfig<R extends KubernetesResource, Q> {
    watcher?: Watcher<R, Q>;
    insertFn?: InsertFn<R>;
    limit?: number;
    polling?: number;
}
export declare type ItemsScanner<R> = (items: R[]) => R[];
export interface ConfigWithRoute<R, Q, P> extends BaseConfig<R, Q> {
    fetcher: (params: P) => Observable<KubernetesResourceList<R>>;
    activatedRoute?: ActivatedRoute;
}
export interface ConfigWithParams<R, Q, P> extends BaseConfig<R, Q> {
    fetcher: (params: P) => Observable<KubernetesResourceList<R>>;
    fetchParams$?: Observable<Q>;
}
export declare enum LoadAction {
    Reload = "Reload",
    SilentReload = "SilentReload",
    LoadMore = "LoadMore"
}
export interface LoadState<R> {
    action?: LoadAction;
    rawResponse?: KubernetesResourceList<R>;
    loading?: boolean;
    loadingError?: HttpErrorResponse | Status;
}
export interface LoadSnapshot<R, Q> {
    queryParams?: Q;
    rawResponse?: KubernetesResourceList<R>;
    loading?: boolean;
    loadingError?: HttpErrorResponse | Status;
    hasMore?: boolean;
    continueToken?: string;
    items?: R[];
}
export interface ListParams extends StringMap {
    limit: string;
    continue: string;
}
export {};
