making IRouteHandlerConfig parameters optional

This commit is contained in:
Adam Carr
2015-03-30 18:33:01 -04:00
parent 48de82851f
commit 25ab55fa3c

8
hapi/hapi.d.ts vendored
View File

@@ -726,7 +726,7 @@ declare module "hapi" {
a relative or absolute file path string (relative paths are resolved based on the route files configuration).
a function with the signature function(request) which returns the relative or absolute file path.
an object with the following options */
file: string | IRequestHandler<void> |IFileHandlerConfig;
file?: string | IRequestHandler<void> |IFileHandlerConfig;
/** directory - generates a directory endpoint for serving static content from a directory. Routes using the directory handler must include a path parameter at the end of the path string (e.g. /path/to/somewhere/{param} where the parameter name does not matter). The path parameter can use any of the parameter options (e.g. {param} for one level files only, {param?} for one level files or the directory root, {param*} for any level, or {param*3} for a specific level). If additional path parameters are present, they are ignored for the purpose of selecting the file system resource. The directory handler is an object with the following options:
path - (required) the directory root path (relative paths are resolved based on the route files configuration). Value can be:
a single path string used as the prefix for any resources requested by appending the request path parameter to the provided string.
@@ -738,7 +738,7 @@ declare module "hapi" {
redirectToSlash - optional boolean, determines if requests for a directory without a trailing slash are redirected to the same path with the missing slash. Useful for ensuring relative links inside the response are resolved correctly. Disabled when the server config router.stripTrailingSlash is true.Defaults to false.
lookupCompressed - optional boolean, instructs the file processor to look for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false.
defaultExtension - optional string, appended to file requests if the requested file is not found. Defaults to no extension.*/
directory: {
directory?: {
path: string |Array<string> | IRequestHandler<string> | IRequestHandler<Array<string>>;
index?: boolean;
listing?: boolean;
@@ -748,7 +748,7 @@ declare module "hapi" {
defaultExtension?: string;
};
proxy?: IProxyHandlerConfig;
view: string | {
view?: string | {
template: string;
context: {
payload: any;
@@ -757,7 +757,7 @@ declare module "hapi" {
pre: any;
}
};
config: {
config?: {
handler: any;
bind: any;
app: any;