Configuration

public protocol Configuration : Inject

The Configuration protocol makes the user can register Resolver.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T>(
        _ type: T.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping () -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3, Dep4>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        _ dependency4: Dep4.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3, Dep4) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    dependency4

    Required dependency 4

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3, Dep4, Dep5>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        _ dependency4: Dep4.Type,
        _ dependency5: Dep5.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3, Dep4, Dep5) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    dependency4

    Required dependency 4

    dependency5

    Required dependency 5

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3, Dep4, Dep5, Dep6>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        _ dependency4: Dep4.Type,
        _ dependency5: Dep5.Type,
        _ dependency6: Dep6.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3, Dep4, Dep5, Dep6) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    dependency4

    Required dependency 4

    dependency5

    Required dependency 5

    dependency6

    Required dependency 6

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3, Dep4, Dep5, Dep6, Dep7>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        _ dependency4: Dep4.Type,
        _ dependency5: Dep5.Type,
        _ dependency6: Dep6.Type,
        _ dependency7: Dep7.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3, Dep4, Dep5, Dep6, Dep7) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    dependency4

    Required dependency 4

    dependency5

    Required dependency 5

    dependency6

    Required dependency 6

    dependency7

    Required dependency 7

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3, Dep4, Dep5, Dep6, Dep7, Dep8>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        _ dependency4: Dep4.Type,
        _ dependency5: Dep5.Type,
        _ dependency6: Dep6.Type,
        _ dependency7: Dep7.Type,
        _ dependency8: Dep8.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3, Dep4, Dep5, Dep6, Dep7, Dep8) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    dependency4

    Required dependency 4

    dependency5

    Required dependency 5

    dependency6

    Required dependency 6

    dependency7

    Required dependency 7

    dependency8

    Required dependency 8

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.

  • Register custom Resolver by developers.

    Declaration

    Swift

    static func Config<T, Dep1, Dep2, Dep3, Dep4, Dep5, Dep6, Dep7, Dep8, Dep9>(
        _ type: T.Type,
        _ dependency1: Dep1.Type,
        _ dependency2: Dep2.Type,
        _ dependency3: Dep3.Type,
        _ dependency4: Dep4.Type,
        _ dependency5: Dep5.Type,
        _ dependency6: Dep6.Type,
        _ dependency7: Dep7.Type,
        _ dependency8: Dep8.Type,
        _ dependency9: Dep9.Type,
        qualifier: String = "",
        scope: Scope = .singleton,
        resolver: @escaping (Dep1, Dep2, Dep3, Dep4, Dep5, Dep6, Dep7, Dep8, Dep9) -> T
    ) -> () -> T

    Parameters

    type

    The dependency type to resolve.

    dependency1

    Required dependency 1

    dependency2

    Required dependency 2

    dependency3

    Required dependency 3

    dependency4

    Required dependency 4

    dependency5

    Required dependency 5

    dependency6

    Required dependency 6

    dependency7

    Required dependency 7

    dependency8

    Required dependency 8

    dependency9

    Required dependency 9

    qualifier

    The qualifier.

    scope

    It is specify the way that manages the lifecycle. (default is .singleton)

    resolver

    The closure to specify how to resolve with the dependencies of the type. It is invoked when needs to instantiate the instance.

    Return Value

    The closure that resolve dependency type.