chore(): tslint (#466)
* fix src tslint gulp ionic * - fix errors tslint
This commit is contained in:
parent
16628a49f7
commit
ed8c67ce7e
@ -27,7 +27,9 @@ gulp.task("minify:dist", function(){
|
||||
.pipe(gulp.dest('./dist'));
|
||||
});
|
||||
|
||||
gulp.task('lint', tslint);
|
||||
gulp.task('lint', function() {
|
||||
tslint({src: 'src/**/*.ts'});
|
||||
});
|
||||
|
||||
gulp.task('plugin:create', function(){
|
||||
if(flags.n && flags.n !== ''){
|
||||
|
@ -106,8 +106,9 @@ export class ThreeDeeTouch {
|
||||
*/
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
else {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) {
|
||||
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
} else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
|
@ -59,8 +59,23 @@ export class EmailComposer {
|
||||
*/
|
||||
static isAvailable(app?: string): Promise<any> {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); });
|
||||
else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); });
|
||||
if (app) {
|
||||
cordova.plugins.email.isAvailable(app, (isAvailable) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cordova.plugins.email.isAvailable((isAvailable) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -676,10 +676,6 @@ export class File {
|
||||
}
|
||||
}
|
||||
|
||||
let cflags: Flags = {
|
||||
create: true
|
||||
};
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
.then((fse) => {
|
||||
return File.getFile(fse, fileName, opts);
|
||||
|
@ -204,8 +204,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsMarker>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addMarker(options, (marker: any) => {
|
||||
if (marker) resolve(new GoogleMapsMarker(marker));
|
||||
else reject();
|
||||
if (marker) {
|
||||
resolve(new GoogleMapsMarker(marker));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -215,8 +218,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsCircle>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addCircle(options, (circle: any) => {
|
||||
if (circle) resolve(new GoogleMapsCircle(circle));
|
||||
else reject();
|
||||
if (circle) {
|
||||
resolve(new GoogleMapsCircle(circle));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -226,8 +232,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsPolygon>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addPolygon(options, (polygon: any) => {
|
||||
if (polygon) resolve(new GoogleMapsPolygon(polygon));
|
||||
else reject();
|
||||
if (polygon) {
|
||||
resolve(new GoogleMapsPolygon(polygon));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -237,8 +246,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsPolyline>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addPolyline(options, (polyline: any) => {
|
||||
if (polyline) resolve(new GoogleMapsPolyline(polyline));
|
||||
else reject();
|
||||
if (polyline) {
|
||||
resolve(new GoogleMapsPolyline(polyline));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -248,8 +260,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsTileOverlay>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addTileOverlay(options, (tileOverlay: any) => {
|
||||
if (tileOverlay) resolve(new GoogleMapsTileOverlay(tileOverlay));
|
||||
else reject();
|
||||
if (tileOverlay) {
|
||||
resolve(new GoogleMapsTileOverlay(tileOverlay));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -259,8 +274,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsGroundOverlay>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => {
|
||||
if (groundOverlay) resolve(new GoogleMapsGroundOverlay(groundOverlay));
|
||||
else reject();
|
||||
if (groundOverlay) {
|
||||
resolve(new GoogleMapsGroundOverlay(groundOverlay));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -270,8 +288,11 @@ export class GoogleMap {
|
||||
return new Promise<GoogleMapsKmlOverlay>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addKmlOverlay(options, (kmlOverlay: any) => {
|
||||
if (kmlOverlay) resolve(new GoogleMapsKmlOverlay(kmlOverlay));
|
||||
else reject();
|
||||
if (kmlOverlay) {
|
||||
resolve(new GoogleMapsKmlOverlay(kmlOverlay));
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -1047,7 +1068,7 @@ export interface GeocoderResult {
|
||||
permises?: string;
|
||||
phone?: string;
|
||||
url?: string
|
||||
},
|
||||
};
|
||||
locale?: string;
|
||||
locality?: string;
|
||||
position?: { lat: number; lng: number };
|
||||
|
@ -29,7 +29,7 @@ export class Instagram {
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
static isInstalled(): Promise<boolean|string> {return;}
|
||||
static isInstalled(): Promise<boolean|string> { return; }
|
||||
|
||||
/**
|
||||
* Share an image on Instagram
|
||||
@ -42,7 +42,7 @@ export class Instagram {
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
static share(canvasIdOrDataUrl: string, caption?: string): Promise<any> {return;}
|
||||
static share(canvasIdOrDataUrl: string, caption?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Share a library asset or video
|
||||
@ -52,6 +52,6 @@ export class Instagram {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static shareAsset(assetLocalIdentifier: string): Promise<any> {return;}
|
||||
static shareAsset(assetLocalIdentifier: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ export class MediaPlugin {
|
||||
static MEDIA_PAUSED: number = 3;
|
||||
static MEDIA_STOPPED: number = 4;
|
||||
|
||||
//error codes
|
||||
// error codes
|
||||
static MEDIA_ERR_ABORTED: number = 1;
|
||||
static MEDIA_ERR_NETWORK: number = 2;
|
||||
static MEDIA_ERR_DECODE: number = 3;
|
||||
|
@ -62,9 +62,9 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
|
||||
|
||||
// We don't want that the reject cb gets spliced into the position of an optional argument that has not been defined and thus causing non expected behaviour.
|
||||
if (opts.errorIndex > args.length) {
|
||||
args[opts.errorIndex] = reject; //insert the reject fn at the correct specific index
|
||||
args[opts.errorIndex] = reject; // insert the reject fn at the correct specific index
|
||||
} else {
|
||||
args.splice(opts.errorIndex, 0, reject); //otherwise just splice it into the array
|
||||
args.splice(opts.errorIndex, 0, reject); // otherwise just splice it into the array
|
||||
}
|
||||
} else {
|
||||
// Otherwise, let's tack them on to the end of the argument list
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
@ -92,7 +92,7 @@ export interface CreateThumbnailOptions {
|
||||
export interface GetVideoInfoOptions {
|
||||
|
||||
/** The path to the video on the device. */
|
||||
fileUri: string
|
||||
fileUri: string;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user