Skip to content

Commit 0174fa9

Browse files
authored
fix: correct EventEmitter generic type across lib (#1620)
1 parent aff22e5 commit 0174fa9

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/lib/core/a11y/list-key-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class ListKeyManager {
2121
* This event is emitted any time the TAB key is pressed, so components can react
2222
* when focus is shifted off of the list.
2323
*/
24-
@Output() tabOut: EventEmitter<null> = new EventEmitter();
24+
@Output() tabOut = new EventEmitter<void>();
2525

2626
constructor(private _items: QueryList<MdFocusable>) {}
2727

@@ -35,7 +35,7 @@ export class ListKeyManager {
3535
} else if (event.keyCode === UP_ARROW) {
3636
this._focusPreviousItem();
3737
} else if (event.keyCode === TAB) {
38-
this.tabOut.emit(null);
38+
this.tabOut.emit();
3939
}
4040
}
4141

src/lib/core/overlay/overlay-directives.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class ConnectedOverlayDirective implements OnDestroy {
9898
}
9999

100100
/** Event emitted when the backdrop is clicked. */
101-
@Output() backdropClick: EventEmitter<null> = new EventEmitter();
101+
@Output() backdropClick = new EventEmitter<void>();
102102

103103
// TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
104104

@@ -178,7 +178,7 @@ export class ConnectedOverlayDirective implements OnDestroy {
178178

179179
if (this.hasBackdrop) {
180180
this._backdropSubscription = this._overlayRef.backdropClick().subscribe(() => {
181-
this.backdropClick.emit(null);
181+
this.backdropClick.emit();
182182
});
183183
}
184184
}

src/lib/core/rtl/dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class Dir {
3434
let old = this._dir;
3535
this._dir = v;
3636
if (old != this._dir) {
37-
this.dirChange.emit(null);
37+
this.dirChange.emit();
3838
}
3939
}
4040

src/lib/menu/menu-directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class MdMenu {
6363
}, {});
6464
}
6565

66-
@Output() close = new EventEmitter;
66+
@Output() close = new EventEmitter<void>();
6767

6868
/**
6969
* Focus the first item in the menu. This method is used by the menu trigger
@@ -80,7 +80,7 @@ export class MdMenu {
8080
* trigger will close the menu.
8181
*/
8282
private _emitCloseEvent(): void {
83-
this.close.emit(null);
83+
this.close.emit();
8484
}
8585

8686
private _setPositionX(pos: MenuPositionX): void {

src/lib/menu/menu-trigger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export class MdMenuTrigger implements AfterViewInit, OnDestroy {
4848
private _openedFromKeyboard: boolean = false;
4949

5050
@Input('md-menu-trigger-for') menu: MdMenu;
51-
@Output() onMenuOpen = new EventEmitter();
52-
@Output() onMenuClose = new EventEmitter();
51+
@Output() onMenuOpen = new EventEmitter<void>();
52+
@Output() onMenuClose = new EventEmitter<void>();
5353

5454
constructor(private _overlay: Overlay, private _element: ElementRef,
5555
private _viewContainerRef: ViewContainerRef, private _renderer: Renderer) {}
@@ -140,7 +140,7 @@ export class MdMenuTrigger implements AfterViewInit, OnDestroy {
140140
// set state rather than toggle to support triggers sharing a menu
141141
private _setIsMenuOpen(isOpen: boolean): void {
142142
this._menuOpen = isOpen;
143-
this._menuOpen ? this.onMenuOpen.emit(null) : this.onMenuClose.emit(null);
143+
this._menuOpen ? this.onMenuOpen.emit() : this.onMenuClose.emit();
144144
}
145145

146146
/**

src/lib/sidenav/sidenav.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ export class MdSidenav {
117117
this._transition = true;
118118

119119
if (isOpen) {
120-
this.onOpenStart.emit(null);
120+
this.onOpenStart.emit();
121121
} else {
122-
this.onCloseStart.emit(null);
122+
this.onCloseStart.emit();
123123
}
124124

125125
if (isOpen) {
@@ -160,7 +160,7 @@ export class MdSidenav {
160160
this._closePromiseReject();
161161
}
162162

163-
this.onOpen.emit(null);
163+
this.onOpen.emit();
164164
} else {
165165
if (this._closePromise != null) {
166166
this._closePromiseResolve();
@@ -169,7 +169,7 @@ export class MdSidenav {
169169
this._openPromiseReject();
170170
}
171171

172-
this.onClose.emit(null);
172+
this.onClose.emit();
173173
}
174174

175175
this._openPromise = null;

0 commit comments

Comments
 (0)