@@ -21,21 +21,36 @@ export class EventTypesBuilder {
2121 /**
2222 * Associate a type with an unique event type identifier and optional generation.
2323 * @param {Constructor } type Type to associate.
24- * @param {ArtifactId } identifier Identifier to associate with.
25- * @param {number } generation Optional generation - defaults to 1.
24+ * @param {EventType } eventType EventType to associate with.
2625 */
2726 associate < T = any > ( type : Constructor < T > , eventType : EventType ) : EventTypesBuilder ;
28- associate < T = any > ( type : Constructor < T > , identifier : EventTypeId | Guid | string , generation ?: Generation | number ) : EventTypesBuilder ;
27+ /**
28+ * Associate a type with an unique event type identifier and optional generation.
29+ * @param {Constructor } type Type to associate.
30+ * @param {EventTypeId | Guid | string } identifier Identifier to associate with.
31+ */
32+ associate < T = any > ( type : Constructor < T > , identifier : EventTypeId | Guid | string ) : EventTypesBuilder ;
33+ /**
34+ * Associate a type with an unique event type identifier and optional generation.
35+ * @param {Constructor } type Type to associate.
36+ * @param {EventTypeId | Guid | string } identifier Identifier to associate with.
37+ * @param {Generation | number } generation The generation to associate with.
38+ */
39+ associate < T = any > ( type : Constructor < T > , identifier : EventTypeId | Guid | string , generation : Generation | number ) : EventTypesBuilder ;
2940 associate < T = any > ( type : Constructor < T > , eventTypeOrIdentifier : EventType | EventTypeId | Guid | string , generation ?: Generation | number ) : EventTypesBuilder {
3041 const eventType = eventTypeOrIdentifier instanceof EventType ?
3142 eventTypeOrIdentifier
3243 : new EventType (
3344 EventTypeId . from ( eventTypeOrIdentifier ) ,
34- generation == null ? Generation . first : Generation . from ( generation ) ) ;
45+ generation ? Generation . from ( generation ) : Generation . first ) ;
3546 this . _associations . push ( [ type , eventType ] ) ;
3647 return this ;
3748 }
3849
50+ /**
51+ * Register the type as an {@link EventType}.
52+ * @param type The type to register as an {@link EventType}
53+ */
3954 register < T = any > ( type : Constructor < T > ) : EventTypesBuilder {
4055 this . associate ( type , EventTypesFromDecorators . eventTypes . getFor ( type ) ) ;
4156 return this ;
0 commit comments