import { MetaQuery, DataProvider, LiveProvider, CrudOperators, Pagination, CrudSorting, CrudFilters } from '@refinedev/core'; import { Options } from 'ky'; import { ListMeta, ObjectMeta, Status } from 'kubernetes-types/meta/v1'; type DataList = { apiVersion: string; kind: string; metadata: ListMeta; items: Array; }; interface IProviderPlugin { _globalStore?: GlobalStore; init: (globalStore: GlobalStore) => void; processData(res: UnstructuredList): Promise>; processItem: (item: Unstructured) => Promise; restoreData: (item: DataList) => UnstructuredList; restoreItem: (item: Unstructured & Output) => Unstructured; } declare function informerLog(name: string, ...args: Parameters): void; type UnstructuredList = { apiVersion: string; kind: string; metadata: ListMeta; items: Unstructured[]; }; type Unstructured = { id: string; apiVersion?: string; kind?: string; metadata?: ObjectMeta; }; type KubeApiQueryParams = { watch?: boolean | number; resourceVersion?: string; timeoutSeconds?: number; limit?: number; continue?: string; labelSelector?: string | string[]; fieldSelector?: string | string[]; namespace?: string; }; type ResourceDescriptor = { name: string; namespace?: string; }; type KubeApiListOptions = { namespace?: string; query?: KubeApiQueryParams; fetchOptions?: Options; }; type KubeApiListWatchOptions = KubeApiListOptions & { onResponse?: (response: T, event?: WatchEvent) => void; onEvent?: (event: WatchEvent) => void; signal?: AbortSignal; retryFlag?: boolean; }; type KubeObjectConstructor = { resourceBasePath: string; namespace?: string; resource: string; }; type KubeApiOptions = { basePath: string; watchWsBasePath?: string; kubeApiTimeout?: number | false; objectConstructor: KubeObjectConstructor; }; type StopWatchHandler = () => void; type K8sObject = { apiVersion?: string; kind?: string; metadata?: ObjectMeta; }; type WatchEvent = { type: 'ADDED' | 'MODIFIED' | 'DELETED' | 'PING'; object: Unstructured; }; declare class KubeApi { protected options: KubeApiOptions; private watchWsBasePath?; private basePath; private resourceBasePath; private namespace?; resource: string; private maxTimeout; private retryTimes; private retryTimer; private apiVersionResourceCache; private kubeApiTimeout?; constructor(options: KubeApiOptions); resetRetryState(): void; list({ namespace, query, fetchOptions, }?: KubeApiListOptions): Promise; listWatch({ namespace, query, onResponse, onEvent, signal, retryFlag, }?: KubeApiListWatchOptions): Promise; private watch; private watchBySdk; private watchByWebsocket; private watchByHttp; getUrl({ name, namespace }?: Partial, query?: Partial, watch?: boolean): string; private normalizeQuery; private retryFunc; } type KubeSdkOptions = { basePath: string; fieldManager?: string; kubeApiTimeout?: false | number; }; type OperationOptions = { sync?: boolean; }; declare class KubeSdk { protected options: KubeSdkOptions; private plugins; private basePath; private defaultNamespace; private fieldManager?; private apiVersionResourceCache; private kubeApiTimeout?; constructor(options: KubeSdkOptions, plugins: IProviderPlugin[]); createyYaml(specs: Unstructured[]): Promise; applyYaml(specs: Unstructured[], strategy?: string, replacePaths?: string[][], updateType?: 'patch' | 'put'): Promise; deleteYaml(specs: Unstructured[], options?: OperationOptions): Promise; getOne(spec: Unstructured): Promise; private read; private create; private patch; private put; private delete; private specUriPath; private restoreItemsFromPlugins; } declare enum RequestMode { NetworkOnly = "network-only" } declare function getObjectConstructor(resource: string, meta?: MetaQuery): { resourceBasePath: any; resource: any; }; type KubeApiFactory = (params: { basePath: string; watchWsBasePath?: string; objectConstructor: ReturnType; kubeApiTimeout?: false | number; }) => KubeApi; interface GlobalStoreInitParams { apiUrl: string; watchWsApiUrl?: string; prefix?: string; fieldManager?: string; kubeApiTimeout?: false | number; plugins?: IProviderPlugin[]; kubeApiFactory?: KubeApiFactory; } interface CancelQueriesParams { queryKeys?: string[]; } declare class GlobalStore { plugins: IProviderPlugin[]; private _apiUrl; private watchWsApiUrl?; prefix?: string; fieldManager?: string; private _isDestroyed; private store; private requestsCache; private subscribers; private stopWatchHandlers; private cancelControllers; private _kubeApiTimeout?; private kubeApiFactory; constructor(params: GlobalStoreInitParams, plugins: IProviderPlugin[]); get apiUrl(): string; get kubeApiTimeout(): number | false | undefined; get isDestroyed(): boolean; removeCacheRequest(targetPromise: Promise): void; get(resource: string, meta?: MetaQuery): Promise; subscribe(resource: string, onEvent: (data: WatchEvent) => void): () => void; private notify; publish(resource: string, data: WatchEvent): void; init(params: GlobalStoreInitParams): void; loadPlugins(plugins?: IProviderPlugin[]): void; private processList; private processItem; restoreItem(item: Unstructured): Unstructured; restoreData(list: UnstructuredList): UnstructuredList; destroy(): void; cancelQueries(params?: CancelQueriesParams): void; } declare const dataProvider: (globalStore: GlobalStore) => Omit, 'createMany' | 'updateMany' | 'deleteMany' | 'custom'>; declare const liveProvider: (globalStore: GlobalStore | GlobalStore[]) => LiveProvider; declare const mapOperator: (operator: CrudOperators) => string; declare const paginateData: (pagination: Pagination, data: Unstructured[]) => Unstructured[]; declare function sortData(sorting: CrudSorting, data: Unstructured[]): Unstructured[]; declare const filterData: (filters: CrudFilters, data: Unstructured[]) => Unstructured[]; export { type CancelQueriesParams, type DataList, GlobalStore, type GlobalStoreInitParams, type IProviderPlugin, type K8sObject, KubeApi, type KubeApiFactory, type KubeApiListOptions, type KubeApiOptions, type KubeApiQueryParams, KubeSdk, RequestMode, type StopWatchHandler, type Unstructured, type UnstructuredList, type WatchEvent, dataProvider, dataProvider as default, filterData, getObjectConstructor, informerLog, liveProvider, mapOperator, paginateData, sortData };