Files
k8s-set-context/node_modules/@kubernetes/client-node/dist/informer.d.ts
github-actions[bot] 52d71d28bd Add node modules and compiled JavaScript from main (#54)
Co-authored-by: Oliver King <oking3@uncc.edu>
2022-06-29 15:41:55 -04:00

25 lines
1.1 KiB
TypeScript

/// <reference types="node" />
import { KubeConfig } from './config';
import { KubernetesListObject, KubernetesObject } from './types';
import http = require('http');
export declare type ObjectCallback<T extends KubernetesObject> = (obj: T) => void;
export declare type ErrorCallback = (err?: any) => void;
export declare type ListCallback<T extends KubernetesObject> = (list: T[], ResourceVersion: string) => void;
export declare type ListPromise<T extends KubernetesObject> = () => Promise<{
response: http.IncomingMessage;
body: KubernetesListObject<T>;
}>;
export declare const ADD: string;
export declare const UPDATE: string;
export declare const CHANGE: string;
export declare const DELETE: string;
export declare const CONNECT: string;
export declare const ERROR: string;
export interface Informer<T> {
on(verb: string, fn: ObjectCallback<T>): void;
off(verb: string, fn: ObjectCallback<T>): void;
start(): Promise<void>;
stop(): Promise<void>;
}
export declare function makeInformer<T>(kubeconfig: KubeConfig, path: string, listPromiseFn: ListPromise<T>, labelSelector?: string): Informer<T>;