From df1c649d2d5b98c5df9bd48de2230a057ae5a6a4 Mon Sep 17 00:00:00 2001 From: Luciano Graziani Date: Wed, 6 Aug 2025 10:20:11 -0300 Subject: [PATCH] fix: #4526 add Refs generic to PluginSpecificConfiguration interface Add Refs generic to plugins key for CommonRouteProperties, extending the generic for logic inside plugins. This fixes situations where plugins API have lambdas where access the request object and requires to have the same Refs type from the route. --- lib/types/plugin.d.ts | 4 ++-- lib/types/route.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/types/plugin.d.ts b/lib/types/plugin.d.ts index 017d25fb3..8bfef77ec 100644 --- a/lib/types/plugin.d.ts +++ b/lib/types/plugin.d.ts @@ -1,4 +1,4 @@ -import { RequestRoute } from './request'; +import { RequestRoute, ReqRef, ReqRefDefaults } from './request'; import { RouteOptions } from './route'; import { Server } from './server'; import { Lifecycle } from './utils'; @@ -47,7 +47,7 @@ export interface PluginRegistered { export interface PluginsStates { } -export interface PluginSpecificConfiguration { +export interface PluginSpecificConfiguration { } export interface PluginNameVersion { diff --git a/lib/types/route.d.ts b/lib/types/route.d.ts index be2416850..102226d05 100644 --- a/lib/types/route.d.ts +++ b/lib/types/route.d.ts @@ -788,7 +788,7 @@ export interface CommonRouteProperties { * Plugin-specific configuration. plugins is an object where each key is a plugin name and the value is the plugin configuration. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsplugins) */ - plugins?: PluginSpecificConfiguration | undefined; + plugins?: PluginSpecificConfiguration | undefined; /** * @default none.