Schmervice types in definitely typed are a good starting point so I ported them and have added tsd type declaration tests since I prefer making explicit type assertions in tests.
I want to update the the decorator functions the to accept a string or true rather than an optional boolean since the function also take string arguments that correspond to namespaces. It would look something like the following
declare module '@hapi/hapi' {
interface Server {
/**
* decorations can be passed a plugin namespace or a boolean to return all registered services
* @param all
*/
services: (all?: true | string) => RegisteredServices;
}
interface Request {
services: (all?: true | string) => RegisteredServices;
}
interface ResponseToolkit {
services: (all?: true | string) => RegisteredServices;
}
}
Schmervice types in definitely typed are a good starting point so I ported them and have added tsd type declaration tests since I prefer making explicit type assertions in tests.
I want to update the the decorator functions the to accept a string or true rather than an optional boolean since the function also take string arguments that correspond to namespaces. It would look something like the following