diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index d143148cf8..5ffd808de4 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -1,10 +1,10 @@ -import Boom = require('boom'); +import * as Boom from 'boom'; // 4xx and data type const badRequestError = Boom.badRequest('message', {some: 'data'}); badRequestError.data.some; -const badRequestError2: Boom.Boom = Boom.badImplementation('message'); +const badRequestError2: Boom = Boom.badImplementation('message'); const unauthorizedError1 = Boom.unauthorized('message', 'scheme', {some: 'attribute'}); unauthorizedError1.output.payload.attributes === { some: 'attribute', error: 'message' }; @@ -24,131 +24,131 @@ unauthorizedError4.output.headers === { 'WWW-Authenticate': 'scheme some="attrib const paymentRequiredError = Boom.paymentRequired('message', {some: 'data'}); paymentRequiredError.data.some; -const paymentRequiredError2: Boom.Boom = Boom.paymentRequired('message'); +const paymentRequiredError2: Boom = Boom.paymentRequired('message'); const forbiddenError = Boom.forbidden('message', {some: 'data'}); forbiddenError.data.some; -const forbiddenError2: Boom.Boom = Boom.forbidden('message'); +const forbiddenError2: Boom = Boom.forbidden('message'); const notFoundError = Boom.notFound('message', {some: 'data'}); notFoundError.data.some; -const notFoundError2: Boom.Boom = Boom.notFound('message'); +const notFoundError2: Boom = Boom.notFound('message'); const methodNotAllowedError = Boom.methodNotAllowed('message', {some: 'data'}); methodNotAllowedError.data.some; -const methodNotAllowedError2: Boom.Boom = Boom.methodNotAllowed('message'); +const methodNotAllowedError2: Boom = Boom.methodNotAllowed('message'); const notAcceptableError = Boom.notAcceptable('message', {some: 'data'}); notAcceptableError.data.some; -const notAcceptableError2: Boom.Boom = Boom.notAcceptable('message'); +const notAcceptableError2: Boom = Boom.notAcceptable('message'); const proxyAuthRequiredError = Boom.proxyAuthRequired('message', {some: 'data'}); proxyAuthRequiredError.data.some; -const proxyAuthRequiredError2: Boom.Boom = Boom.proxyAuthRequired('message'); +const proxyAuthRequiredError2: Boom = Boom.proxyAuthRequired('message'); const clientTimeoutError = Boom.clientTimeout('message', {some: 'data'}); clientTimeoutError.data.some; -const clientTimeoutError2: Boom.Boom = Boom.clientTimeout('message'); +const clientTimeoutError2: Boom = Boom.clientTimeout('message'); const conflictError = Boom.conflict('message', {some: 'data'}); conflictError.data.some; const resourceGoneError = Boom.resourceGone('message', {some: 'data'}); resourceGoneError.data.some; -const resourceGoneError2: Boom.Boom = Boom.resourceGone('message'); +const resourceGoneError2: Boom = Boom.resourceGone('message'); const lengthRequiredError = Boom.lengthRequired('message', {some: 'data'}); lengthRequiredError.data.some; -const lengthRequiredError2: Boom.Boom = Boom.lengthRequired('message'); +const lengthRequiredError2: Boom = Boom.lengthRequired('message'); const preconditionFailedError = Boom.preconditionFailed('message', {some: 'data'}); preconditionFailedError.data.some; -const preconditionFailedError2: Boom.Boom = Boom.preconditionFailed('message'); +const preconditionFailedError2: Boom = Boom.preconditionFailed('message'); const entityTooLargeError = Boom.entityTooLarge('message', {some: 'data'}); entityTooLargeError.data.some; -const entityTooLargeError2: Boom.Boom = Boom.lengthRequired('message'); +const entityTooLargeError2: Boom = Boom.lengthRequired('message'); const uriTooLongError = Boom.uriTooLong('message', {some: 'data'}); uriTooLongError.data.some; -const uriTooLongError2: Boom.Boom = Boom.uriTooLong('message'); +const uriTooLongError2: Boom = Boom.uriTooLong('message'); const unsupportedMediaTypeError = Boom.unsupportedMediaType('message', {some: 'data'}); unsupportedMediaTypeError.data.some; -const unsupportedMediaTypeError2: Boom.Boom = Boom.unsupportedMediaType('message'); +const unsupportedMediaTypeError2: Boom = Boom.unsupportedMediaType('message'); const rangeNotSatisfiableError = Boom.rangeNotSatisfiable('message', {some: 'data'}); rangeNotSatisfiableError.data.some; -const rangeNotSatisfiableError2: Boom.Boom = Boom.rangeNotSatisfiable('message'); +const rangeNotSatisfiableError2: Boom = Boom.rangeNotSatisfiable('message'); const expectationFailedError = Boom.expectationFailed('message', {some: 'data'}); expectationFailedError.data.some; -const expectationFailedError2: Boom.Boom = Boom.expectationFailed('message'); +const expectationFailedError2: Boom = Boom.expectationFailed('message'); const teapotError = Boom.teapot('message', {some: 'data'}); teapotError.data.some; -const teapotError2: Boom.Boom = Boom.teapot('message'); +const teapotError2: Boom = Boom.teapot('message'); const badDataError = Boom.badData('message', {some: 'data'}); badDataError.data.some; -const badDataError2: Boom.Boom = Boom.badData('message'); +const badDataError2: Boom = Boom.badData('message'); const lockedError = Boom.locked('message', {some: 'data'}); lockedError.data.some; -const lockedError2: Boom.Boom = Boom.locked('message'); +const lockedError2: Boom = Boom.locked('message'); const failedDependencyError = Boom.failedDependency('message', {some: 'data'}); failedDependencyError.data.some; -const failedDependencyError2: Boom.Boom = Boom.failedDependency('message'); +const failedDependencyError2: Boom = Boom.failedDependency('message'); const preconditionRequiredError = Boom.preconditionRequired('message', {some: 'data'}); preconditionRequiredError.data.some; -const preconditionRequiredError2: Boom.Boom = Boom.preconditionRequired('message'); +const preconditionRequiredError2: Boom = Boom.preconditionRequired('message'); const tooManyRequestsError = Boom.tooManyRequests('message', {some: 'data'}); tooManyRequestsError.data.some; -const tooManyRequestsError2: Boom.Boom = Boom.tooManyRequests('message'); +const tooManyRequestsError2: Boom = Boom.tooManyRequests('message'); const illegalError = Boom.illegal('message', {some: 'data'}); illegalError.data.some; -const illegalError2: Boom.Boom = Boom.illegal('message'); +const illegalError2: Boom = Boom.illegal('message'); // 5xx and data type const badImplementationError = Boom.badImplementation('message', {some: 'data'}); badImplementationError.data.some; -const badImplementationError2: Boom.Boom = Boom.badImplementation('message'); +const badImplementationError2: Boom = Boom.badImplementation('message'); const internalError = Boom.internal('message', {some: 'data'}); internalError.data.some; -const internalError2: Boom.Boom = Boom.internal('message'); +const internalError2: Boom = Boom.internal('message'); const notImplementedError = Boom.notImplemented('message', {some: 'data'}); notImplementedError.data.some; -const notImplementedError2: Boom.Boom = Boom.notImplemented('message'); +const notImplementedError2: Boom = Boom.notImplemented('message'); const badGatewayError = Boom.badGateway('message', {some: 'data'}); badGatewayError.data.some; -const badGatewayError2: Boom.Boom = Boom.badGateway('message'); +const badGatewayError2: Boom = Boom.badGateway('message'); const serverUnavailableError = Boom.serverUnavailable('message', {some: 'data'}); serverUnavailableError.data.some; -const serverUnavailableError2: Boom.Boom = Boom.serverUnavailable('message'); +const serverUnavailableError2: Boom = Boom.serverUnavailable('message'); const gatewayTimeoutError = Boom.gatewayTimeout('message', {some: 'data'}); gatewayTimeoutError.data.some; -const gatewayTimeoutError2: Boom.Boom = Boom.gatewayTimeout('message'); +const gatewayTimeoutError2: Boom = Boom.gatewayTimeout('message'); // boomify const boomifiedError = Boom.boomify(new Error('test'), { statusCode: 400, message: 'some message' }); // isBoom -const isBoomError = new Boom.Boom('test') +const isBoomError = new Boom('test') Boom.isBoom(isBoomError); -const maybeBoom = new Boom.Boom('test'); +const maybeBoom = new Boom('test'); if(Boom.isBoom(maybeBoom)) { // isBoom is a type guard that allows accessing these properties: maybeBoom.output.headers; @@ -156,7 +156,7 @@ if(Boom.isBoom(maybeBoom)) { // constructor -const constructorError: Boom.Boom = new Boom.Boom('test'); +const constructorError: Boom = new Boom('test'); constructorError.message; @@ -184,11 +184,11 @@ interface CustomPayload extends Boom.Payload { * Test assignment of custom error data: */ const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: 'Custom1', isCustom: true } as CustomData1); -const errorWithNoExplicitDataType: Boom.Boom = errorWithData; // can assign to error without explicit data type -const errorWithExplicitType: Boom.Boom = errorWithData; // can assign to union data type -const errorWithConcreteCustomData: Boom.Boom = errorWithData; // can assign to concrete data type +const errorWithNoExplicitDataType: Boom = errorWithData; // can assign to error without explicit data type +const errorWithExplicitType: Boom = errorWithData; // can assign to union data type +const errorWithConcreteCustomData: Boom = errorWithData; // can assign to concrete data type // assignment to CustomData2 would not be possible -// const errorWithConcreteCustomData2: Boom.Boom = errorWithData; +// const errorWithConcreteCustomData2: Boom = errorWithData; // Some complex error data types for testing purposes: interface CustomDataBase { diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index a1e11a341a..b38dafe038 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -8,17 +8,15 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -export = Boom; - -declare namespace Boom { - - /** + export = Boom; +/** * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: * @see {@link https://github.com/hapijs/boom#boom} */ - export class Boom extends Error { +declare class Boom extends Error { + /** Creates a new Boom object using the provided message and then calling boomify() to decorate the error with the Boom properties. */ - constructor(message?: string | Error, options?: Options); + constructor(message?: string | Error, options?: Boom.Options); /** isBoom - if true, indicates this is a Boom object instance. */ isBoom: boolean; /** isServer - convenience bool indicating status code >= 500. */ @@ -26,7 +24,7 @@ declare namespace Boom { /** message - the error message. */ message: string; /** output - the formatted response. Can be directly manipulated after object construction to return a custom error response. Allowed root keys: */ - output: Output; + output: Boom.Output; /** reformat() - rebuilds error.output using the other object properties. */ reformat: () => string; /** "If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object." mentioned in @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ @@ -34,7 +32,7 @@ declare namespace Boom { /** https://github.com/hapijs/boom#createstatuscode-message-data and https://github.com/hapijs/boom/blob/v4.3.0/lib/index.js#L99 */ data: Data; } - +declare namespace Boom { interface Options { /** statusCode - the HTTP status code. Defaults to 500 if no status code is already set. */ statusCode?: number; @@ -50,7 +48,7 @@ declare namespace Boom { override?: boolean; } - export interface Output { + interface Output { /** statusCode - the HTTP status code (typically 4xx or 5xx). */ statusCode: number; /** headers - an object containing any HTTP headers where each key is a header name and value is the header content. (Limited value type to string https://github.com/hapijs/boom/issues/151 ) */ @@ -59,7 +57,7 @@ declare namespace Boom { payload: Payload; } - export interface Payload { + interface Payload { /** statusCode - the HTTP status code, derived from error.output.statusCode. */ statusCode: number; /** error - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ @@ -81,13 +79,13 @@ declare namespace Boom { * @param options optional additional options * @see {@link https://github.com/hapijs/boom#boomifyerror-options} */ - export function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): Boom; + function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): Boom; /** * Identifies whether an error is a Boom object. Same as calling instanceof Boom. * @param error the error object to identify. */ - export function isBoom(error: Error): error is Boom + function isBoom(error: Error): error is Boom // 4xx /** @@ -96,7 +94,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data} */ - export function badRequest(message?: string, data?: Data): Boom; + function badRequest(message?: string, data?: Data): Boom; /** * Returns a 401 Unauthorized error @@ -107,10 +105,10 @@ declare namespace Boom { * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ - export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): Boom; - export function unauthorized(message?: string, scheme?: string[]): Boom; - export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): Boom; - export function unauthorized(message?: null, scheme?: string[]): Boom; + function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): Boom; + function unauthorized(message?: string, scheme?: string[]): Boom; + function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): Boom; + function unauthorized(message?: null, scheme?: string[]): Boom; /** * Returns a 402 Payment Required error @@ -118,7 +116,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data} */ - export function paymentRequired(message?: string, data?: Data): Boom; + function paymentRequired(message?: string, data?: Data): Boom; /** * Returns a 403 Forbidden error @@ -126,7 +124,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data} */ - export function forbidden(message?: string, data?: Data): Boom; + function forbidden(message?: string, data?: Data): Boom; /** * Returns a 404 Not Found error @@ -134,7 +132,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data} */ - export function notFound(message?: string, data?: Data): Boom; + function notFound(message?: string, data?: Data): Boom; /** * Returns a 405 Method Not Allowed error @@ -143,7 +141,7 @@ declare namespace Boom { * @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. * @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow} */ - export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): Boom; + function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): Boom; /** * Returns a 406 Not Acceptable error @@ -151,7 +149,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data} */ - export function notAcceptable(message?: string, data?: Data): Boom; + function notAcceptable(message?: string, data?: Data): Boom; /** * Returns a 407 Proxy Authentication Required error @@ -159,7 +157,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data} */ - export function proxyAuthRequired(message?: string, data?: Data): Boom; + function proxyAuthRequired(message?: string, data?: Data): Boom; /** * Returns a 408 Request Time-out error @@ -167,7 +165,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data} */ - export function clientTimeout(message?: string, data?: Data): Boom; + function clientTimeout(message?: string, data?: Data): Boom; /** * Returns a 409 Conflict error @@ -175,7 +173,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomconflictmessage-data} */ - export function conflict(message?: string, data?: Data): Boom; + function conflict(message?: string, data?: Data): Boom; /** * Returns a 410 Gone error @@ -183,7 +181,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data} */ - export function resourceGone(message?: string, data?: Data): Boom; + function resourceGone(message?: string, data?: Data): Boom; /** * Returns a 411 Length Required error @@ -191,7 +189,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data} */ - export function lengthRequired(message?: string, data?: Data): Boom; + function lengthRequired(message?: string, data?: Data): Boom; /** * Returns a 412 Precondition Failed error @@ -199,7 +197,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data} */ - export function preconditionFailed(message?: string, data?: Data): Boom; + function preconditionFailed(message?: string, data?: Data): Boom; /** * Returns a 413 Request Entity Too Large error @@ -207,7 +205,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data} */ - export function entityTooLarge(message?: string, data?: Data): Boom; + function entityTooLarge(message?: string, data?: Data): Boom; /** * Returns a 414 Request-URI Too Large error @@ -215,7 +213,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data} */ - export function uriTooLong(message?: string, data?: Data): Boom; + function uriTooLong(message?: string, data?: Data): Boom; /** * Returns a 415 Unsupported Media Type error @@ -223,7 +221,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data} */ - export function unsupportedMediaType(message?: string, data?: Data): Boom; + function unsupportedMediaType(message?: string, data?: Data): Boom; /** * Returns a 416 Requested Range Not Satisfiable error @@ -231,7 +229,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data} */ - export function rangeNotSatisfiable(message?: string, data?: Data): Boom; + function rangeNotSatisfiable(message?: string, data?: Data): Boom; /** * Returns a 417 Expectation Failed error @@ -239,7 +237,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data} */ - export function expectationFailed(message?: string, data?: Data): Boom; + function expectationFailed(message?: string, data?: Data): Boom; /** * Returns a 418 I'm a Teapot error @@ -247,7 +245,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomteapotmessage-data} */ - export function teapot(message?: string, data?: Data): Boom; + function teapot(message?: string, data?: Data): Boom; /** * Returns a 422 Unprocessable Entity error @@ -255,7 +253,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombaddatamessage-data} */ - export function badData(message?: string, data?: Data): Boom; + function badData(message?: string, data?: Data): Boom; /** * Returns a 423 Locked error @@ -263,7 +261,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlockedmessage-data} */ - export function locked(message?: string, data?: Data): Boom; + function locked(message?: string, data?: Data): Boom; /** * Returns a 424 Failed Dependency error @@ -271,7 +269,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomfaileddependencymessage-data} */ - export function failedDependency(message?: string, data?: Data): Boom; + function failedDependency(message?: string, data?: Data): Boom; /** * Returns a 428 Precondition Required error @@ -279,7 +277,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data} */ - export function preconditionRequired(message?: string, data?: Data): Boom; + function preconditionRequired(message?: string, data?: Data): Boom; /** * Returns a 429 Too Many Requests error @@ -287,7 +285,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data} */ - export function tooManyRequests(message?: string, data?: Data): Boom; + function tooManyRequests(message?: string, data?: Data): Boom; /** * Returns a 451 Unavailable For Legal Reasons error @@ -295,7 +293,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomillegalmessage-data} */ - export function illegal(message?: string, data?: Data): Boom; + function illegal(message?: string, data?: Data): Boom; // 5xx /** @@ -305,7 +303,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function badImplementation(message?: string, data?: Data): Boom; + function badImplementation(message?: string, data?: Data): Boom; /** * Returns a 500 Internal Server Error error @@ -314,7 +312,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function internal(message?: string, data?: Data): Boom; + function internal(message?: string, data?: Data): Boom; /** * Returns a 501 Not Implemented error with your error message to the user @@ -322,7 +320,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data} */ - export function notImplemented(message?: string, data?: Data): Boom; + function notImplemented(message?: string, data?: Data): Boom; /** * Returns a 502 Bad Gateway error with your error message to the user @@ -330,7 +328,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data} */ - export function badGateway(message?: string, data?: Data): Boom; + function badGateway(message?: string, data?: Data): Boom; /** * Returns a 503 Service Unavailable error with your error message to the user @@ -338,7 +336,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data} */ - export function serverUnavailable(message?: string, data?: Data): Boom; + function serverUnavailable(message?: string, data?: Data): Boom; /** * Returns a 504 Gateway Time-out error with your error message to the user @@ -346,5 +344,5 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data} */ - export function gatewayTimeout(message?: string, data?: Data): Boom; + function gatewayTimeout(message?: string, data?: Data): Boom; } diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index de1542f33f..210e1cc332 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -457,7 +457,7 @@ export interface Request extends Podium { * The response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to * override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects). */ - response: ResponseObject | Boom.Boom | null; + response: ResponseObject | Boom | null; /** * Same as pre but represented as the response object created by the pre method. @@ -3873,7 +3873,7 @@ export namespace Lifecycle { type ReturnValueTypes = (null | string | number | boolean) | (Buffer) | - (Error | Boom.Boom) | + (Error | Boom) | (stream.Stream) | (object | object[]) | symbol |