mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
[hapi__hapi] moving app to CommonRouteProperties (#41968)
This commit is contained in:
Vendored
+6
-6
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user