method IServiceRegistry.register
IServiceRegistry.register<T extends object>(
service: T,
options?: RegisterOptions
): void

Registers a service instance under a capability token.

Type Parameters

T extends object

The service type

Parameters

The capability token to register under

service: T

The service instance

optional
options: RegisterOptions

Override and multi-provider behavior

Return Type

void

Throws

Error

If the token is already registered and neither override nor multi is set

Error

If called after the application has run runBootstrap()

Usage

import { type IServiceRegistry } from "common/src/index.ts";