@@ -14,19 +14,27 @@ export type ListPromise<T extends KubernetesObject> = () => Promise<{
1414} > ;
1515
1616// These are issued per object
17- export const ADD : string = 'add' ;
18- export const UPDATE : string = 'update' ;
19- export const CHANGE : string = 'change' ;
20- export const DELETE : string = 'delete' ;
17+ export const ADD = 'add' ;
18+ export type ADD = typeof ADD ;
19+ export const UPDATE = 'update' ;
20+ export type UPDATE = typeof UPDATE ;
21+ export const CHANGE = 'change' ;
22+ export type CHANGE = typeof CHANGE ;
23+ export const DELETE = 'delete' ;
24+ export type DELETE = typeof DELETE ;
2125
2226// This is issued when a watch connects or reconnects
23- export const CONNECT : string = 'connect' ;
27+ export const CONNECT = 'connect' ;
28+ export type CONNECT = typeof CONNECT ;
2429// This is issued when there is an error
25- export const ERROR : string = 'error' ;
30+ export const ERROR = 'error' ;
31+ export type ERROR = typeof ERROR ;
2632
2733export interface Informer < T > {
28- on ( verb : string , fn : ObjectCallback < T > ) : void ;
29- off ( verb : string , fn : ObjectCallback < T > ) : void ;
34+ on ( verb : ADD | UPDATE | DELETE | CHANGE , cb : ObjectCallback < T > ) : void ;
35+ on ( verb : ERROR | CONNECT , cb : ErrorCallback ) : void ;
36+ off ( verb : ADD | UPDATE | DELETE | CHANGE , cb : ObjectCallback < T > ) : void ;
37+ off ( verb : ERROR | CONNECT , cb : ErrorCallback ) : void ;
3038 start ( ) : Promise < void > ;
3139 stop ( ) : Promise < void > ;
3240}
0 commit comments