From 24e5c5b425e68baf5f26d4be8f5dc2aca95517d3 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Wed, 23 May 2018 10:46:18 -0700 Subject: [PATCH] refactor(platform-browser): make HAMMER_LOADER non-nullable (#24077) PR Close #24077 --- packages/platform-browser/src/dom/events/hammer_gestures.ts | 4 ++-- tools/public_api_guard/platform-browser/platform-browser.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/platform-browser/src/dom/events/hammer_gestures.ts b/packages/platform-browser/src/dom/events/hammer_gestures.ts index f4f4b9c09c..7e2a5db227 100644 --- a/packages/platform-browser/src/dom/events/hammer_gestures.ts +++ b/packages/platform-browser/src/dom/events/hammer_gestures.ts @@ -63,7 +63,7 @@ export const HAMMER_GESTURE_CONFIG = new InjectionToken('Ha /** Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded. */ -export type HammerLoader = (() => Promise) | null; +export type HammerLoader = () => Promise; /** Injection token used to provide a {@link HammerLoader} to Angular. */ export const HAMMER_LOADER = new InjectionToken('HammerLoader'); @@ -146,7 +146,7 @@ export class HammerGesturesPlugin extends EventManagerPlugin { constructor( @Inject(DOCUMENT) doc: any, @Inject(HAMMER_GESTURE_CONFIG) private _config: HammerGestureConfig, private console: Console, - @Optional() @Inject(HAMMER_LOADER) private loader?: HammerLoader) { + @Optional() @Inject(HAMMER_LOADER) private loader?: HammerLoader|null) { super(doc); } diff --git a/tools/public_api_guard/platform-browser/platform-browser.d.ts b/tools/public_api_guard/platform-browser/platform-browser.d.ts index d56b6164c4..e1c07cbe9b 100644 --- a/tools/public_api_guard/platform-browser/platform-browser.d.ts +++ b/tools/public_api_guard/platform-browser/platform-browser.d.ts @@ -67,7 +67,7 @@ export declare class HammerGestureConfig { buildHammer(element: HTMLElement): HammerInstance; } -export declare type HammerLoader = (() => Promise) | null; +export declare type HammerLoader = () => Promise; /** @experimental */ export declare function makeStateKey(key: string): StateKey;