mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-15 12:37:08 +08:00
docs(dbmeter): complete docs
This commit is contained in:
parent
8c17a2a6c2
commit
765ef48a23
@ -1,10 +1,30 @@
|
|||||||
import {Plugin, Cordova} from './plugin'
|
import {Plugin, Cordova} from './plugin'
|
||||||
// TODO docs
|
import {Observable} from "rxjs/Observable";
|
||||||
/**
|
/**
|
||||||
* @name DB Meter
|
* @name DB Meter
|
||||||
* @description
|
* @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone.
|
||||||
* @platforms Android, iOS
|
* @platforms Android, iOS
|
||||||
* @usage
|
* @usage
|
||||||
|
* ```ts
|
||||||
|
* // Start listening
|
||||||
|
* let subscription = DBMeter.start().subscribe(
|
||||||
|
* data => console.log(data)
|
||||||
|
* );
|
||||||
|
*
|
||||||
|
* // Check if we are listening
|
||||||
|
* DBMeter.isListening().then(
|
||||||
|
* (isListening : boolean) => console.log(isListening)
|
||||||
|
* );
|
||||||
|
*
|
||||||
|
* // Stop listening
|
||||||
|
* subscription.unsubscribe();
|
||||||
|
*
|
||||||
|
* // Delete DBMeter instance from memory
|
||||||
|
* DBMeter.delete().then(
|
||||||
|
* () => console.log("Deleted DB Meter instance"),
|
||||||
|
* error => console.log("Error occurred while deleting DB Meter instance")
|
||||||
|
* );
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova-plugin-dbmeter',
|
plugin: 'cordova-plugin-dbmeter',
|
||||||
@ -13,17 +33,34 @@ import {Plugin, Cordova} from './plugin'
|
|||||||
})
|
})
|
||||||
export class DBMeter {
|
export class DBMeter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts listening
|
||||||
|
* @return {Observable<string>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
observable: true,
|
||||||
|
clearFunction: 'stop'
|
||||||
|
})
|
||||||
|
static start () : Observable<any> {return}
|
||||||
|
|
||||||
// TODO use observable instead
|
/**
|
||||||
@Cordova()
|
* Stops listening
|
||||||
static start () : Promise<any> {return}
|
* @private
|
||||||
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static stop () : Promise<any> {return}
|
static stop () : Promise<any> {return}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the DB Meter is listening
|
||||||
|
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||||
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isListening() : Promise<boolean> {return}
|
static isListening() : Promise<boolean> {return}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete the DB Meter instance
|
||||||
|
* @return {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||||
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static delete() : Promise<any> {return}
|
static delete() : Promise<any> {return}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user