From 3485ce93b424467d4d5cbd0606e697b7de4d5c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Mattiello?= Date: Thu, 23 Jul 2026 15:04:36 +0200 Subject: [PATCH] [FIX] plugin: fix usePlugin return type Before this commit, `usePlugin` returned the type of the static method `scoped` of the plugin if it was defined. Now, `usePlugin` always returns the instance type of the plugin. --- packages/owl-core/src/plugin_hooks.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/owl-core/src/plugin_hooks.ts b/packages/owl-core/src/plugin_hooks.ts index 6d3b22a66..40bab4fe5 100644 --- a/packages/owl-core/src/plugin_hooks.ts +++ b/packages/owl-core/src/plugin_hooks.ts @@ -1,14 +1,10 @@ import { OwlError } from "./owl_error"; import { PluginConstructor, PluginManager } from "./plugin_manager"; -import { Scope, useScope } from "./scope"; +import { useScope } from "./scope"; import { getDefault, types, type Optional, type StripBrands, type WithDefault } from "./types"; import { assertType } from "./validation"; -export type PluginInstance = T extends { - scoped: (plugin: any, scope: Scope) => infer R; -} - ? R - : Omit, "setup">; +export type PluginInstance = Omit, "setup">; export function usePlugin(pluginType: T): PluginInstance { const scope = useScope();