An implementation of the IServiceManager interface.

Properties

_serviceManager: ServiceManager
clear: () => void

Clears the service.

Type declaration

    • (): void
    • Returns void

      Returns nothing.

SomeClass

clear

disableUML: () => void

Disable UML log collection. Increase performance on production

inject: <T = object>(key: Key, verbose?: boolean) => T

Injects a dependency using the given key and returns an instance of the dependency.

Type declaration

    • <T = object>(key: Key, verbose?: boolean): T
    • Type Parameters

      • T = object

        The type of the dependency being injected.

      Parameters

      • key: Key

        The key used to locate the dependency.

      • Optionalverbose: boolean

        A flag indicating whether verbose logging should be enabled (default is true).

      Returns T

      • An instance of the dependency.
prefetch: (verbose?: boolean) => Promise<void>

Prefetches data using the _serviceManager.prefetch method.

Type declaration

    • (verbose?: boolean): Promise<void>
    • Parameters

      • Optionalverbose: boolean

        Specifies whether to enable verbose mode.

      Returns Promise<void>

      • A promise that resolves when the prefetching is complete.
registerCreator: <T = object>(key: Key, ctor: () => T | Promise<T>) => void

Registers a creator function for a given key.

Type declaration

    • <T = object>(key: Key, ctor: () => T | Promise<T>): void
    • Type Parameters

      • T = object

      Parameters

      • key: Key

        The key to associate with the creator function.

      • ctor: () => T | Promise<T>

        The creator function that returns the desired object or a promise resolving to the desired object.

      Returns void

registerInstance: <T = object>(key: Key, inst: T) => void

Registers an instance with the service manager.

Type declaration

    • <T = object>(key: Key, inst: T): void
    • Type Parameters

      • T = object

      Parameters

      • key: Key

        The key for the registered instance.

      • inst: T

        The instance to be registered.

      Returns void

toUML: () => string

Converts a resolution tree to a YAML UML representation. Prints the UML representation to the console and returns it as a string.

Type declaration

    • (): string
    • Returns string

      The YAML UML representation of the resolution tree.

unload: (verbose?: boolean) => Promise<void>

Unloads a resource using the _serviceManager.

Type declaration

    • (verbose?: boolean): Promise<void>
    • Parameters

      • Optionalverbose: boolean

        Whether to output verbose information. Default value is true.

      Returns Promise<void>

      • A promise that resolves when the resource is unloaded.
waitForProvide: (verbose?: boolean) => Promise<void>

Wait for the service to be provided.

Type declaration

    • (verbose?: boolean): Promise<void>
    • Parameters

      • Optionalverbose: boolean

        Whether to output verbose logs.

      Returns Promise<void>

      • A promise that resolves when the service is provided.