umzug being EventEmitter, added appropriate events

This commit is contained in:
Margus Lamp
2017-12-05 10:42:50 +02:00
committed by Margus Lamp
parent b4855506d3
commit 5539fb2bee
+9 -3
View File
@@ -1,9 +1,11 @@
// Type definitions for Umzug v2.0.1
// Type definitions for Umzug v2.1.0
// Project: https://github.com/sequelize/umzug
// Definitions by: Ivan Drinchev <https://github.com/drinchev>
// Margus Lamp <https://github.com/mlamp>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { EventEmitter } from 'events';
import Sequelize = require("sequelize");
declare namespace umzug {
@@ -169,7 +171,7 @@ declare namespace umzug {
file: string;
}
interface Umzug {
interface Umzug extends EventEmitter {
/**
* The execute method is a general purpose function that runs for
* every specified migrations the respective function.
@@ -200,6 +202,10 @@ declare namespace umzug {
down(migrations?: string[]): Promise<Migration[]>;
down(options?: DownToOptions | UpDownMigrationsOptions): Promise<Migration[]>;
on(eventName: 'migrating' | 'reverting' | 'migrated' | 'reverted', cb?: (name: string, migration: string) => void): this;
addListener(eventName: 'migrating' | 'reverting' | 'migrated' | 'reverted', cb?: (name: string, migration: string) => void): this;
removeListener(eventName: 'migrating' | 'reverting' | 'migrated' | 'reverted', cb?: (name: string, migration: string) => void): this;
}
interface UmzugStatic {
@@ -207,5 +213,5 @@ declare namespace umzug {
}
}
declare var umzug: umzug.UmzugStatic;
declare const umzug: umzug.UmzugStatic;
export = umzug;