Stone.js API
    Preparing search index...

    Abstract class representing a Binding.

    This abstract class serves as the base class for all types of bindings in the service container. It holds a value and provides an abstract method to resolve and return that value, allowing different subclasses to implement their own resolution logic. Bindings are used to manage dependencies and control how objects are instantiated within the container.

    Mr. Stone evensstone@gmail.com

    Type Parameters

    • V extends BindingValue

      The type of value that this binding holds.

    Hierarchy (View Summary)

    Implements

    Index
    • Create a new instance of Binding.

      Type Parameters

      • V extends BindingValue

        The type of value that this binding holds.

      Parameters

      • Optionalvalue: V

        The value to be held by the binding.

      Returns Binding<V>

    resolved: boolean

    Whether the value has been resolved at least once.

    Tracked explicitly (not inferred from value !== undefined) so a binding whose resolved value is legitimately undefined is still considered resolved — preserving the singleton guarantee and avoiding repeated resolver side effects.

    value?: V

    The value held by the binding.

    This value is resolved at runtime, either directly or through a resolver function.

    • Check if the value has been resolved.

      Returns boolean

      A boolean indicating whether the value has been resolved.

    • Resolve and return the value of the binding.

      This abstract method must be implemented by subclasses to provide specific resolution logic.

      Parameters

      • container: IContainer

        The container to resolve dependencies from.

      Returns V

      The resolved value of the binding.