From 88d8553e62a0b552ac70aaf8cd1f844463b9eb52 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 30 Nov 2015 09:38:59 -0500 Subject: [PATCH] Adding duck typed Promise Interface --- hapi/hapi.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 644f07e09..fe9e17b5b 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -7,10 +7,6 @@ /// -/// - - - declare module "hapi" { import http = require("http"); @@ -21,6 +17,10 @@ declare module "hapi" { [key: string]: T; } + interface IPromise { + + } + /** Boom Module for errors. https://github.com/hapijs/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: */ export interface IBoom extends Error { @@ -234,12 +234,12 @@ declare module "hapi" { When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ export interface IReply { (err: Error, - result?: string|number|boolean|Buffer|stream.Stream | Promise | T, + result?: string|number|boolean|Buffer|stream.Stream | IPromise | T, /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ credentialData?: any ): IBoom; /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ - (result: string|number|boolean|Buffer|stream.Stream | Promise | T): Response; + (result: string|number|boolean|Buffer|stream.Stream | IPromise | T): Response; /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. * The data argument is only used for passing back authentication data and is ignored elsewhere. */