Skip to content

Add Schmervice types and improve server decorations  #1

@ianjkaplan

Description

@ianjkaplan

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;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions