From 5769f71b3e56dfd2a1c81f867c0c61a79dc9fc61 Mon Sep 17 00:00:00 2001 From: Danilo Alonso Date: Mon, 20 Jan 2025 00:09:19 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20less=20ambigious=20plugin?= =?UTF-8?q?=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/types/plugin.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/types/plugin.d.ts b/lib/types/plugin.d.ts index 2be5b9cf3..61cd5f3ee 100644 --- a/lib/types/plugin.d.ts +++ b/lib/types/plugin.d.ts @@ -107,6 +107,17 @@ export interface PluginBase { ___$type_of_plugin_decorations$___?: D; } +/** + * A plugin that is registered by name and version. + */ +export interface NamedPlugin extends PluginBase, PluginNameVersion {} + +/** + * A plugin that is registered by its package.json file. + */ +export interface PackagedPlugin extends PluginBase, PluginPackage {} + + /** * Plugins provide a way to organize application code by splitting the server logic into smaller components. Each * plugin can manipulate the server through the standard server interface, but with the added ability to sandbox @@ -116,7 +127,7 @@ export interface PluginBase { * * The type T is the type of the plugin options. */ -export type Plugin = PluginBase & (PluginNameVersion | PluginPackage); +export type Plugin = NamedPlugin | PackagedPlugin; /** * The realm object contains sandboxed server settings specific to each plugin or authentication strategy. When registering a plugin or an authentication scheme, a server object reference is provided