import { InjectionToken } from "@angular/core"; import { Observable } from "rxjs"; /** * command * @description T is response type */ export interface ICommand { name: string; } /** * Handler */ export interface ICommandHandler { commandName: string; /** * handle command * @param args args */ handle(command: T): Observable; } /** * command handler token */ export declare const COMMAND_HANDLERS_TOKEN: InjectionToken, any>>; /** * Notification * @description no return value */ export interface INotification { } /** * notification handler */ export interface INotificationHandler { /** * notification handler * @param notification notification */ handle(notification: INotification): Observable; } export interface IMediator { /** * send request * @param request request */ send(request: ICommand): Observable; /** * dispatch a message * @param message notification message */ publish(message: INotification): Observable; }