/**
 * @packageDocumentation
 * @module api
 */
import { Observable } from 'rxjs';
import { DeepPartial, KubernetesResource, ResourceListParams } from '../types/public-api';
export declare type K8sResourceDefinition = Readonly<{
    type: string;
    apiGroup?: string;
    apiVersion?: string;
}>;
export declare type K8sResourceDefinitions = Readonly<Record<string, K8sResourceDefinition>>;
export interface ApiDefinitionBaseParams {
    definition: K8sResourceDefinition;
}
export interface ApiTypeBaseParams<T extends string> {
    type: T;
}
export declare type ApiBaseParams<T extends string> = {
    notifyOnError?: boolean;
    onlyMetadata?: boolean;
} & (ApiDefinitionBaseParams | ApiTypeBaseParams<T>);
export declare type ResourceBaseParams<T extends string> = ApiBaseParams<T> & {
    name: string;
};
export declare type ResourceListBaseParams<T extends string> = ApiBaseParams<T> & {
    queryParams?: ResourceListParams;
};
export interface WatchApiParams {
    active$?: Observable<boolean>;
    keepalive?: boolean;
    downgradePolling?: number;
}
export interface GlobalResourceBaseParams {
    namespaced?: boolean;
    namespace?: string;
}
export declare type GlobalResourceParams<T extends string> = ResourceBaseParams<T> & GlobalResourceBaseParams;
export declare type WatchGlobalResourceParams<T extends string> = GlobalResourceParams<T> & WatchApiParams;
export declare type GlobalResourceListParams<T extends string> = ResourceListBaseParams<T> & GlobalResourceBaseParams;
export declare type WatchGlobalResourceListParams<T extends string> = GlobalResourceListParams<T> & WatchApiParams;
export interface ErebusResourceBaseParams {
    cluster: string;
    namespace?: string;
}
export declare type ErebusResourceParams<T extends string> = ResourceBaseParams<T> & ErebusResourceBaseParams;
export declare type WatchErebusResourceParams<T extends string> = ErebusResourceParams<T> & WatchApiParams;
export declare type ErebusResourceListParams<T extends string> = ResourceListBaseParams<T> & ErebusResourceBaseParams;
export declare type WatchErebusResourceListParams<T extends string> = ErebusResourceListParams<T> & WatchApiParams;
export declare type ResourceReadParams<T extends string> = GlobalResourceParams<T> | ErebusResourceParams<T>;
export declare type WatchResourceReadParams<T extends string> = WatchGlobalResourceParams<T> | WatchErebusResourceParams<T>;
export declare type ResourceListReadParams<T extends string> = GlobalResourceListParams<T> | ErebusResourceListParams<T>;
export declare type WatchResourceListReadParams<T extends string> = WatchGlobalResourceListParams<T> | WatchErebusResourceListParams<T>;
export declare type ResourceBaseWriteParams<T extends KubernetesResource, R extends string> = ApiBaseParams<R> & {
    resource: T;
};
/**
 * patch 资源时需要传递完整的原始资源 (resource) 和更新的部分 (part)
 */
export declare type ResourceBasePatchParams<T extends KubernetesResource, R extends string> = (ResourceBaseWriteParams<T, R> | ResourceBaseParams<R>) & {
    operation?: PatchOperation;
    part: DeepPartial<T> | JSONPatch[];
};
export interface ResourceDeleteAdditionalParams {
    body?: unknown;
}
export declare type GlobalResourceWriteParams<T extends KubernetesResource, R extends string> = ResourceBaseWriteParams<T, R> & GlobalResourceBaseParams;
export declare type GlobalResourcePatchParams<T extends KubernetesResource, R extends string> = ResourceBasePatchParams<T, R> & GlobalResourceBaseParams;
export declare type GlobalResourceDeleteParams<T extends KubernetesResource, R extends string> = (GlobalResourceWriteParams<T, R> | GlobalResourceParams<R>) & ResourceDeleteAdditionalParams;
export declare type ErebusResourceWriteParams<T extends KubernetesResource, R extends string> = ResourceBaseWriteParams<T, R> & ErebusResourceBaseParams;
export declare type ErebusResourcePatchParams<T extends KubernetesResource, R extends string> = ResourceBasePatchParams<T, R> & ErebusResourceBaseParams;
export declare type ErebusResourceDeleteParams<T extends KubernetesResource, R extends string> = (ErebusResourceWriteParams<T, R> | ErebusResourceParams<R>) & ResourceDeleteAdditionalParams;
export declare type ResourceWriteParams<R extends string, T extends KubernetesResource = KubernetesResource> = GlobalResourceWriteParams<T, R> | ErebusResourceWriteParams<T, R>;
export declare type ResourcePatchParams<R extends string, T extends KubernetesResource = KubernetesResource> = GlobalResourcePatchParams<T, R> | ErebusResourcePatchParams<T, R>;
export declare type ResourceDeleteParams<R extends string, T extends KubernetesResource = KubernetesResource> = GlobalResourceDeleteParams<T, R> | ErebusResourceDeleteParams<T, R>;
export declare type ResourceApiParams<T extends string> = GlobalResourceListParams<T> | ErebusResourceListParams<T> | ResourceReadParams<T> | ResourceWriteParams<T> | ResourcePatchParams<T> | ResourceDeleteParams<T>;
export declare enum PatchOperation {
    JSON = "application/json-patch+json",
    Merge = "application/merge-patch+json",
    StrategicMerge = "application/strategic-merge-patch+json"
}
export declare enum JSONPatchOp {
    Test = "test",
    Remove = "remove",
    Add = "add",
    Replace = "replace",
    Move = "move",
    Copy = "copy"
}
export declare type JSONPatch = {
    op: JSONPatchOp.Test | JSONPatchOp.Add | JSONPatchOp.Replace;
    path: string;
    value: unknown;
} | {
    op: JSONPatchOp.Remove;
    path: string;
} | {
    op: JSONPatchOp.Move | JSONPatchOp.Copy;
    from: string;
    path: string;
};
export interface WatchAPIResponse<T extends KubernetesResource> {
    type: WatchEvent;
    object: T;
}
export declare enum WatchEvent {
    Added = "ADDED",
    Modified = "MODIFIED",
    Deleted = "DELETED",
    Error = "ERROR",
    Bookmark = "BOOKMARK"
}
