mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(ts): fix noImplicitAny errors
This commit is contained in:
@@ -183,7 +183,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
private _addProp(state: string, prop: string, val: any): EffectProperty {
|
||||
let fxProp = this._getProp(prop);
|
||||
let fxProp: any = this._getProp(prop);
|
||||
|
||||
if (!fxProp) {
|
||||
// first time we've see this EffectProperty
|
||||
@@ -636,7 +636,7 @@ export class Animation {
|
||||
if (this._rv) {
|
||||
stepValue = ((stepValue * -1) + 1);
|
||||
}
|
||||
var i, j;
|
||||
var i: number, j: number;
|
||||
var finalTransform: string = '';
|
||||
var elements = this._e;
|
||||
for (i = 0; i < effects.length; i++) {
|
||||
@@ -678,7 +678,7 @@ export class Animation {
|
||||
} else {
|
||||
for (j = 0; j < nuElements; j++) {
|
||||
// ******** DOM WRITE ****************
|
||||
elements[j].style[prop] = val;
|
||||
(<any>elements[j].style)[prop] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -694,7 +694,7 @@ export class Animation {
|
||||
var cssTransform = CSS.transform;
|
||||
for (i = 0; i < elements.length; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
elements[i].style[cssTransform] = finalTransform;
|
||||
(<any>elements[i].style)[cssTransform] = finalTransform;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -718,7 +718,7 @@ export class Animation {
|
||||
const cssTransitionDuration = CSS.transitionDuration;
|
||||
const cssTransitionTimingFn = CSS.transitionTimingFn;
|
||||
|
||||
let eleStyle;
|
||||
let eleStyle: any;
|
||||
for (var i = 0; i < this._eL; i++) {
|
||||
eleStyle = elements[i].style;
|
||||
if (dur > 0) {
|
||||
@@ -783,7 +783,7 @@ export class Animation {
|
||||
|
||||
let ele: HTMLElement;
|
||||
let eleClassList: DOMTokenList;
|
||||
let prop;
|
||||
let prop: string;
|
||||
for (i = 0; i < this._eL; i++) {
|
||||
ele = this._e[i];
|
||||
eleClassList = ele.classList;
|
||||
|
||||
@@ -49,7 +49,7 @@ export class IonicApp extends Ion implements OnInit {
|
||||
super(config, elementRef, renderer);
|
||||
// register with App that this is Ionic's appRoot component. tada!
|
||||
app._appRoot = this;
|
||||
this._stopScrollPlugin = window['IonicStopScroll'];
|
||||
this._stopScrollPlugin = (<any>window)['IonicStopScroll'];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -80,8 +80,8 @@ export class App {
|
||||
runInDev(() => {
|
||||
// During developement, navPop can be triggered by calling
|
||||
// window.ClickBackButton();
|
||||
if (!window['HWBackButton']) {
|
||||
window['HWBackButton'] = () => {
|
||||
if (!(<any>window)['HWBackButton']) {
|
||||
(<any>window)['HWBackButton'] = () => {
|
||||
let p = this.goBack();
|
||||
p && p.catch(() => console.debug('hardware go back cancelled'));
|
||||
};
|
||||
|
||||
@@ -777,7 +777,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
assert(fixedTop >= 0, 'fixedTop has to be positive');
|
||||
|
||||
// ******** DOM WRITE ****************
|
||||
scrollEle.style[topProperty] = cssFormat(this._cTop);
|
||||
(<any>scrollEle.style)[topProperty] = cssFormat(this._cTop);
|
||||
// ******** DOM WRITE ****************
|
||||
fixedEle.style.marginTop = cssFormat(fixedTop);
|
||||
|
||||
@@ -790,7 +790,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
assert(fixedBottom >= 0, 'fixedBottom has to be positive');
|
||||
|
||||
// ******** DOM WRITE ****************
|
||||
scrollEle.style[bottomProperty] = cssFormat(this._cBottom);
|
||||
(<any>scrollEle.style)[bottomProperty] = cssFormat(this._cBottom);
|
||||
// ******** DOM WRITE ****************
|
||||
fixedEle.style.marginBottom = cssFormat(fixedBottom);
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@ import { PointerCoordinates } from '../../util/dom';
|
||||
|
||||
export abstract class ActivatorBase {
|
||||
|
||||
abstract clickAction(ev, activatableEle: HTMLElement, startCoord: PointerCoordinates);
|
||||
abstract clickAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates): void;
|
||||
|
||||
abstract downAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates);
|
||||
abstract downAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates): void;
|
||||
|
||||
abstract upAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates);
|
||||
abstract upAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates): void;
|
||||
|
||||
abstract clearState(animated: boolean);
|
||||
abstract clearState(animated: boolean): void;
|
||||
}
|
||||
|
||||
export function isActivatedDisabled(ev: any, activatableEle: any): boolean {
|
||||
|
||||
@@ -103,7 +103,7 @@ export class Activator implements ActivatorBase {
|
||||
|
||||
this._queue.length = 0;
|
||||
|
||||
let ele;
|
||||
let ele: HTMLElement;
|
||||
for (var i = 0; i < this._active.length; i++) {
|
||||
ele = this._active[i];
|
||||
if (!animated) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
|
||||
export interface Debouncer {
|
||||
debounce(Function);
|
||||
cancel();
|
||||
debounce(callback: Function): void;
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
export class TimeoutDebouncer implements Debouncer {
|
||||
|
||||
@@ -88,14 +88,14 @@ export class DomController {
|
||||
const self = this;
|
||||
if (!self.q) {
|
||||
self.q = true;
|
||||
nativeRaf(function rafCallback(timeStamp) {
|
||||
nativeRaf(function rafCallback(timeStamp: number) {
|
||||
self.flush(timeStamp);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected flush(timeStamp: number) {
|
||||
let err;
|
||||
let err: any;
|
||||
|
||||
try {
|
||||
dispatch(timeStamp, this.r, this.w);
|
||||
@@ -117,7 +117,7 @@ export class DomController {
|
||||
}
|
||||
|
||||
function dispatch(timeStamp: number, r: Function[], w: Function[]) {
|
||||
let task;
|
||||
let task: Function;
|
||||
|
||||
// ******** DOM READS ****************
|
||||
while (task = r.shift()) {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
const win: any = window;
|
||||
|
||||
// RequestAnimationFrame Polyfill (Android 4.3 and below)
|
||||
/*! @author Paul Irish */
|
||||
/*! @source https://gist.github.com/paulirish/1579671 */
|
||||
(function() {
|
||||
var rafLastTime = 0;
|
||||
const win: any = window;
|
||||
if (!win.requestAnimationFrame) {
|
||||
win.requestAnimationFrame = function(callback: Function) {
|
||||
var currTime = Date.now();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - rafLastTime));
|
||||
|
||||
var id = window.setTimeout(function() {
|
||||
var id = win.setTimeout(function() {
|
||||
callback(currTime + timeToCall);
|
||||
}, timeToCall);
|
||||
|
||||
@@ -25,16 +25,16 @@
|
||||
})();
|
||||
|
||||
// use native raf rather than the zone wrapped one
|
||||
let originalRaf = (window[window['Zone']['__symbol__']('requestAnimationFrame')] || window[window['Zone']['__symbol__']('webkitRequestAnimationFrame')]);
|
||||
const originalRaf = (win[win['Zone']['__symbol__']('requestAnimationFrame')] || win[win['Zone']['__symbol__']('webkitRequestAnimationFrame')]);
|
||||
// if the originalRaf from the Zone symbol is not available, we need to provide the polyfilled version
|
||||
export const nativeRaf = originalRaf !== undefined ? originalRaf['bind'](window) : window.requestAnimationFrame.bind(window);
|
||||
export const nativeRaf = originalRaf !== undefined ? originalRaf['bind'](win) : win.requestAnimationFrame.bind(win);
|
||||
|
||||
// zone wrapped raf
|
||||
export const raf = window.requestAnimationFrame.bind(window);
|
||||
export const cancelRaf = window.cancelAnimationFrame.bind(window);
|
||||
export const raf = win.requestAnimationFrame.bind(win);
|
||||
export const cancelRaf = win.cancelAnimationFrame.bind(win);
|
||||
|
||||
export const nativeTimeout = window[window['Zone']['__symbol__']('setTimeout')]['bind'](window);
|
||||
export const clearNativeTimeout = window[window['Zone']['__symbol__']('clearTimeout')]['bind'](window);
|
||||
export const nativeTimeout = win[win['Zone']['__symbol__']('setTimeout')]['bind'](win);
|
||||
export const clearNativeTimeout = win[win['Zone']['__symbol__']('clearTimeout')]['bind'](win);
|
||||
|
||||
/**
|
||||
* Run a function in an animation frame after waiting `framesToWait` frames.
|
||||
@@ -176,14 +176,14 @@ export function ready(callback?: Function) {
|
||||
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', completed, false);
|
||||
window.addEventListener('load', completed, false);
|
||||
win.addEventListener('load', completed, false);
|
||||
}
|
||||
|
||||
return promise;
|
||||
|
||||
function completed() {
|
||||
document.removeEventListener('DOMContentLoaded', completed, false);
|
||||
window.removeEventListener('load', completed, false);
|
||||
win.removeEventListener('load', completed, false);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
@@ -201,13 +201,13 @@ export function windowLoad(callback?: Function) {
|
||||
|
||||
} else {
|
||||
|
||||
window.addEventListener('load', completed, false);
|
||||
win.addEventListener('load', completed, false);
|
||||
}
|
||||
|
||||
return promise;
|
||||
|
||||
function completed() {
|
||||
window.removeEventListener('load', completed, false);
|
||||
win.removeEventListener('load', completed, false);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
@@ -318,10 +318,10 @@ export function clearDimensions(id: string) {
|
||||
export function windowDimensions(): {width: number, height: number} {
|
||||
if (!dimensionCache.win) {
|
||||
// make sure we got good values before caching
|
||||
if (window.innerWidth && window.innerHeight) {
|
||||
if (win.innerWidth && win.innerHeight) {
|
||||
dimensionCache.win = {
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight
|
||||
width: win.innerWidth,
|
||||
height: win.innerHeight
|
||||
};
|
||||
} else {
|
||||
// do not cache bad values
|
||||
|
||||
@@ -139,16 +139,16 @@ export function setupEvents(platform: Platform, dom: DomController): Events {
|
||||
scroll.init(contentEle, 0, 0);
|
||||
// We need to stop scrolling if it's happening and scroll up
|
||||
|
||||
contentEle.style['WebkitBackfaceVisibility'] = 'hidden';
|
||||
contentEle.style['WebkitTransform'] = 'translate3d(0,0,0)';
|
||||
(<any>contentEle.style)['WebkitBackfaceVisibility'] = 'hidden';
|
||||
(<any>contentEle.style)['WebkitTransform'] = 'translate3d(0,0,0)';
|
||||
|
||||
nativeRaf(function() {
|
||||
contentEle.style.overflow = 'hidden';
|
||||
|
||||
function finish() {
|
||||
contentEle.style.overflow = '';
|
||||
contentEle.style['WebkitBackfaceVisibility'] = '';
|
||||
contentEle.style['WebkitTransform'] = '';
|
||||
(<any>contentEle.style)['WebkitBackfaceVisibility'] = '';
|
||||
(<any>contentEle.style)['WebkitTransform'] = '';
|
||||
}
|
||||
|
||||
let didScrollTimeout = setTimeout(() => {
|
||||
|
||||
@@ -58,7 +58,7 @@ export class Form {
|
||||
|
||||
export abstract class IonicTapInput implements IonicFormInput {
|
||||
|
||||
abstract initFocus();
|
||||
abstract initFocus(): void;
|
||||
|
||||
abstract get checked(): boolean;
|
||||
|
||||
@@ -72,6 +72,6 @@ export abstract class IonicTapInput implements IonicFormInput {
|
||||
|
||||
export abstract class IonicFormInput {
|
||||
|
||||
abstract initFocus();
|
||||
abstract initFocus(): void;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
import { Platform } from '../platform/platform';
|
||||
|
||||
declare var window;
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name Haptic
|
||||
|
||||
@@ -477,7 +477,7 @@ export class ScrollView {
|
||||
self.isScrolling = true;
|
||||
|
||||
// chill out for a frame first
|
||||
rafFrames(2, (timeStamp) => {
|
||||
rafFrames(2, (timeStamp: number) => {
|
||||
startTime = timeStamp;
|
||||
step(timeStamp);
|
||||
});
|
||||
@@ -537,7 +537,7 @@ export interface ScrollEvent {
|
||||
velocityX: number;
|
||||
directionY: string;
|
||||
directionX: string;
|
||||
domWrite: {(fn: DomCallback, ctx?: any)};
|
||||
domWrite: {(fn: DomCallback, ctx?: any): void};
|
||||
contentElement?: HTMLElement;
|
||||
fixedElement?: HTMLElement;
|
||||
scrollElement?: HTMLElement;
|
||||
|
||||
Reference in New Issue
Block a user