Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ToObject<I>

An object returned by Namespace.bind used to bind the values. Must atleast use one of the functions

Type parameters

  • I

    Type parameter that specifies parameter types

Hierarchy

  • ToObject

Index

Constructors

constructor

  • new ToObject<I>(implementation: Implementation, adder: () => void): ToObject<I>
  • Type parameters

    • I

    Parameters

    • implementation: Implementation
    • adder: () => void
        • (): void
        • Returns void

    Returns ToObject<I>

Properties

Private added

added: boolean

Private with

Methods

Private ensureAdded

  • ensureAdded(): void

toClass

  • toClass(clazz: Class<I, unknown>, singleton?: boolean): WithObject
  • Binds the dependency to a class

    Parameters

    • clazz: Class<I, unknown>

      The class to bind

    • Optional singleton: boolean

      Mark this as singleton

    Returns WithObject

toConstantValue

  • Binds the dependency to a constant value

    Parameters

    • value: I

      The constant value to bind

    Returns WithObject

toDynamicValue

  • Binds the dependency to a dynamic value

    Parameters

    • value: () => I

      The dynamic value to bind

        • (): I
        • Returns I

    Returns WithObject