-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.d.ts
36 lines (35 loc) · 1.63 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Type definitions for hapi-decorators v0.4.3
// Project: https://github.com/knownasilya/hapi-decorators
// Definitions by: Ken Howard <https://github.com/kenhowardpdx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import * as hapi from '@hapi/hapi';
interface ControllerStatic {
new(...args: any[]): Controller;
}
export interface Controller {
baseUrl: string;
routes: () => hapi.ServerRoute[];
}
export function controller(baseUrl: string): (target: ControllerStatic) => void;
interface IRouteSetup {
(target: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor;
}
interface IRouteDecorator {
(method: string, path: string): IRouteSetup;
}
interface IRouteConfig {
(path: string): IRouteSetup;
}
export const route: IRouteDecorator;
export const get: IRouteConfig;
export const post: IRouteConfig;
export const put: IRouteConfig;
// export const delete: IRouteConfig;
export const del: IRouteConfig;
export const patch: IRouteConfig;
export const all: IRouteConfig;
export function options(options: hapi.RouteOptions | ((server: hapi.Server) => hapi.RouteOptions)): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
export function validate(config: hapi.RouteOptionsValidate): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
export function cache(cacheConfig: false | hapi.RouteOptionsCache): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
export function pre(pre: hapi.RouteOptionsPreArray): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;