@@ -9,19 +9,27 @@ export type ListCallback<T extends KubernetesObject> = (list: T[], ResourceVersi
99export type ListPromise < T extends KubernetesObject > = ( ) => Promise < KubernetesListObject < T > > ;
1010
1111// These are issued per object
12- export const ADD : string = 'add' ;
13- export const UPDATE : string = 'update' ;
14- export const CHANGE : string = 'change' ;
15- export const DELETE : string = 'delete' ;
12+ export const ADD = 'add' ;
13+ export type ADD = typeof ADD ;
14+ export const UPDATE = 'update' ;
15+ export type UPDATE = typeof UPDATE ;
16+ export const CHANGE = 'change' ;
17+ export type CHANGE = typeof CHANGE ;
18+ export const DELETE = 'delete' ;
19+ export type DELETE = typeof DELETE ;
1620
1721// This is issued when a watch connects or reconnects
18- export const CONNECT : string = 'connect' ;
22+ export const CONNECT = 'connect' ;
23+ export type CONNECT = typeof CONNECT ;
1924// This is issued when there is an error
20- export const ERROR : string = 'error' ;
25+ export const ERROR = 'error' ;
26+ export type ERROR = typeof ERROR ;
2127
2228export interface Informer < T extends KubernetesObject > {
23- on ( verb : string , fn : ObjectCallback < T > ) : void ;
24- off ( verb : string , fn : ObjectCallback < T > ) : void ;
29+ on ( verb : ADD | UPDATE | DELETE | CHANGE , cb : ObjectCallback < T > ) : void ;
30+ on ( verb : ERROR | CONNECT , cb : ErrorCallback ) : void ;
31+ off ( verb : ADD | UPDATE | DELETE | CHANGE , cb : ObjectCallback < T > ) : void ;
32+ off ( verb : ERROR | CONNECT , cb : ErrorCallback ) : void ;
2533 start ( ) : Promise < void > ;
2634 stop ( ) : Promise < void > ;
2735}
0 commit comments