mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
More fix based in test cases.
This commit is contained in:
+1
-1
@@ -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.
|
||||
|
||||
@@ -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
@@ -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
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user