Backstage
    Preparing search index...

    Interface PluginServiceFactoryOptions<TService, TInstances, TContext, TImpl, TDeps>

    interface PluginServiceFactoryOptions<
        TService,
        TInstances extends "singleton" | "multiton",
        TContext,
        TImpl extends TService,
        TDeps extends { [name in string]: ServiceRef<unknown> },
    > {
        deps: TDeps;
        initialization?: "always" | "lazy";
        service: ServiceRef<TService, "plugin", TInstances>;
        createRootContext?(
            deps: ServiceRefsToInstances<TDeps, "root">,
        ): TContext | Promise<TContext>;
        factory(
            deps: ServiceRefsToInstances<TDeps>,
            context: TContext,
        ): TImpl | Promise<TImpl>;
    }

    Type Parameters

    • TService
    • TInstances extends "singleton" | "multiton"
    • TContext
    • TImpl extends TService
    • TDeps extends { [name in string]: ServiceRef<unknown> }
    Index

    Properties

    deps: TDeps
    initialization?: "always" | "lazy"

    The initialization strategy for the service factory. This service is plugin scoped and will use lazy by default.

    • always - The service will always be initialized regardless if it is used or not.
    • lazy - The service will only be initialized if it is depended on by a different service or feature.

    Service factories for root scoped services use always as the default, while plugin scoped services use lazy.

    service: ServiceRef<TService, "plugin", TInstances>

    Methods