-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'chore/improve-comments'
- Loading branch information
Showing
13 changed files
with
169 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import { ICommand } from './command.interface'; | ||
|
||
/** | ||
* Represents a command bus. | ||
*/ | ||
export interface ICommandBus<CommandBase extends ICommand = ICommand> { | ||
/** | ||
* Executes a command. | ||
* @param command The command to execute. | ||
*/ | ||
execute<T extends CommandBase, R = any>(command: T): Promise<R>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { ICommand } from './command.interface'; | ||
|
||
/** | ||
* Represents a command handler. | ||
* Command handlers are used to execute commands. | ||
*/ | ||
export interface ICommandHandler< | ||
TCommand extends ICommand = any, | ||
TResult = any | ||
TResult = any, | ||
> { | ||
/** | ||
* Executes a command. | ||
* @param command The command to execute. | ||
*/ | ||
execute(command: TCommand): Promise<TResult>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import { IEvent } from './event.interface'; | ||
|
||
/** | ||
* Represents an event bus. | ||
*/ | ||
export interface IEventBus<EventBase extends IEvent = IEvent> { | ||
/** | ||
* Publishes an event. | ||
* @param event The event to publish. | ||
*/ | ||
publish<T extends EventBase>(event: T); | ||
|
||
/** | ||
* Publishes multiple events. | ||
* @param events The events to publish. | ||
*/ | ||
publishAll(events: EventBase[]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import { IEvent } from './event.interface'; | ||
|
||
/** | ||
* Represents an event handler. | ||
*/ | ||
export interface IEventHandler<T extends IEvent = any> { | ||
/** | ||
* Handles an event. | ||
* @param event The event to handle. | ||
*/ | ||
handle(event: T): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import { IQuery } from './query.interface'; | ||
|
||
/** | ||
* Represents a query bus. | ||
*/ | ||
export interface IQueryBus<QueryBase extends IQuery = IQuery> { | ||
/** | ||
* Executes a query. | ||
* @param query The query to execute. | ||
*/ | ||
execute<T extends QueryBase = QueryBase, TRes = any>(query: T): Promise<TRes>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import { IQuery } from './query.interface'; | ||
|
||
/** | ||
* Represents a query handler. | ||
*/ | ||
export interface IQueryHandler<T extends IQuery = any, TRes = any> { | ||
/** | ||
* Executes a query. | ||
* @param query The query to execute. | ||
*/ | ||
execute(query: T): Promise<TRes>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters