Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(couchbase-lite): add CouchbaseLite cordova plugin #1025

Merged
merged 2 commits into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { CardIO } from './plugins/card-io';
import { Clipboard } from './plugins/clipboard';
import { CodePush } from './plugins/code-push';
import { Contacts } from './plugins/contacts';
import { CouchbaseLite } from './plugins/couchbase-lite';
import { Crop } from './plugins/crop';
import { DatePicker } from './plugins/datepicker';
import { DBMeter } from './plugins/dbmeter';
Expand Down Expand Up @@ -151,6 +152,7 @@ export * from './plugins/card-io';
export * from './plugins/clipboard';
export * from './plugins/code-push';
export * from './plugins/contacts';
export * from './plugins/couchbase-lite';
export * from './plugins/crop';
export * from './plugins/datepicker';
export * from './plugins/dbmeter';
Expand Down Expand Up @@ -275,6 +277,7 @@ window['IonicNative'] = {
Clipboard,
CodePush,
Contacts,
CouchbaseLite,
Crop,
DatePicker,
DBMeter,
Expand Down
35 changes: 35 additions & 0 deletions src/plugins/couchbase-lite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Plugin, Cordova } from './plugin';

/**
* @name Couchbase Lite
* @description
* Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android
*
* @usage
* ```
* import { CouchbaseLite } from 'ionic-native';
*
* CouchbaseLite.getURL()
* .then((url: any) => console.log(url))
* .catch((error: any) => console.log(error));
*
* ```
*/
@Plugin({
pluginName: 'Couchbase Lite',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be any spaces here. pluginName should match the class name.

plugin: '',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the plugin property should be https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin since they don't have an NPM package pubished

pluginRef: 'cblite',
repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
})
export class CouchbaseLite {

/**
* Get the database url
* @return {Promise<any>} Returns a promise that resolves with the local database url
*/
@Cordova({
callbackStyle: 'node'
})
static getURL(): Promise<any> { return; }

}