More fix based in test cases.

This commit is contained in:
rafaelsouzaf
2017-12-09 21:26:13 -03:00
parent 0e389ba4e7
commit 1b597e080a
4 changed files with 11 additions and 22 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ export interface Request extends Podium {
/**
* By default the object outputted from node's URL parse() method. Might also be set indirectly via request.setUrl in which case it may be a string (if url is set to an object with the query attribute as an unparsed string).
*/
readonly query: object;
readonly query: any;
/**
* An object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.
+2 -7
View File
@@ -11,14 +11,9 @@ export interface ResponseEvents extends Podium {
/**
* 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding).
*/
on(criteria: 'peak', listener: Function): void;
once(criteria: 'peak', listener: Function): void;
/**
* 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function ().
*/
on(criteria: 'finish', listener: Function): void;
once(criteria: 'finish', listener: Function): void;
on(criteria: 'peek' | 'finish', listener: Function): void;
once(criteria: 'peek' | 'finish', listener: Function): void;
}
+3 -7
View File
@@ -9,7 +9,7 @@ import {Lifecycle, Server} from "hapi";
* For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents)
* For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle)
*/
export type ServerExtType = 'onPreStart' | 'onPostStart' | 'onPreStop' | 'onPostStop';
export type ServerExtType = 'onRequest' | 'onPreStart' | 'onPostStart' | 'onPreStop' | 'onPostStop'| 'onPreResponse';
/**
* The extension point event name for Request
@@ -41,7 +41,7 @@ export type ServerExtRequestType = 'onRequest';
*/
export interface ServerExtEventsObject {
type: ServerExtType;
method: ServerExtPointFunction | ServerExtPointFunction[];
method: ServerExtPointFunction | ServerExtPointFunction[] | Function;
options?: ServerExtOptions;
}
@@ -68,7 +68,7 @@ export interface ServerExtEventsObject {
*/
export interface ServerExtEventsRequestObject {
type: ServerExtRequestType;
method: RequestExtPointFunction | RequestExtPointFunction[];
method: Lifecycle.Method | Lifecycle.Method[];
options?: ServerExtOptions;
}
@@ -76,10 +76,6 @@ export interface ServerExtPointFunction {
(server: Server): void;
}
export interface RequestExtPointFunction extends Lifecycle.Method {
}
/**
* An object with the following:
* * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added.
+5 -7
View File
@@ -2,22 +2,22 @@ import * as http from "http";
import * as zlib from "zlib";
import * as Podium from "podium";
import {
Lifecycle,
PayloadCompressionDecoderSettings,
Plugin,
PluginsListRegistered,
Request,
RequestExtPointFunction,
RequestRoute,
ResponseToolkit,
RouteCompressionEncoderSettings,
ServerAuth, ServerCache,
ServerAuth,
ServerCache,
ServerEvents,
ServerEventsApplication,
ServerExtEventsObject,
ServerExtEventsRequestObject,
ServerExtOptions,
ServerExtPointFunction,
ServerExtRequestType,
ServerExtType,
ServerInfo,
ServerInjectOptions,
@@ -343,10 +343,8 @@ export class Server extends Podium {
* @return Return value: none.
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevent-method-options)
*/
ext(event: ServerExtType, method: ServerExtPointFunction): void;
ext(event: ServerExtType, method: ServerExtPointFunction, options: ServerExtOptions): void;
ext(event: ServerExtRequestType, method: RequestExtPointFunction): void;
ext(event: ServerExtRequestType, method: RequestExtPointFunction, options: ServerExtOptions): void;
ext(event: ServerExtType, method: ServerExtPointFunction | Lifecycle.Method | Function): void;
ext(event: ServerExtType, method: ServerExtPointFunction | Lifecycle.Method | Function, options: ServerExtOptions): void;
/**
* Initializes the server (starts the caches, finalizes plugin registration) but does not start listening on the connection port.