Skip to content

Commit

Permalink
chore(tslint): fix noImplicitAny errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed May 31, 2016
1 parent f14e2dc commit 03f4511
Show file tree
Hide file tree
Showing 21 changed files with 92 additions and 93 deletions.
4 changes: 2 additions & 2 deletions src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class Animation {
_asyncEnd(duration: number, shouldComplete: boolean) {
var self = this;

function onTransitionEnd(ev) {
function onTransitionEnd(ev: any) {
console.debug('Animation onTransitionEnd', ev.target.nodeName, ev.propertyName);

// ensure transition end events and timeouts have been cleared
Expand Down Expand Up @@ -817,7 +817,7 @@ interface EffectState {
unit: string;
}

const TRANSFORMS = {
const TRANSFORMS: any = {
'translateX': 1, 'translateY': 1, 'translateZ': 1,
'scale': 1, 'scaleX': 1, 'scaleY': 1, 'scaleZ': 1,
'rotate': 1, 'rotateX': 1, 'rotateY': 1, 'rotateZ': 1,
Expand Down
8 changes: 4 additions & 4 deletions src/animations/builtins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Animation} from './animation';


class SlideIn extends Animation {
constructor(element) {
constructor(element: any) {
super(element);
this
.easing('cubic-bezier(0.1,0.7,0.1,1)')
Expand All @@ -15,7 +15,7 @@ Animation.register('slide-in', SlideIn);


class SlideOut extends Animation {
constructor(element) {
constructor(element: any) {
super(element);
this
.easing('ease-out')
Expand All @@ -27,7 +27,7 @@ Animation.register('slide-out', SlideOut);


class FadeIn extends Animation {
constructor(element) {
constructor(element: any) {
super(element);
this
.easing('ease-in')
Expand All @@ -39,7 +39,7 @@ Animation.register('fade-in', FadeIn);


class FadeOut extends Animation {
constructor(element) {
constructor(element: any) {
super(element);
this
.easing('ease-out')
Expand Down
10 changes: 5 additions & 5 deletions src/components/action-sheet/action-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ class ActionSheetCmp {

onPageLoaded() {
// normalize the data
let buttons = [];
let buttons: any[] = [];

this.d.buttons.forEach(button => {
this.d.buttons.forEach((button: any) => {
if (typeof button === 'string') {
button = { text: button };
}
Expand Down Expand Up @@ -327,7 +327,7 @@ class ActionSheetCmp {
}
}

click(button, dismissDelay?) {
click(button: any, dismissDelay?: number) {
if (!this.isEnabled()) {
return;
}
Expand Down Expand Up @@ -360,7 +360,7 @@ class ActionSheetCmp {
}
}

dismiss(role): Promise<any> {
dismiss(role: any): Promise<any> {
return this._viewCtrl.dismiss(null, role);
}

Expand All @@ -380,7 +380,7 @@ export interface ActionSheetOptions {


class ActionSheetSlideIn extends Transition {
constructor(enteringView, leavingView, opts: TransitionOptions) {
constructor(enteringView: ViewController, leavingView: ViewController, opts: TransitionOptions) {
super(opts);

let ele = enteringView.pageRef().nativeElement;
Expand Down
16 changes: 5 additions & 11 deletions src/components/alert/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,6 @@ class AlertCmp {
// normalize the data
let data = this.d;

if (data['body']) {
// deprecated warning
console.warn('Alert `body` property has been renamed to `message`');
data.message = data['body'];
}

data.buttons = data.buttons.map(button => {
if (typeof button === 'string') {
return { text: button };
Expand All @@ -451,7 +445,7 @@ class AlertCmp {

// An alert can be created with several different inputs. Radios,
// checkboxes and inputs are all accepted, but they cannot be mixed.
let inputTypes = [];
let inputTypes: any[] = [];
data.inputs.forEach(input => {
if (inputTypes.indexOf(input.type) < 0) {
inputTypes.push(input.type);
Expand Down Expand Up @@ -503,7 +497,7 @@ class AlertCmp {
}
}

btnClick(button, dismissDelay?) {
btnClick(button: any, dismissDelay?: number) {
if (!this.isEnabled()) {
return;
}
Expand All @@ -529,7 +523,7 @@ class AlertCmp {
}
}

rbClick(checkedInput) {
rbClick(checkedInput: any) {
if (this.isEnabled()) {
this.d.inputs.forEach(input => {
input.checked = (checkedInput === input);
Expand All @@ -538,7 +532,7 @@ class AlertCmp {
}
}

cbClick(checkedInput) {
cbClick(checkedInput: any) {
if (this.isEnabled()) {
checkedInput.checked = !checkedInput.checked;
}
Expand All @@ -556,7 +550,7 @@ class AlertCmp {
}
}

dismiss(role): Promise<any> {
dismiss(role: any): Promise<any> {
return this._viewCtrl.dismiss(this.getValues(), role);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class App {
*/
getActiveNav(): any {
var nav = this._rootNav || null;
var activeChildNav;
var activeChildNav: any;

while (nav) {
activeChildNav = nav.getActiveChildNav();
Expand Down
3 changes: 2 additions & 1 deletion src/components/badge/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export class Badge {
*/
private _readAttrs(element: HTMLElement) {
let elementAttrs = element.attributes;
let attrName;
let attrName: string;

for (let i = 0, l = elementAttrs.length; i < l; i++) {
if (elementAttrs[i].value !== '') continue;

Expand Down
10 changes: 5 additions & 5 deletions src/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export class Button {
if (childNodes.length > 0) {
childNodes = childNodes[0].childNodes;
}
let childNode;
let nodes = [];
let childNode: Node;
let nodes: number[] = [];
for (let i = 0, l = childNodes.length; i < l; i++) {
childNode = childNodes[i];

Expand Down Expand Up @@ -274,7 +274,7 @@ export class Button {
*/
private _readAttrs(element: HTMLElement) {
let elementAttrs = element.attributes;
let attrName;
let attrName: string;
for (let i = 0, l = elementAttrs.length; i < l; i++) {
if (elementAttrs[i].value !== '') continue;

Expand Down Expand Up @@ -345,9 +345,9 @@ export class Button {
/**
* @private
*/
static setRoles(contentButtonChildren, role: string) {
static setRoles(contentButtonChildren: any, role: string) {
let buttons = contentButtonChildren.toArray();
buttons.forEach(button => {
buttons.forEach((button: any) => {
button.setRole(role);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class Checkbox {
* @private
*/
@HostListener('click', ['$event'])
private _click(ev) {
private _click(ev: UIEvent) {
console.debug('checkbox, checked');
ev.preventDefault();
ev.stopPropagation();
Expand Down Expand Up @@ -158,7 +158,7 @@ export class Checkbox {
/**
* @private
*/
registerOnTouched(fn) { this.onTouched = fn; }
registerOnTouched(fn: any) { this.onTouched = fn; }

/**
* @input {boolean} whether or not the checkbox is disabled or not.
Expand Down
19 changes: 10 additions & 9 deletions src/components/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,49 +111,49 @@ export class Content extends Ion {
/**
* @private
*/
addScrollListener(handler) {
addScrollListener(handler: any) {
return this._addListener('scroll', handler);
}

/**
* @private
*/
addTouchStartListener(handler) {
addTouchStartListener(handler: any) {
return this._addListener('touchstart', handler);
}

/**
* @private
*/
addTouchMoveListener(handler) {
addTouchMoveListener(handler: any) {
return this._addListener('touchmove', handler);
}

/**
* @private
*/
addTouchEndListener(handler) {
addTouchEndListener(handler: any) {
return this._addListener('touchend', handler);
}

/**
* @private
*/
addMouseDownListener(handler) {
addMouseDownListener(handler: any) {
return this._addListener('mousedown', handler);
}

/**
* @private
*/
addMouseUpListener(handler) {
addMouseUpListener(handler: any) {
return this._addListener('mouseup', handler);
}

/**
* @private
*/
addMouseMoveListener(handler) {
addMouseMoveListener(handler: any) {
return this._addListener('mousemove', handler);
}

Expand All @@ -177,8 +177,8 @@ export class Content extends Ion {
* @param {Function} callback The method you want perform when scrolling has ended
*/
onScrollEnd(callback: Function) {
let lastScrollTop = null;
let framesUnchanged = 0;
let lastScrollTop: number = null;
let framesUnchanged: number = 0;
let _scrollEle = this._scrollEle;

function next() {
Expand All @@ -187,6 +187,7 @@ export class Content extends Ion {

if (Math.round(lastScrollTop) === Math.round(currentScrollTop)) {
framesUnchanged++;

} else {
framesUnchanged = 0;
}
Expand Down
18 changes: 9 additions & 9 deletions src/components/datetime/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class DateTime {
}

@HostListener('click', ['$event'])
private _click(ev) {
private _click(ev: UIEvent) {
if (ev.detail === 0) {
// do not continue if the click event came from a form submit
return;
Expand All @@ -443,8 +443,8 @@ export class DateTime {
this.open();
}

@HostListener('keyup.space', ['$event'])
private _keyup(ev) {
@HostListener('keyup.space')
private _keyup() {
if (!this._isOpen) {
this.open();
}
Expand Down Expand Up @@ -474,7 +474,7 @@ export class DateTime {
},
{
text: this.doneText,
handler: (data) => {
handler: (data: any) => {
console.log('datetime, done', data);
this.onChange(data);
this.ionChange.emit(data);
Expand Down Expand Up @@ -594,7 +594,7 @@ export class DateTime {

// default to assuming this month has 31 days
let numDaysInMonth = 31;
let selectedMonth;
let selectedMonth: number;
if (monthCol) {
monthOpt = monthCol.options[monthCol.selectedIndex];
if (monthOpt) {
Expand Down Expand Up @@ -655,7 +655,7 @@ export class DateTime {
*/
divyColumns(picker: Picker) {
let pickerColumns = picker.getColumns();
let columns = [];
let columns: number[] = [];

pickerColumns.forEach((col, i) => {
columns.push(0);
Expand Down Expand Up @@ -803,7 +803,7 @@ export class DateTime {
/**
* @private
*/
registerOnTouched(fn) { this.onTouched = fn; }
registerOnTouched(fn: any) { this.onTouched = fn; }

/**
* @private
Expand Down Expand Up @@ -845,7 +845,7 @@ function convertToArrayOfNumbers(input: any, type: string): number[] {

if (isArray(input)) {
// ensure each value is an actual number in the returned array
input.forEach(num => {
input.forEach((num: any) => {
num = parseInt(num, 10);
if (!isNaN(num)) {
values.push(num);
Expand Down Expand Up @@ -877,7 +877,7 @@ function convertToArrayOfStrings(input: any, type: string): string[] {

if (isArray(input)) {
// trim up each string value
input.forEach(val => {
input.forEach((val: any) => {
val = val.trim();
if (val) {
values.push(val);
Expand Down
2 changes: 1 addition & 1 deletion src/components/infinite-scroll/infinite-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class InfiniteScroll {
_content.addCssClass('has-infinite-scroll');
}

private _onScroll(ev) {
private _onScroll() {
if (this.state === STATE_LOADING || this.state === STATE_DISABLED) {
return 1;
}
Expand Down
Loading

0 comments on commit 03f4511

Please sign in to comment.