typeorm-revisions
Version:
Revisions History for [TypeORM](http://typeorm.io) Entities
10 lines (9 loc) • 577 B
TypeScript
import { EntitySubscriberInterface, EntityManager } from 'typeorm';
import { HistoryActionType } from './historyActionType';
export interface HistorySubscriberInterface<Entity, HistoryEntity> extends EntitySubscriberInterface<Entity> {
entity: Function;
historyEntity: Function;
createHistoryEntity(manager: EntityManager, entity: Entity): HistoryEntity | Promise<HistoryEntity>;
beforeHistory(action: HistoryActionType, history: HistoryEntity): void | Promise<void>;
afterHistory(action: HistoryActionType, history: HistoryEntity): void | Promise<void>;
}