Type Alias PluginFn<TInstance>

PluginFn: InvokableFn<[instance: TInstance, enhance: Enhance], void>

A function-based plugin that receives the target instance and an Enhance utility.

Plugins are used to apply side effects or configuration to an object instance during middleware setup. The plugin receives the instance directly and can enhance its methods, set properties, or perform any initialization logic.

Use this when a simple function is sufficient for the plugin logic. For more complex plugins that carry state or configuration, use IPluginObject instead.

Type Parameters

  • TInstance

    The type of the target instance being configured

The target instance to configure

The Enhance utility for wrapping methods with middleware

IMPORT_PATH: @daiso-tech/core/middleware