From aebec4b1560063718a4d0cf1c42a8908668c0463 Mon Sep 17 00:00:00 2001 From: Teamop Date: Thu, 22 Nov 2018 18:07:29 +0800 Subject: [PATCH] refactor(core): improve type for EventEmitter (#27228) PR Close #27228 --- packages/core/src/event_emitter.ts | 2 +- tools/public_api_guard/core/core.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/event_emitter.ts b/packages/core/src/event_emitter.ts index 40482cd8df..c1a2bed99e 100644 --- a/packages/core/src/event_emitter.ts +++ b/packages/core/src/event_emitter.ts @@ -97,7 +97,7 @@ export class EventEmitter extends Subject { * @param complete When supplied, a custom handler for a completion * notification from this emitter. */ - subscribe(generatorOrNext?: any, error?: any, complete?: any): any { + subscribe(generatorOrNext?: any, error?: any, complete?: any): Subscription { let schedulerFn: (t: any) => any; let errorFn = (err: any): any => null; let completeFn = (): any => null; diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index fb5ec145dc..f9fd78569c 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -313,7 +313,7 @@ export declare class EventEmitter extends Subject { __isAsync: boolean; constructor(isAsync?: boolean); emit(value?: T): void; - subscribe(generatorOrNext?: any, error?: any, complete?: any): any; + subscribe(generatorOrNext?: any, error?: any, complete?: any): Subscription; } export interface ExistingProvider extends ExistingSansProvider {