mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
feat(sqlite): add SQLiteDatabaseConfig interface
This commit is contained in:
parent
01aece1fbb
commit
544e7ef4fc
@ -4,6 +4,17 @@ import { Cordova, CordovaInstance, Plugin, CordovaCheck, InstanceProperty } from
|
|||||||
|
|
||||||
declare var sqlitePlugin;
|
declare var sqlitePlugin;
|
||||||
|
|
||||||
|
export interface SQLiteDatabaseConfig {
|
||||||
|
/**
|
||||||
|
* Name of the database
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* Location of the database
|
||||||
|
*/
|
||||||
|
location: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
@ -160,6 +171,8 @@ export class SQLiteObject {
|
|||||||
*
|
*
|
||||||
* @classes
|
* @classes
|
||||||
* SQLiteObject
|
* SQLiteObject
|
||||||
|
* @interfaces
|
||||||
|
* SQLiteDatabaseConfig
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'SQLite',
|
pluginName: 'SQLite',
|
||||||
@ -179,7 +192,7 @@ export class SQLite {
|
|||||||
* @return Promise<SQLiteObject>
|
* @return Promise<SQLiteObject>
|
||||||
*/
|
*/
|
||||||
@CordovaCheck()
|
@CordovaCheck()
|
||||||
create(config: any): Promise<SQLiteObject> {
|
create(config: SQLiteDatabaseConfig): Promise<SQLiteObject> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
sqlitePlugin.openDatabase(config, db => resolve(new SQLiteObject(db)), reject);
|
sqlitePlugin.openDatabase(config, db => resolve(new SQLiteObject(db)), reject);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user