33
44import { Guid } from '@dolittle/rudiments' ;
55import { Constructor } from '@dolittle/types' ;
6- import { EventType } from './EventType' ;
6+ import { EventType } from './EventType' ;
77import { EventTypeId } from './EventTypeId' ;
88
99/**
1010 * Defines the system for working with {@link EventType}
1111 */
12- export interface IEventTypes {
12+ export abstract class IEventTypes {
1313
1414 /**
1515 * Check if there is a type associated with an artifact.
1616 * @param {EventType } input Artifact.
1717 * @returns {boolean } true if there is, false if not.
1818 */
19- hasTypeFor ( input : EventType ) : boolean ;
19+ abstract hasTypeFor ( input : EventType ) : boolean ;
2020
2121 /**
2222 * Get type for a given artifact.
2323 * @param {EventType } input Artifact.
2424 * @returns type for artifact.
2525 */
26- getTypeFor ( input : EventType ) : Constructor < any > ;
26+ abstract getTypeFor ( input : EventType ) : Constructor < any > ;
2727
2828 /**
2929 * Check if there is an {Artifact} definition for a given type.
3030 * @param {Function } type Type to check for.
3131 * @returns true if there is, false if not.
3232 */
33- hasFor ( type : Constructor < any > ) : boolean ;
33+ abstract hasFor ( type : Constructor < any > ) : boolean ;
3434
3535 /**
3636 * Get {Artifact} definition for a given type.
3737 * @param {Function } type Type to get for.
3838 * @returns {EventType } The artifact associated.
3939 */
40- getFor ( type : Constructor < any > ) : EventType ;
40+ abstract getFor ( type : Constructor < any > ) : EventType ;
4141
4242 /**
4343 * Resolves an artifact from optional input or the given object.
@@ -46,12 +46,12 @@ export interface IEventTypes {
4646 * @returns {EventType } Resolved event type.
4747 * @throws {UnableToResolveArtifact } If not able to resolve artifact.
4848 */
49- resolveFrom ( object : any , input ?: EventType | EventTypeId | Guid | string ) : EventType ;
49+ abstract resolveFrom ( object : any , input ?: EventType | EventTypeId | Guid | string ) : EventType ;
5050
5151 /**
5252 * Associate a type with a unique artifact identifier and optional generation.
5353 * @param {Constructor<any> } type Type to associate.
5454 * @param {EventType } eventType Artifact to associate with.
5555 */
56- associate ( type : Constructor < any > , eventType : EventType ) : void ;
56+ abstract associate ( type : Constructor < any > , eventType : EventType ) : void ;
5757}
0 commit comments