UNPKG

@addapptables/microservice

Version:
18 lines (17 loc) 911 B
import { Type } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { Bus } from './bus'; import { ICommandHandler } from './interfaces/commands/command-handler.interface'; import { ICommand } from './interfaces/commands/command.interface'; import { ICommandDto } from './interfaces/commands/command-dto-interface'; import { ExplorerService } from './services/explore.service'; import { IHandler } from './interfaces'; import { Class } from './types'; export declare class CommandBus extends Bus { private readonly explorerService; constructor(explorerService: ExplorerService, moduleRef: ModuleRef); publish(data: ICommand<ICommandDto>): any; protected registerHandlers(): void; protected reflectName(handler: Type<ICommandHandler<ICommand<ICommandDto>>>): Class<ICommand<ICommandDto>>; protected subscribe: (handle: IHandler<any>) => (data: any) => Promise<any>; }