import { EventManager } from '@angular/platform-browser' ; type EventManagerArg = ConstructorParameters < typeof EventManager > [ 0 ] [ 0 ] ; type EventManagerPlugin = { [ K in keyof EventManagerArg ] : EventManagerArg [ K ] ; } ; export abstract class AbstractEventPlugin implements EventManagerPlugin { protected abstract readonly modifier : string ; manager ! : EventManager ; supports ( event ) { return event . includes ( this . modifier ) ; } addGlobalEventListener ( _element , _event , _handler ) { throw new Error ( `Global event targets are not supported by ${ this . modifier } plugin` ) ; } abstract addEventListener ( element , event , handler ) ; protected unwrap ( event ) { return event . split ( '.' ) . filter ( v => ! this . modifier . includes ( v ) ) . join ( '.' ) ; } }