@lppedd/di-wise-neo - v0.11.1
    Preparing search index...

    Interface ClassProvider<Instance>

    Provides a class instance for a token via a class constructor.

    interface ClassProvider<Instance extends object> {
        name?: string;
        useClass: Constructor<Instance>;
    }

    Type Parameters

    • Instance extends object
    Index

    Properties

    Properties

    name?: string

    An optional name to qualify this provider. If specified, the token must be resolved using the same name.

    Equivalent to decorating the class with @Named(...).

    export class ExtensionContext {
    // Decorator-based injection
    constructor(@Inject(ISecretStorage) @Named("persistent") secretStorage: SecretStorage) {}

    // Function-based injection
    constructor(secretStorage = inject(ISecretStorage, "persistent")) {}
    }

    The class to instantiate for the token.