chore(tslint): fix noImplicitAny errors

This commit is contained in:
Adam Bradley
2016-05-31 18:40:29 -05:00
parent f14e2dc04b
commit 03f4511635
21 changed files with 92 additions and 93 deletions

View File

@ -5,7 +5,7 @@ import {defaults} from '../util';
export class DragGesture extends Gesture {
public dragging: boolean;
constructor(element, opts = {}) {
constructor(element: HTMLElement, opts = {}) {
defaults(opts, {});
super(element, opts);
}
@ -13,20 +13,20 @@ export class DragGesture extends Gesture {
listen() {
super.listen();
this.on('panstart', ev => {
this.on('panstart', (ev: UIEvent) => {
if (this.onDragStart(ev) !== false) {
this.dragging = true;
}
});
this.on('panmove', ev => {
this.on('panmove', (ev: UIEvent) => {
if (!this.dragging) return;
if (this.onDrag(ev) === false) {
this.dragging = false;
}
});
this.on('panend', ev => {
this.on('panend', (ev: UIEvent) => {
if (!this.dragging) return;
this.onDragEnd(ev);
this.dragging = false;

View File

@ -16,7 +16,7 @@ export class Gesture {
public direction: string;
public isListening: boolean = false;
constructor(element, opts: any = {}) {
constructor(element: HTMLElement, opts: any = {}) {
defaults(opts, {
domEvents: true
});
@ -55,11 +55,13 @@ export class Gesture {
}
unlisten() {
var type, i;
let eventType: string;
let i: number;
if (this._hammer && this.isListening) {
for (type in this._callbacks) {
for (i = 0; i < this._callbacks[type].length; i++) {
this._hammer.off(type, this._callbacks[type]);
for (eventType in this._callbacks) {
for (i = 0; i < this._callbacks[eventType].length; i++) {
this._hammer.off(eventType, this._callbacks[eventType]);
}
}
this._hammer.destroy();

View File

@ -33,7 +33,7 @@ export class SlideEdgeGesture extends SlideGesture {
};
}
_checkEdge(edge, pos) {
_checkEdge(edge: string, pos: any) {
switch (edge) {
case 'left': return pos.x <= this._d.left + this.maxEdgeStart;
case 'right': return pos.x >= this._d.width - this.maxEdgeStart;

View File

@ -5,7 +5,7 @@ import {clamp} from '../util';
export class SlideGesture extends DragGesture {
public slide: SlideData = null;
constructor(element, opts = {}) {
constructor(element: HTMLElement, opts = {}) {
super(element, opts);
this.element = element;
}