Revert "chore(package): bump dependencies and lint rules"

This reverts commit 21ad4734fa.
This commit is contained in:
Daniel
2018-03-16 22:04:01 +01:00
parent 21ad4734fa
commit 6c938bfdb7
178 changed files with 4221 additions and 10592 deletions
+38 -48
View File
@@ -1,11 +1,5 @@
import { Injectable } from '@angular/core';
import {
checkAvailability,
CordovaInstance,
InstanceProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin, InstanceProperty } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
@@ -13,6 +7,7 @@ import { Observer } from 'rxjs/Observer';
* @hidden
*/
export class MediaObject {
/**
* An observable that notifies you on actions success
*/
@@ -31,37 +26,36 @@ export class MediaObject {
/**
* @hidden
*/
@InstanceProperty successCallback: Function;
@InstanceProperty
successCallback: Function;
/**
* @hidden
*/
@InstanceProperty errorCallback: Function;
@InstanceProperty
errorCallback: Function;
/**
* @hidden
*/
@InstanceProperty statusCallback: Function;
@InstanceProperty
statusCallback: Function;
constructor(private _objectInstance: any) {
this.onSuccess = new Observable<any>((observer: Observer<any>) => {
this.successCallback = observer.next.bind(observer);
return () => (this.successCallback = () => {});
return () => this.successCallback = () => {};
});
this.onError = new Observable<MEDIA_ERROR>(
(observer: Observer<MEDIA_ERROR>) => {
this.errorCallback = observer.next.bind(observer);
return () => (this.errorCallback = () => {});
}
);
this.onError = new Observable<MEDIA_ERROR>((observer: Observer<MEDIA_ERROR>) => {
this.errorCallback = observer.next.bind(observer);
return () => this.errorCallback = () => {};
});
this.onStatusUpdate = new Observable<MEDIA_STATUS>(
(observer: Observer<MEDIA_STATUS>) => {
this.statusCallback = observer.next.bind(observer);
return () => (this.statusCallback = () => {});
}
);
this.onStatusUpdate = new Observable<MEDIA_STATUS>((observer: Observer<MEDIA_STATUS>) => {
this.statusCallback = observer.next.bind(observer);
return () => this.statusCallback = () => {};
});
}
/**
@@ -69,62 +63,56 @@ export class MediaObject {
* @returns {Promise<any>} Returns a promise with the amplitude of the current recording
*/
@CordovaInstance()
getCurrentAmplitude(): Promise<any> {
return;
}
getCurrentAmplitude(): Promise<any> { return; }
/**
* Get the current position within an audio file. Also updates the Media object's position parameter.
* @returns {Promise<any>} Returns a promise with the position of the current recording
*/
@CordovaInstance()
getCurrentPosition(): Promise<any> {
return;
}
getCurrentPosition(): Promise<any> { return; }
/**
* Get the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1.
* @returns {number} Returns a promise with the duration of the current recording
*/
@CordovaInstance({ sync: true })
getDuration(): number {
return;
}
getDuration(): number { return; }
/**
* Starts or resumes playing an audio file.
*/
@CordovaInstance({ sync: true })
play(iosOptions?: {
numberOfLoops?: number;
playAudioWhenScreenIsLocked?: boolean;
}): void {}
numberOfLoops?: number,
playAudioWhenScreenIsLocked?: boolean
}): void { }
/**
* Pauses playing an audio file.
*/
@CordovaInstance({ sync: true })
pause(): void {}
pause(): void { }
/**
* Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed.
*/
@CordovaInstance({ sync: true })
release(): void {}
release(): void { }
/**
* Sets the current position within an audio file.
* @param {number} milliseconds The time position you want to set for the current audio file
*/
@CordovaInstance({ sync: true })
seekTo(milliseconds: number): void {}
seekTo(milliseconds: number): void { }
/**
* Set the volume for an audio file.
* @param volume {number} The volume to set for playback. The value must be within the range of 0.0 to 1.0.
*/
@CordovaInstance({ sync: true })
setVolume(volume: number): void {}
setVolume(volume: number): void { }
@CordovaInstance({ sync: true })
setRate(speedRate: number): void {}
@@ -133,36 +121,38 @@ export class MediaObject {
* Starts recording an audio file.
*/
@CordovaInstance({ sync: true })
startRecord(): void {}
startRecord(): void { }
/**
* Stops recording
*/
@CordovaInstance({ sync: true })
stopRecord(): void {}
stopRecord(): void { }
/**
* Pauses recording
*/
@CordovaInstance({ sync: true })
pauseRecord(): void {}
pauseRecord(): void { }
/**
* Resumes recording
*/
@CordovaInstance({ sync: true })
resumeRecord(): void {}
resumeRecord(): void { }
/**
* Stops playing an audio file.
*/
@CordovaInstance({ sync: true })
stop(): void {}
stop(): void { }
}
export type MediaStatusUpdateCallback = (statusCode: number) => void;
export interface MediaError {
/**
* Error message
*/
@@ -172,6 +162,7 @@ export interface MediaError {
* Error code
*/
code: number;
}
export enum MEDIA_STATUS {
@@ -297,6 +288,7 @@ export type MediaErrorCallback = (error: MediaError) => void;
})
@Injectable()
export class Media extends IonicNativePlugin {
// Constants
/**
* @hidden
@@ -345,14 +337,12 @@ export class Media extends IonicNativePlugin {
create(src: string): MediaObject {
let instance: any;
if (
checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) ===
true
) {
if (checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) === true) {
// Creates a new media object
instance = new (Media.getPlugin())(src);
}
return new MediaObject(instance);
}
}