Skip to content

Commit 763decf

Browse files
committed
Add type restrictions.
1 parent 45b68c9 commit 763decf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/informer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export type CONNECT = typeof CONNECT;
3030
export const ERROR = 'error';
3131
export type ERROR = typeof ERROR;
3232

33-
export interface Informer<T> {
33+
export interface Informer<T extends KubernetesObject> {
3434
on(verb: ADD | UPDATE | DELETE | CHANGE, cb: ObjectCallback<T>): void;
3535
on(verb: ERROR | CONNECT, cb: ErrorCallback): void;
3636
off(verb: ADD | UPDATE | DELETE | CHANGE, cb: ObjectCallback<T>): void;
@@ -39,7 +39,7 @@ export interface Informer<T> {
3939
stop(): Promise<void>;
4040
}
4141

42-
export function makeInformer<T>(
42+
export function makeInformer<T extends KubernetesObject>(
4343
kubeconfig: KubeConfig,
4444
path: string,
4545
listPromiseFn: ListPromise<T>,

0 commit comments

Comments
 (0)