fix(core): enforce return type for service factory

Updates the `factory` signature in `@Service` to enforce the type of the returned value.
This commit is contained in:
Kristiyan Kostadinov
2026-05-01 10:10:41 +02:00
committed by Alex Rickabaugh
parent 71cc9e685c
commit 49748b5c79
3 changed files with 21 additions and 10 deletions
+5 -2
View File
@@ -1802,12 +1802,15 @@ export const Service: ServiceDecorator;
// @public
export interface ServiceDecorator {
(): TypeDecorator;
(options?: {
(options: {
autoProvided: false;
}): TypeDecorator;
<T>(options: {
autoProvided?: true;
factory: () => T;
}): <C extends Type<unknown>>(target: C) => Type<T>;
(options?: {
autoProvided?: true;
factory?: () => unknown;
}): TypeDecorator;
}