import { IClass , ITypeFilter } from "@robotlegsjs/core" ; import { IMediatorMapping } from "../api/IMediatorMapping" ; import { IMediatorConfigurator } from "../dsl/IMediatorConfigurator" ; private export class MediatorMapping implements IMediatorMapping , IMediatorConfigurator { private _matcher : ITypeFilter ; inheritDoc public get matcher ( ) : ITypeFilter { return this . _matcher ; } private _mediatorClass : IClass < any > ; inheritDoc public get mediatorClass ( ) : IClass < any > { return this . _mediatorClass ; } private _guards : any [ ] = [ ] ; inheritDoc public get guards ( ) : any [ ] { return this . _guards ; } private _hooks : any [ ] = [ ] ; inheritDoc public get hooks ( ) : any [ ] { return this . _hooks ; } private _autoRemoveEnabled : boolean = true ; inheritDoc public get autoRemoveEnabled ( ) : boolean { return this . _autoRemoveEnabled ; } private constructor ( matcher , mediatorClass ) { this . _matcher = matcher ; this . _mediatorClass = mediatorClass ; } inheritDoc public withGuards ( ... guards ) { this . _guards = this . _guards . concat . apply ( this . _guards , guards ) ; return this ; } inheritDoc public withHooks ( ... hooks ) { this . _hooks = this . _hooks . concat . apply ( this . _hooks , hooks ) ; return this ; } inheritDoc public autoRemove ( value = true ) { this . _autoRemoveEnabled = value ; return this ; } }