From 4e24fd41880a8ab87b796a1edfb6a156bfa0621a Mon Sep 17 00:00:00 2001 From: Rodrigo Saboya Date: Thu, 30 Jan 2020 18:05:05 -0300 Subject: [PATCH] [hapi__hapi] moving app to CommonRouteProperties (#41968) --- types/hapi__hapi/index.d.ts | 12 ++++++------ types/hapi__hapi/test/route/settings.ts | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/types/hapi__hapi/index.d.ts b/types/hapi__hapi/index.d.ts index fccdab64a3..b4b6b1abf8 100644 --- a/types/hapi__hapi/index.d.ts +++ b/types/hapi__hapi/index.d.ts @@ -1728,6 +1728,12 @@ export interface RouteOptionsApp { } export interface CommonRouteProperties { + /** + * Application-specific route configuration state. Should not be used by plugins which should use options.plugins[name] instead. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsapp) + */ + app?: RouteOptionsApp; + /** * @default null. * An object passed back to the provided handler (via this) when called. Ignored if the method is an arrow function. @@ -1986,12 +1992,6 @@ export interface RouteSettings extends CommonRouteProperties { * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#route-options) */ export interface RouteOptions extends CommonRouteProperties { - /** - * Application-specific route configuration state. Should not be used by plugins which should use options.plugins[name] instead. - * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsapp) - */ - app?: RouteOptionsApp; - /** * Route authentication configuration. Value can be: * false to disable authentication if a default strategy is set. diff --git a/types/hapi__hapi/test/route/settings.ts b/types/hapi__hapi/test/route/settings.ts index 71bde5f453..45c0ff5fd6 100644 --- a/types/hapi__hapi/test/route/settings.ts +++ b/types/hapi__hapi/test/route/settings.ts @@ -1,9 +1,10 @@ -import { RouteSettings, AuthSettings, AccessSetting, AuthMode, AccessEntity, AccessScopes, RequestRoute } from '@hapi/hapi'; +import { RouteSettings, AuthSettings, AccessSetting, AuthMode, AccessEntity, AccessScopes, RequestRoute, RouteOptionsApp } from '@hapi/hapi'; declare let route: RequestRoute; const settings: RouteSettings = route.settings; const auth: AuthSettings | undefined = settings.auth; +const app: RouteOptionsApp | undefined = settings.app; const strats: string[] = auth!.strategies; const mode: AuthMode = auth!.mode; const access: AccessSetting[] | undefined = auth!.access;