export interface IEvent { ( event , listener ) ; } export interface IErrorEvent extends IEvent { ( event , listener ) ; } export interface IEventProvider < TEvent extends IEvent > { readonly on : IEventTransformer < this , TEvent > ; readonly once : IEventTransformer < this , TEvent > ; readonly off : IEventTransformer < this , TEvent > ; } /**
 * Allow an interface to extend an interfaces that already extends an IEventProvider
 *``` typescript
 * interface AEvents extends IEvent{
 *  (event: "a-event",listener: (a: number)=>void);
 * }
 * interface A extends IEventProvider<AEvents>{
 *  a: object;
 * }
 *
 * interface BEvents extends IEvent{
 *  (event: "b-event",listener: (b: string)=>void);
 * }
 * interface B extends ExtendEventProvider<AEvents, A, BEvents>{
 *  b: boolean;
 * };
 *```
 * interface B will now extend interface A and it's events
 *
 */ export type ExtendEventProvider < TBaseEvent extends IEvent , TBase extends IEventProvider < TBaseEvent > , TEvent extends TBaseEvent > = Omit < Omit < Omit < TBase , "on" > , "once" > , "off" > & IEventProvider < TBaseEvent > & IEventProvider < TEvent > ; export type IEventThisPlaceHolder = { thisPlaceHolder : "thisPlaceHolder" ; } ; export type ReplaceIEventThisPlaceHolder < L extends any [ ] , TThis > = L extends any [ ] ? { [ K in keyof L ] : L [ K ] extends IEventThisPlaceHolder ? TThis : L [ K ] ; } : L ; export type TransformedEvent < TThis , E , A extends any [ ] > = ( event : E , listener : ( ... args : ReplaceIEventThisPlaceHolder < A , TThis > ) => void ) => TThis ; export type IEventTransformer < TThis , TEvent extends IEvent > = TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > & TransformedEvent < TThis , E9 , A9 > & TransformedEvent < TThis , E10 , A10 > & TransformedEvent < TThis , E11 , A11 > & TransformedEvent < TThis , E12 , A12 > & TransformedEvent < TThis , E13 , A13 > & TransformedEvent < TThis , E14 , A14 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > & TransformedEvent < TThis , E9 , A9 > & TransformedEvent < TThis , E10 , A10 > & TransformedEvent < TThis , E11 , A11 > & TransformedEvent < TThis , E12 , A12 > & TransformedEvent < TThis , E13 , A13 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > & TransformedEvent < TThis , E9 , A9 > & TransformedEvent < TThis , E10 , A10 > & TransformedEvent < TThis , E11 , A11 > & TransformedEvent < TThis , E12 , A12 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > & TransformedEvent < TThis , E9 , A9 > & TransformedEvent < TThis , E10 , A10 > & TransformedEvent < TThis , E11 , A11 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > & TransformedEvent < TThis , E9 , A9 > & TransformedEvent < TThis , E10 , A10 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > & TransformedEvent < TThis , E9 , A9 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > & TransformedEvent < TThis , E8 , A8 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > & TransformedEvent < TThis , E7 , A7 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > & TransformedEvent < TThis , E6 , A6 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > & TransformedEvent < TThis , E5 , A5 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > & TransformedEvent < TThis , E4 , A4 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > & TransformedEvent < TThis , E3 , A3 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > & TransformedEvent < TThis , E2 , A2 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > & TransformedEvent < TThis , E1 , A1 > : TEvent extends { ( event , listener ) ; ( event , listener ) ; } ? TransformedEvent < TThis , E0 , A0 > : TransformedEvent < TThis , string , any [ ] > ;