Add typedef tslint rule

This commit is contained in:
Daniel Imms
2017-08-05 13:56:38 -07:00
parent aee474b53e
commit f9fce53cc4
17 changed files with 230 additions and 250 deletions
+8 -8
View File
@@ -7,7 +7,7 @@ import * as Browser from './utils/Browser';
import { CharMeasure } from './utils/CharMeasure';
import { CircularList } from './utils/CircularList';
import { EventEmitter } from './EventEmitter';
import { ITerminal, ICircularList } from './Interfaces';
import { ITerminal, ICircularList, ISelectionManager } from './Interfaces';
import { SelectionModel } from './SelectionModel';
import { translateBufferLineToString } from './utils/BufferLine';
@@ -66,7 +66,7 @@ enum SelectionMode {
* not handled by the SelectionManager but a 'refresh' event is fired when the
* selection is ready to be redrawn.
*/
export class SelectionManager extends EventEmitter {
export class SelectionManager extends EventEmitter implements ISelectionManager {
protected _model: SelectionModel;
/**
@@ -116,7 +116,7 @@ export class SelectionManager extends EventEmitter {
/**
* Initializes listener variables.
*/
private _initListeners() {
private _initListeners(): void {
this._mouseMoveListener = event => this._onMouseMove(<MouseEvent>event);
this._mouseUpListener = event => this._onMouseUp(<MouseEvent>event);
@@ -267,7 +267,7 @@ export class SelectionManager extends EventEmitter {
* Handle the buffer being trimmed, adjust the selection position.
* @param amount The amount the buffer is being trimmed.
*/
private _onTrim(amount: number) {
private _onTrim(amount: number): void {
const needsRefresh = this._model.onTrim(amount);
if (needsRefresh) {
this.refresh();
@@ -316,7 +316,7 @@ export class SelectionManager extends EventEmitter {
* Handles te mousedown event, setting up for a new selection.
* @param event The mousedown event.
*/
private _onMouseDown(event: MouseEvent) {
private _onMouseDown(event: MouseEvent): void {
// If we have selection, we want the context menu on right click even if the
// terminal is in mouse mode.
if (event.button === 2 && this.hasSelection) {
@@ -455,7 +455,7 @@ export class SelectionManager extends EventEmitter {
* end of the selection and refreshing the selection.
* @param event The mousemove event.
*/
private _onMouseMove(event: MouseEvent) {
private _onMouseMove(event: MouseEvent): void {
// Record the previous position so we know whether to redraw the selection
// at the end.
const previousSelectionEnd = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;
@@ -511,7 +511,7 @@ export class SelectionManager extends EventEmitter {
* The callback that occurs every DRAG_SCROLL_INTERVAL ms that does the
* scrolling of the viewport.
*/
private _dragScroll() {
private _dragScroll(): void {
if (this._dragScrollAmount) {
this._terminal.scrollDisp(this._dragScrollAmount, false);
// Re-evaluate selection
@@ -528,7 +528,7 @@ export class SelectionManager extends EventEmitter {
* Handles the mouseup event, removing the mousedown listeners.
* @param event The mouseup event.
*/
private _onMouseUp(event: MouseEvent) {
private _onMouseUp(event: MouseEvent): void {
this._removeMouseDownListeners();
}