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'));
|
.pipe(gulp.dest('./dist'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('lint', tslint);
|
gulp.task('lint', function() {
|
||||||
|
tslint({src: 'src/**/*.ts'});
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('plugin:create', function(){
|
gulp.task('plugin:create', function(){
|
||||||
if(flags.n && flags.n !== ''){
|
if(flags.n && flags.n !== ''){
|
||||||
|
@ -106,8 +106,9 @@ export class ThreeDeeTouch {
|
|||||||
*/
|
*/
|
||||||
static onHomeIconPressed(): Observable<any> {
|
static onHomeIconPressed(): Observable<any> {
|
||||||
return new Observable(observer => {
|
return new Observable(observer => {
|
||||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) {
|
||||||
else {
|
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||||
|
} else {
|
||||||
observer.error('3dTouch plugin is not available.');
|
observer.error('3dTouch plugin is not available.');
|
||||||
observer.complete();
|
observer.complete();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { Cordova, Plugin } from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
|
|
||||||
|
|
||||||
declare var window;
|
declare var window;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ export class CameraPreview {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void {
|
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,4 +31,4 @@ export class Crop {
|
|||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
static crop(pathToImage: string, options?: {quality: number}): Promise<string> {return; }
|
static crop(pathToImage: string, options?: {quality: number}): Promise<string> {return; }
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,23 @@ export class EmailComposer {
|
|||||||
*/
|
*/
|
||||||
static isAvailable(app?: string): Promise<any> {
|
static isAvailable(app?: string): Promise<any> {
|
||||||
return new Promise<boolean>((resolve, reject) => {
|
return new Promise<boolean>((resolve, reject) => {
|
||||||
if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); });
|
if (app) {
|
||||||
else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); });
|
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)
|
return File.resolveDirectoryUrl(path)
|
||||||
.then((fse) => {
|
.then((fse) => {
|
||||||
return File.getFile(fse, fileName, opts);
|
return File.getFile(fse, fileName, opts);
|
||||||
|
@ -204,8 +204,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsMarker>(
|
return new Promise<GoogleMapsMarker>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addMarker(options, (marker: any) => {
|
this._objectInstance.addMarker(options, (marker: any) => {
|
||||||
if (marker) resolve(new GoogleMapsMarker(marker));
|
if (marker) {
|
||||||
else reject();
|
resolve(new GoogleMapsMarker(marker));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -215,8 +218,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsCircle>(
|
return new Promise<GoogleMapsCircle>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addCircle(options, (circle: any) => {
|
this._objectInstance.addCircle(options, (circle: any) => {
|
||||||
if (circle) resolve(new GoogleMapsCircle(circle));
|
if (circle) {
|
||||||
else reject();
|
resolve(new GoogleMapsCircle(circle));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -226,8 +232,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsPolygon>(
|
return new Promise<GoogleMapsPolygon>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addPolygon(options, (polygon: any) => {
|
this._objectInstance.addPolygon(options, (polygon: any) => {
|
||||||
if (polygon) resolve(new GoogleMapsPolygon(polygon));
|
if (polygon) {
|
||||||
else reject();
|
resolve(new GoogleMapsPolygon(polygon));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -237,8 +246,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsPolyline>(
|
return new Promise<GoogleMapsPolyline>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addPolyline(options, (polyline: any) => {
|
this._objectInstance.addPolyline(options, (polyline: any) => {
|
||||||
if (polyline) resolve(new GoogleMapsPolyline(polyline));
|
if (polyline) {
|
||||||
else reject();
|
resolve(new GoogleMapsPolyline(polyline));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -248,8 +260,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsTileOverlay>(
|
return new Promise<GoogleMapsTileOverlay>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addTileOverlay(options, (tileOverlay: any) => {
|
this._objectInstance.addTileOverlay(options, (tileOverlay: any) => {
|
||||||
if (tileOverlay) resolve(new GoogleMapsTileOverlay(tileOverlay));
|
if (tileOverlay) {
|
||||||
else reject();
|
resolve(new GoogleMapsTileOverlay(tileOverlay));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -259,8 +274,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsGroundOverlay>(
|
return new Promise<GoogleMapsGroundOverlay>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => {
|
this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => {
|
||||||
if (groundOverlay) resolve(new GoogleMapsGroundOverlay(groundOverlay));
|
if (groundOverlay) {
|
||||||
else reject();
|
resolve(new GoogleMapsGroundOverlay(groundOverlay));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -270,8 +288,11 @@ export class GoogleMap {
|
|||||||
return new Promise<GoogleMapsKmlOverlay>(
|
return new Promise<GoogleMapsKmlOverlay>(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
this._objectInstance.addKmlOverlay(options, (kmlOverlay: any) => {
|
this._objectInstance.addKmlOverlay(options, (kmlOverlay: any) => {
|
||||||
if (kmlOverlay) resolve(new GoogleMapsKmlOverlay(kmlOverlay));
|
if (kmlOverlay) {
|
||||||
else reject();
|
resolve(new GoogleMapsKmlOverlay(kmlOverlay));
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -1047,7 +1068,7 @@ export interface GeocoderResult {
|
|||||||
permises?: string;
|
permises?: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
url?: string
|
url?: string
|
||||||
},
|
};
|
||||||
locale?: string;
|
locale?: string;
|
||||||
locality?: string;
|
locality?: string;
|
||||||
position?: { lat: number; lng: number };
|
position?: { lat: number; lng: number };
|
||||||
|
@ -29,7 +29,7 @@ export class Instagram {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
callbackStyle: 'node'
|
callbackStyle: 'node'
|
||||||
})
|
})
|
||||||
static isInstalled(): Promise<boolean|string> {return;}
|
static isInstalled(): Promise<boolean|string> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Share an image on Instagram
|
* Share an image on Instagram
|
||||||
@ -42,7 +42,7 @@ export class Instagram {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
callbackStyle: 'node'
|
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
|
* Share a library asset or video
|
||||||
@ -52,6 +52,6 @@ export class Instagram {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
static shareAsset(assetLocalIdentifier: string): Promise<any> {return;}
|
static shareAsset(assetLocalIdentifier: string): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
|
|
||||||
declare var Media: any;
|
declare var Media: any;
|
||||||
|
|
||||||
export interface MediaError {
|
export interface MediaError {
|
||||||
code: number;
|
code: number;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
@ -83,12 +83,12 @@ export class MediaPlugin {
|
|||||||
static MEDIA_PAUSED: number = 3;
|
static MEDIA_PAUSED: number = 3;
|
||||||
static MEDIA_STOPPED: number = 4;
|
static MEDIA_STOPPED: number = 4;
|
||||||
|
|
||||||
//error codes
|
// error codes
|
||||||
static MEDIA_ERR_ABORTED: number = 1;
|
static MEDIA_ERR_ABORTED: number = 1;
|
||||||
static MEDIA_ERR_NETWORK: number = 2;
|
static MEDIA_ERR_NETWORK: number = 2;
|
||||||
static MEDIA_ERR_DECODE: number = 3;
|
static MEDIA_ERR_DECODE: number = 3;
|
||||||
static MEDIA_ERR_NONE_SUPPORTED: number = 4;
|
static MEDIA_ERR_NONE_SUPPORTED: number = 4;
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
private _objectInstance: any;
|
private _objectInstance: any;
|
||||||
status: Observable<any>;
|
status: Observable<any>;
|
||||||
@ -199,4 +199,4 @@ export class MediaPlugin {
|
|||||||
})
|
})
|
||||||
stop(): void { }
|
stop(): void { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -251,4 +251,4 @@ export class OneSignal {
|
|||||||
visualLevel: number
|
visualLevel: number
|
||||||
}): void { }
|
}): void { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// 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) {
|
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 {
|
} 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 {
|
} else {
|
||||||
// Otherwise, let's tack them on to the end of the argument list
|
// 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;
|
declare var navigator: any;
|
||||||
|
@ -51,7 +51,7 @@ export class TwitterConnect {
|
|||||||
* @return {Promise<any>} returns a promise that resolves if user profile is successfully retrieved and rejects if request fails
|
* @return {Promise<any>} returns a promise that resolves if user profile is successfully retrieved and rejects if request fails
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static showUser(): Promise<any> {return; }
|
static showUser(): Promise<any> {return; }
|
||||||
}
|
}
|
||||||
export interface TwitterConnectResponse {
|
export interface TwitterConnectResponse {
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +92,7 @@ export interface CreateThumbnailOptions {
|
|||||||
export interface GetVideoInfoOptions {
|
export interface GetVideoInfoOptions {
|
||||||
|
|
||||||
/** The path to the video on the device. */
|
/** The path to the video on the device. */
|
||||||
fileUri: string
|
fileUri: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,4 +59,4 @@ export class VideoPlayer {
|
|||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
static close(): void { }
|
static close(): void { }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user