(
id: ServiceIdentifier<T>,
ctorOrDescriptor:
| SyncDescriptor<any>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
| (new (...services: Services) => T),
instantiationType?: boolean | InstantiationType,
)
| 54 | descriptor: SyncDescriptor<any>, |
| 55 | ): void; |
| 56 | export function registerSingleton<T, Services extends BrandedService[]>( |
| 57 | id: ServiceIdentifier<T>, |
| 58 | ctorOrDescriptor: |
| 59 | | SyncDescriptor<any> |
| 60 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 61 | | (new (...services: Services) => T), |
| 62 | instantiationType?: boolean | InstantiationType, |
| 63 | ): void { |
| 64 | const descriptor = |
| 65 | ctorOrDescriptor instanceof SyncDescriptor |
| 66 | ? ctorOrDescriptor |
| 67 | : new SyncDescriptor<T>( |
| 68 | ctorOrDescriptor as new (...args: unknown[]) => T, |
| 69 | [], |
| 70 | Boolean(instantiationType), |
| 71 | ); |
| 72 | |
| 73 | _registry.push([id, descriptor]); |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Return the registry as a list suitable for `ServiceCollection` |
no test coverage detected