I'm working with the Umzug library for database migration in a TypeScript project and encountering an issue when trying to use the on method with an Umzug instance. Here's the relevant part of my code:
export async function connectUmzug(dbConfig) {
return new Umzug({...});
}
Usage:
const umzug = await connectUmzug(config);
umzug.on('migrating', logUmzugEvent('migrating'));
I get the following error:
Property 'on' does not exist on type 'Umzug<any>'
In the type definition, it states:
class Umzug<Ctx extends object = object> extends emittery<UmzugEvents<Ctx>>
Why is the on
method not recognized in this context?