mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
chore(docs): setting up dgeni and circle CI
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
/**
|
||||
* Take a photo or capture video.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* Camera.getPicture(options).then((imageData) => {
|
||||
* // imageData is either a base64 encoded string or a file URI
|
||||
* // If it's base64:
|
||||
* let base64Image = "data:image/jpeg;base64," + imageData;
|
||||
* }, (err) => {
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Camera',
|
||||
plugin: 'cordova-plugin-camera',
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
/**
|
||||
* Access and manage Contacts on the device.
|
||||
*
|
||||
* Requires plugin: `cordova-plugin-contacts`
|
||||
* For full info, please see the [Cordova Contacts Docs](https://github.com/apache/cordova-plugin-contacts)
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```js
|
||||
* Contacts.save({
|
||||
* displayName: "Mr. Ionitron"
|
||||
* }).then((contact) => {}, (err) => {})
|
||||
* ```
|
||||
*
|
||||
* See the `save()` docs for a full list of fields.
|
||||
*
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
name: 'Contacts',
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
@@ -11,6 +29,32 @@ export class Contacts {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
|
||||
/**
|
||||
* Save a contact into the contacts database.
|
||||
*
|
||||
* Valid fields:
|
||||
* {
|
||||
* id: A globally unique identifier. (DOMString)
|
||||
* displayName: The name of this Contact, suitable for display to end-users. (DOMString)
|
||||
* name: An object containing all components of a persons name. (ContactName)
|
||||
* nickname: A casual name by which to address the contact. (DOMString)
|
||||
* phoneNumbers: An array of all the contact's phone numbers. (ContactField[])
|
||||
* emails: An array of all the contact's email addresses. (ContactField[])
|
||||
* addresses: An array of all the contact's addresses. (ContactAddress[])
|
||||
* ims: An array of all the contact's IM addresses. (ContactField[])
|
||||
* organizations: An array of all the contact's organizations. (ContactOrganization[])
|
||||
* birthday: The birthday of the contact. (Date)
|
||||
* note: A note about the contact. (DOMString)
|
||||
* photos: An array of the contact's photos. (ContactField[])
|
||||
* categories: An array of all the user-defined categories associated with the contact. (ContactField[])
|
||||
* urls: An array of web pages associated with the contact. (ContactField[])
|
||||
* }
|
||||
*
|
||||
* @param contact {object} the contact to save.
|
||||
* @return {Promise} that resolves with the created and saved contact
|
||||
*/
|
||||
|
||||
// This method is create(fields, success, error, options) :/
|
||||
static create(fields:string[], options:any){};
|
||||
|
||||
@@ -18,6 +62,21 @@ export class Contacts {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
*
|
||||
* Example: Contacts.find({ filter: 'Max' }) // will search for a displayName of 'Max'
|
||||
*
|
||||
* @param options the options to query with
|
||||
*
|
||||
* filter: The search string used to find navigator.contacts. (DOMString) (Default: "")
|
||||
* multiple: Determines if the find operation returns multiple navigator.contacts. (Boolean) (Default: false)
|
||||
* desiredFields: Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. (DOMString[]) [Optional]
|
||||
* hasPhoneNumber(Android only): Filters the search to only return contacts with a phone number informed. (Boolean) (Default: false)
|
||||
*
|
||||
* @return {Promise} that resolves with the search results
|
||||
*/
|
||||
static find(fields:string[], options:any){};
|
||||
|
||||
@Cordova()
|
||||
|
||||
+17
-1
@@ -2,13 +2,29 @@ import {Plugin, RequiresPlugin} from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
|
||||
/**
|
||||
* Access information about the underlying device and platform.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* let info = Device.getDevice();
|
||||
* // Device sits below
|
||||
* ```
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
name: 'Device',
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device'
|
||||
})
|
||||
export class Device {
|
||||
|
||||
|
||||
/**
|
||||
* Returns the whole device object.
|
||||
* @see https://github.com/apache/cordova-plugin-device
|
||||
* @returns {Object} The device object.
|
||||
*/
|
||||
@RequiresPlugin
|
||||
static getDevice() {
|
||||
return window.device;
|
||||
|
||||
@@ -4,6 +4,24 @@ declare var Promise;
|
||||
|
||||
declare var window;
|
||||
|
||||
|
||||
/**
|
||||
* Get geolocation data.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* //resp.coords.latitude
|
||||
* //resp.coords.longitude
|
||||
* })
|
||||
*
|
||||
* let watch = Geolocation.watchPosition();
|
||||
* watch.source.subscribe((data) => {
|
||||
* //data.coords.latitude
|
||||
* //data.coords.longitude
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Geolocation',
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
|
||||
@@ -1,27 +1,82 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* StatusBar.hide(); // Hide the bar
|
||||
*
|
||||
* StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'StatusBar',
|
||||
plugin: 'cordova-plugin-statusbar',
|
||||
pluginRef: 'StatusBar'
|
||||
})
|
||||
export class StatusBar {
|
||||
/**
|
||||
* Set whether the status bar overlays the main app view. The default
|
||||
* is true.
|
||||
*
|
||||
* @param doesOverlay whether the status bar overlays the main app view.
|
||||
*/
|
||||
@Cordova()
|
||||
static overlaysWebView(doOverlay:boolean){};
|
||||
|
||||
@Cordova()
|
||||
static styleDefault(){};
|
||||
|
||||
@Cordova()
|
||||
static styleLightContent(){};
|
||||
|
||||
@Cordova()
|
||||
static styleBlackTranslucent(){};
|
||||
|
||||
@Cordova()
|
||||
static styleBlackOpaque(){};
|
||||
|
||||
/**
|
||||
* Set the status bar to a specific named color. Valid options:
|
||||
* black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param name the name of the color (from above)
|
||||
*/
|
||||
@Cordova()
|
||||
static backgroundColorByName(colorName:string){};
|
||||
|
||||
/**
|
||||
* Set the status bar to a specific hex color (CSS shorthand supported!).
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param hex the hex value of the color.
|
||||
*/
|
||||
@Cordova()
|
||||
static backgroundColorByHexString(hexString:string){};
|
||||
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* StatusBar.DEFAULT
|
||||
* StatusBar.LIGHT_CONTENT
|
||||
* StatusBar.BLACK_TRANSLUCENT
|
||||
* StatusBar.BLACK_OPAQUE
|
||||
*
|
||||
* @param style the style from above
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(){};
|
||||
|
||||
/**
|
||||
* Show the StatusBar
|
||||
*/
|
||||
@Cordova()
|
||||
static show(){};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user