@arcmantle/adapter-element
    Preparing search index...

    Interface FactoryBinding<T>

    Binding configuration for factory functions. Used when registering a factory function that creates instances dynamically.

    interface FactoryBinding<T> {
        activator?: (instance: any, container: PluginContainer) => any;
        cache: any;
        initializer: (container: PluginContainer) => T;
        method: Lifetimes;
        moduleId?: Identifier;
        named?: Identifier;
        resolution: "first" | "last";
        tagged?: Identifier;
        type: "factory";
    }

    Type Parameters

    • T

      The type of value produced by the factory function

    Hierarchy (View Summary)

    Index

    Properties

    activator?: (instance: any, container: PluginContainer) => any

    Optional post-creation hook that processes the instance before returning it

    cache: any

    Internal cache for singleton instances - stores the created instance to avoid recreating it

    initializer: (container: PluginContainer) => T

    The value, constructor, or factory function used to create instances

    method: Lifetimes

    Lifetime management strategy - 'singleton' reuses instances, 'transient' creates new ones

    moduleId?: Identifier

    Internal identifier linking this binding to a specific module for organized loading/unloading

    named?: Identifier

    Optional name for the binding to allow multiple bindings for the same identifier

    resolution: "first" | "last"

    A resolution of first denotes that the first container in the lineage with a binding will be used. A resolution of last denotes that the last container in the lineage with a binding will be used.

    tagged?: Identifier

    Optional tag used in combination with name for even more specific binding identification

    type: "factory"

    The binding type - determines how the value is created ('class', 'factory', or 'constant')