ts-lambda-api - v2.5.3
    Preparing search index...

    Interface BindToFluentSyntax<T>

    interface BindToFluentSyntax<T> {
        to(type: Newable<T>): BindInWhenOnFluentSyntax<T>;
        toConstantValue(value: T): BindWhenOnFluentSyntax<T>;
        toDynamicValue(
            builder: DynamicValueBuilder<T>,
        ): BindInWhenOnFluentSyntax<T>;
        toFactory(
            factory: T extends Factory<unknown, any>
                ? (context: ResolutionContext) => T<T> | Promise<T<T>>
                : never,
        ): BindWhenOnFluentSyntax<T>;
        toProvider(
            provider: T extends Provider<unknown, any>
                ? (context: ResolutionContext) => T<T>
                : never,
        ): BindWhenOnFluentSyntax<T>;
        toResolvedValue(factory: () => T | Promise<T>): BindInWhenOnFluentSyntax<T>;
        toResolvedValue<TArgs extends unknown[] = any[]>(
            factory: (...args: TArgs) => T | Promise<T>,
            injectOptions: MapToResolvedValueInjectOptions<TArgs>,
        ): BindInWhenOnFluentSyntax<T>;
        toSelf(): BindInWhenOnFluentSyntax<T>;
        toService(service: ServiceIdentifier<T>): void;
    }

    Type Parameters

    • T
    Index

    Methods

    • Parameters

      Returns BindWhenOnFluentSyntax<T>

      Use toFactory() instead. Providers will be removed in v8. Providers exist for historical reasons from v5 when async dependencies weren't supported. Factories are more flexible and can handle both sync and async operations.

    • Parameters

      Returns void