Add object arguments (...args) instead of Function. Is it good idea? TODO created.

This commit is contained in:
rafaelsouzaf 2017-12-08 11:43:06 -03:00
parent c739273012
commit fddcaebffa

View File

@ -154,7 +154,7 @@ export class Server extends Podium {
* @return Return value: none.
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servereventsoncecriteria-listener)
*/
once(criteria: string, listener: Function): void;
once(criteria: string, listener: (...args: any[]) => void): void; // TODO I am not sure if the best way is use Function or (...args: any[]) => void) considering the JSDocs "The function signature depends on the event argument"
once(criteria: ServerEventsApplicationObject, listener: Function): void;
once(criteria: ServerEventCriteria, listener: Function): void;