Permalink
Switch branches/tags
v1.2.1 v1.2.0 v1.1.0 v1.0.0 v0.10.5 v0.10.4 v0.10.3 v0.10.2 v0.10.1 v0.8.1 v0.8.0 v0.7.1 v0.7.0 v0.6.4 v0.6.3 v0.6.2 v0.6.1 v0.6.0 v0.5.0 v0.4.1 v0.4.0 v0.3.0 v0.2.0 v0.1.0 serenity-js@1.10.13 serenity-js@1.10.7 serenity-js@1.10.3 serenity-js@1.10.2 serenity-js@1.10.1 serenity-js@1.10.0 serenity-js@1.9.4 serenity-js@1.9.3 serenity-js@1.9.2 serenity-js@1.9.1 serenity-js@1.9.0 serenity-js@1.8.1 serenity-js@1.8.0 serenity-js@1.7.0 serenity-js@1.6.2 serenity-js@1.6.1 serenity-js@1.6.0 serenity-js@1.5.0 serenity-js@1.4.2 serenity-js@1.4.1 serenity-js@1.4.0 serenity-js@1.3.0 serenity-js@1.2.4 serenity-js@1.2.3 serenity-js@1.2.2 @serenity-js/rest@1.1.1 @serenity-js/rest@1.1.0 @serenity-js/rest@1.0.0 @serenity-js/mocha@1.0.0 @serenity-js/integration-testing@1.0.0 @serenity-js/cucumber@1.0.0 @serenity-js/cucumber-2@1.4.0 @serenity-js/cucumber-2@1.2.2 @serenity-js/cucumber-2@1.2.1 @serenity-js/cucumber-2@1.2.0 @serenity-js/cucumber-2@1.1.0 @serenity-js/cucumber-2@1.0.1 @serenity-js/cucumber-2@1.0.0 serenity-js.cucumber-2@0.2.0 serenity-js.cucumber-2@0.1.1 serenity-js.cucumber-2@0.1.0 @serenity-js/core@1.6.0 @serenity-js/core@1.5.6 @serenity-js/core@1.5.5 @serenity-js/core@1.5.4 @serenity-js/core@1.5.3 @serenity-js/core@1.5.2 @serenity-js/core@1.5.1 @serenity-js/core@1.5.0 @serenity-js/core@1.4.1 @serenity-js/core@1.4.0 @serenity-js/core@1.3.0 @serenity-js/core@1.2.2 @serenity-js/core@1.2.1 @serenity-js/core@1.2.0 @serenity-js/core@1.1.1 @serenity-js/core@1.1.0 @serenity-js/core@1.0.0
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 910 Bytes
import * as moment from 'moment';
import { Outcome, PhotoReceipt, RecordedActivity, RecordedScene, Tag } from './model';
export class DomainEvent<T> {
private type: string;
constructor(public value: T, public timestamp?: number) {
this.timestamp = timestamp || moment().valueOf();
this.type = this.constructor.name;
}
toString() {
return `${this.timestamp} | ${this.constructor.name}: ${this.value.toString()}`;
}
}
export class SceneStarts extends DomainEvent<RecordedScene> {}
export class ActivityStarts extends DomainEvent<RecordedActivity> {}
export class ActivityFinished extends DomainEvent<Outcome<RecordedActivity>> {}
export class SceneTagged extends DomainEvent<PromiseLike<Tag>> {}
export class SceneFinished extends DomainEvent<Outcome<RecordedScene>> {}
export class PhotoAttempted extends DomainEvent<PhotoReceipt> {}