Installation
npm install --save @types/hapi-decorators
Summary
This package contains type definitions for hapi-decorators (https://github.com/knownasilya/hapi-decorators).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hapi-decorators.
index.d.ts
import * as hapi from "hapi";
import * as Joi from "joi";
interface ControllerStatic {
new(...args: any[]): Controller;
}
export interface Controller {
baseUrl: string;
routes: () => hapi.RouteConfiguration[];
}
export function controller(baseUrl: string): (target: ControllerStatic) => void;
interface IRouteSetup {
(target: any, key: any, descriptor: any): any;
}
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 patch: IRouteConfig;
export const all: IRouteConfig;
export function config(
config: hapi.RouteAdditionalConfigurationOptions,
): (target: any, key: any, descriptor: any) => any;
export function validate(
config: hapi.RouteValidationConfigurationObject,
): (target: any, key: any, descriptor: any) => any;
interface ICacheConfig {
privacy?: string | undefined;
expiresIn?: number | undefined;
expiresAt?: number | undefined;
}
export function cache(cacheConfig: ICacheConfig): (target: any, key: any, descriptor: any) => any;
export function pre(pre: {
[key: string]: any;
}): (target: any, key: any, descriptor: any) => any;
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: @types/hapi, joi
Credits
These definitions were written by Ken Howard.