Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions packages/owl-core/src/plugin_hooks.ts
Original file line number Diff line number Diff line change
@@ -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 PluginConstructor> = T extends {
scoped: (plugin: any, scope: Scope) => infer R;
}
? R
: Omit<InstanceType<T>, "setup">;
export type PluginInstance<T extends PluginConstructor> = Omit<InstanceType<T>, "setup">;

export function usePlugin<T extends PluginConstructor>(pluginType: T): PluginInstance<T> {
const scope = useScope();
Expand Down