Skip to content

Commit f215e3d

Browse files
authored
Merge pull request #897 from brendandburns/types
Add type restriction.
2 parents 9adcd1d + 763decf commit f215e3d

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)