Class QualifiedType<T>

A qualified type. Allows injecting multiple implementations of the same base type under different names so consumers can decide which implementation to inject by simply changing the qualifier name.

Type Parameters

  • T extends Class = Class

    The type to qualify with a name.

Properties

Methods

Properties

name: string | symbol

The name/symbol to qualify the type with.

type: T

The type to qualify.

Methods

  • Returns the qualifier type for the given type and name. It is guaranteed to always return the same instance for the same combination of type and name.

    Type Parameters

    • T extends Class

      The type to qualify with a name.

    Parameters

    • type: T

      The type to qualify.

    • name: string | symbol

      The name/symbol to qualify the type with.

    Returns QualifiedType<T>