Interface EnhancerDefinition<Options, Api>

Declarative description of an enhancer, passed to defineEnhancer.

interface EnhancerDefinition<
    Options extends object = Record<string, never>,
    Api = null,
> {
    defaults?: Options;
    name: string;
    selector: string;
    setup: (ctx: EnhancerContext<Options>) => void | Api;
}

Type Parameters

  • Options extends object = Record<string, never>
  • Api = null

Properties

defaults?: Options

Default options merged under caller-provided options.

name: string

Stable name, used for generated ids and the auto-loader manifest.

selector: string

CSS selector identifying each component root.

setup: (ctx: EnhancerContext<Options>) => void | Api

Wire behavior for a single root. May return the instance's public API.