import yar from "@hapi/yar" ; import { Request , ResponseToolkit , Server , ResponseObject } from "@hapi/hapi" ; import { Logger } from "pino" ; import { RateOptions } from "./plugins/rateLimit" ; import { CacheService , EmailService , NotifyService , PayService , StatusService , UploadService , WebhookService , } from "./services" ; type Services = ( services : string [ ] ) => { cacheService : CacheService ; emailService : EmailService ; notifyService : NotifyService ; payService : PayService ; uploadService : UploadService ; webhookService : WebhookService ; statusService : StatusService ; } ; export type RouteConfig = { rateOptions ? : RateOptions ; formFileName ? : string ; formFilePath ? : string ; enforceCsrf ? : boolean ; } ; declare module "@hapi/hapi" { interface Request { services : Services ; i18n : { setLocale ( lang ) : void ; getLocale ( request ) : void ; getDefaultLocale ( ) : string ; getLocales ( ) : string [ ] ; } ; logger : Logger ; yar : yar . Yar ; } interface Response { } interface Server { logger : Logger ; services : Services ; registerService : ( services : any [ ] ) => void ; yar : yar . ServerYar ; } interface ResponseToolkit { view : ( viewName : string , data ? : { [ prop ] : any ; } ) => any ; } interface RequestApplicationState { location : string ; } } export type HapiRequest = Request ; export type HapiResponseToolkit = ResponseToolkit ; export type HapiServer = Server ; export type HapiResponseObject = ResponseObject ;