feathers
                                
                                 feathers copied to clipboard
                                
                                    feathers copied to clipboard
                            
                            
                            
                        Typesafe service-events
It would be very nice to have types on the eventemitter of services. This issue should track the request.
Currently I go with an own helper method on the service which types on():
export type MyService = Static<typeof processSchema>
export type MyServiceEvents = {
  created: MyService;
  removed: MyService;
  // ...
}
export class MyServiceService<ServiceParams extends MyServiceParams = MyServiceParams>
  implements ServiceInterface<MyService, MyServiceData, ServiceParams>
{
  //...
  
  // Helper method for typed events
  onTyped<EventName extends keyof MyServiceEvents>(eventName: EventName, handler: (payload: MyServiceEvents[EventName]) => void) {
    this.getService().on(eventName, handler);
  }
}
But we should think about to get this into feathers-core.