mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Alex Rickabaugh
parent
71cc9e685c
commit
49748b5c79
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user