Add default generic arg value to `Listener` type

The changes introduced by dcfda58 may break existing consumers
of our typings. This commit fixes this problem by adding a default
value to the recently introduced generic argument of `Listener` type.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
This commit is contained in:
Miroslav Bajtoš 2020-02-28 18:15:02 +01:00
parent dcfda58fda
commit 92654f646b
No known key found for this signature in database
GPG Key ID: 6F2304BA9361C7E3
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ export interface OperationHookContext<T extends typeof PersistedModel> {
[property: string]: any;
}
export type Listener<Ctx> = (ctx: Ctx, next: (err?: any) => void) => void;
export type Listener<Ctx = OperationHookContext<PersistedModelClass>> = (
ctx: Ctx, next: (err?: any) => void
) => void;
export interface ObserverMixin {
/**