mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
Merge in v5 code
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaInstance, Plugin, CordovaCheck, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||
import {
|
||||
Cordova,
|
||||
CordovaCheck,
|
||||
CordovaInstance,
|
||||
InstanceProperty,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
} from '@ionic-native/core';
|
||||
|
||||
declare const sqlitePlugin: any;
|
||||
|
||||
@@ -17,8 +24,8 @@ export interface SQLiteDatabaseConfig {
|
||||
*/
|
||||
iosDatabaseLocation?: string;
|
||||
/**
|
||||
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
|
||||
*/
|
||||
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
|
||||
*/
|
||||
createFromLocation?: number;
|
||||
/**
|
||||
* support encrypted databases with https://github.com/litehelpers/Cordova-sqlcipher-adapter
|
||||
@@ -46,16 +53,17 @@ export interface SQLiteTransaction {
|
||||
*/
|
||||
export class SQLiteObject {
|
||||
|
||||
constructor(public _objectInstance: any) { }
|
||||
@InstanceProperty() databaseFeatures: { isSQLitePluginDatabase: boolean };
|
||||
@InstanceProperty() openDBs: any;
|
||||
|
||||
@InstanceProperty databaseFeatures: { isSQLitePluginDatabase: boolean };
|
||||
|
||||
@InstanceProperty openDBs: any;
|
||||
constructor(public _objectInstance: any) {
|
||||
}
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
addTransaction(transaction: (tx: SQLiteTransaction) => void): void { }
|
||||
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fn {any}
|
||||
@@ -65,50 +73,64 @@ export class SQLiteObject {
|
||||
successIndex: 2,
|
||||
errorIndex: 1
|
||||
})
|
||||
transaction(fn: any): Promise<any> { return; }
|
||||
transaction(fn: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fn {Function}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
readTransaction(fn: (tx: SQLiteTransaction) => void): Promise<any> { return; }
|
||||
readTransaction(fn: (tx: SQLiteTransaction) => void): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
startNextTransaction(): void { }
|
||||
startNextTransaction(): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
open(): Promise<any> { return; }
|
||||
open(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
close(): Promise<any> { return; }
|
||||
close(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute SQL on the opened database. Note, you must call `create` first, and
|
||||
* ensure it resolved and successfully opened the database.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeSql(statement: string, params: any): Promise<any> { return; }
|
||||
executeSql(statement: string, params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sqlStatements {Array<string | string[] | any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
sqlBatch(sqlStatements: Array<string | string[] | any>): Promise<any> { return; }
|
||||
sqlBatch(sqlStatements: Array<string | string[] | any>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abortallPendingTransactions(): void { }
|
||||
abortallPendingTransactions(): void {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -180,7 +202,9 @@ export class SQLite extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
echoTest(): Promise<any> { return; }
|
||||
echoTest(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a database
|
||||
@@ -188,6 +212,8 @@ export class SQLite extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> { return; }
|
||||
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user