import { IKubernetesRESTClient, ListOptions, MandatorySelectorOptions, WatchOptions, WatchResult } from "./client";
import { APIObject, MetadataObject } from "./types/meta";
import { DeleteOptions, WatchEvent } from "./types/meta/v1";
import { WatchHandle } from "./watch";
import { Registry } from "prom-client";
import { JSONPatch, JSONPatchElement, RecursivePartial } from "./api_patch";
import { ListWatchOptions } from "./resource_listwatch";
export interface IResourceClient<R extends MetadataObject, K, V, O extends R = R> {
    list(listOptions?: ListOptions): Promise<Array<APIObject<K, V> & O>>;
    get(name: string): Promise<(APIObject<K, V> & O) | undefined>;
    apply(resource: R): Promise<APIObject<K, V> & O>;
    put(resource: R): Promise<APIObject<K, V> & O>;
    post(resource: R): Promise<APIObject<K, V> & O>;
    patchStrategic(resourceOrName: R | string, patch: RecursivePartial<R>): Promise<APIObject<K, V> & O>;
    patchMerge(resourceOrName: R | string, patch: RecursivePartial<R>): Promise<APIObject<K, V> & O>;
    patchJSON(resourceOrName: R | string, patch: JSONPatch): Promise<R>;
    delete(resourceOrName: R | string, deleteOptions?: DeleteOptions): Promise<void>;
    deleteMany(opts: MandatorySelectorOptions & DeleteOptions): Promise<void>;
    watch(handler: (event: WatchEvent<O>) => any, errorHandler?: (error: any) => any, opts?: WatchOptions): Promise<WatchResult>;
    listWatch(handler: (event: WatchEvent<O>) => any, errorHandler?: (error: any) => any, opts?: ListWatchOptions<O>): WatchHandle;
}
export interface INamespacedResourceClient<R extends MetadataObject, K, V, O extends R = R> extends IResourceClient<R, K, V, O> {
    namespace(ns: string): INamespacedResourceClient<R, K, V, O>;
    allNamespaces(): INamespacedResourceClient<R, K, V, O>;
}
export declare class CustomResourceClient<R extends MetadataObject, K, V, O extends R = R> implements INamespacedResourceClient<R, K, V, O> {
    private readonly inner;
    private readonly kind;
    private readonly apiVersion;
    constructor(inner: INamespacedResourceClient<R, K, V, O>, kind: K, apiVersion: V);
    list(listOptions?: ListOptions): Promise<Array<APIObject<K, V> & O>>;
    get(name: string): Promise<(APIObject<K, V> & O) | undefined>;
    apply(resource: R): Promise<APIObject<K, V> & O>;
    put(resource: R): Promise<APIObject<K, V> & O>;
    post(resource: R): Promise<APIObject<K, V> & O>;
    delete(resourceOrName: string | R, deleteOptions?: DeleteOptions): Promise<void>;
    deleteMany(opts: MandatorySelectorOptions & DeleteOptions): Promise<void>;
    watch(handler: (event: WatchEvent<O>) => any, errorHandler?: (error: any) => any, opts?: WatchOptions): Promise<WatchResult>;
    listWatch(handler: (event: WatchEvent<O>) => any, errorHandler?: (error: any) => any, opts?: ListWatchOptions<O>): WatchHandle;
    patchJSON(resourceOrName: string | R, patch: JSONPatchElement[]): Promise<R>;
    patchStrategic(resourceOrName: string | R, patch: RecursivePartial<R>): Promise<APIObject<K, V> & O>;
    patchMerge(resourceOrName: string | R, patch: RecursivePartial<R>): Promise<APIObject<K, V> & O>;
    namespace(ns: string): INamespacedResourceClient<R, K, V, O>;
    allNamespaces(): INamespacedResourceClient<R, K, V, O>;
}
export declare class ResourceClient<R extends MetadataObject, K, V, O extends R = R> implements IResourceClient<R, K, V, O> {
    protected client: IKubernetesRESTClient;
    protected apiBaseURL: string;
    protected resourceBaseURL: string;
    private static watchResyncErrorCount?;
    private static watchOpenCount?;
    protected baseURL: string;
    supportsCollectionDeletion: boolean;
    constructor(client: IKubernetesRESTClient, apiBaseURL: string, resourceBaseURL: string, registry: Registry);
    protected urlForResource(r: R): string;
    protected urlForResourceOrName(r: R | string): string;
    list(opts?: ListOptions): Promise<Array<APIObject<K, V> & O>>;
    get(name: string): Promise<(APIObject<K, V> & O) | undefined>;
    watch(handler: (event: WatchEvent<O>) => any, errorHandler?: (error: any) => any, opts?: WatchOptions): Promise<WatchResult>;
    listWatch(handler: (event: WatchEvent<O>) => any, errorHandler?: (error: any) => any, opts?: ListWatchOptions<O>): WatchHandle;
    apply(resource: R): Promise<APIObject<K, V> & O>;
    put(resource: R): Promise<APIObject<K, V> & O>;
    post(resource: R): Promise<APIObject<K, V> & O>;
    patchStrategic(resourceOrName: R | string, patch: RecursivePartial<R>): Promise<APIObject<K, V> & O>;
    patchMerge(resourceOrName: R | string, patch: RecursivePartial<R>): Promise<APIObject<K, V> & O>;
    patchJSON(resourceOrName: R | string, patch: JSONPatch): Promise<APIObject<K, V> & O>;
    delete(resourceOrName: R | string, deleteOptions?: DeleteOptions): Promise<void>;
    deleteMany(opts: MandatorySelectorOptions & DeleteOptions): Promise<any>;
}
export declare class NamespacedResourceClient<R extends MetadataObject, K, V, O extends R = R> extends ResourceClient<R, K, V, O> implements INamespacedResourceClient<R, K, V, O> {
    private readonly registry;
    private readonly ns?;
    constructor(client: IKubernetesRESTClient, apiBaseURL: string, resourceBaseURL: string, registry: Registry, ns?: string);
    protected urlForResource(r: R): string;
    namespace(ns: string): INamespacedResourceClient<R, K, V, O>;
    allNamespaces(): INamespacedResourceClient<R, K, V, O>;
    post(resource: R): Promise<any>;
}
