refactor(SQLite):
This commit is contained in:
parent
499e89e254
commit
9c25244bc6
@ -1,5 +1,8 @@
|
|||||||
import {CordovaInstance, Plugin, Cordova} from './plugin';
|
import { Cordova, CordovaInstance, Plugin } from './plugin';
|
||||||
|
|
||||||
|
|
||||||
declare var sqlitePlugin;
|
declare var sqlitePlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name SQLite
|
* @name SQLite
|
||||||
*
|
*
|
||||||
@ -39,7 +42,7 @@ export class SQLite {
|
|||||||
return this._objectInstance.databaseFeatures;
|
return this._objectInstance.databaseFeatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor () {}
|
constructor() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open or create a SQLite database file.
|
* Open or create a SQLite database file.
|
||||||
@ -67,7 +70,7 @@ export class SQLite {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
openDatabase (config: any): Promise<any> {
|
openDatabase(config: any): Promise<any> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
sqlitePlugin.openDatabase(config, db => {
|
sqlitePlugin.openDatabase(config, db => {
|
||||||
this._objectInstance = db;
|
this._objectInstance = db;
|
||||||
@ -82,26 +85,26 @@ export class SQLite {
|
|||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
addTransaction (transaction: any): void {}
|
addTransaction(transaction: any): void { }
|
||||||
|
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
transaction (fn: any): Promise<any> {return; }
|
transaction(fn: any): Promise<any> { return; }
|
||||||
|
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
readTransaction (fn: any): Promise<any> {return; }
|
readTransaction(fn: any): Promise<any> { return; }
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
startNextTransaction (): void {}
|
startNextTransaction(): void { }
|
||||||
|
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
close (): Promise<any> {return; }
|
close(): Promise<any> { return; }
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
start (): void {}
|
start(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and
|
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and
|
||||||
@ -117,59 +120,59 @@ export class SQLite {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
executeSql (statement: string, params: any): Promise<any> {return; }
|
executeSql(statement: string, params: any): Promise<any> { return; }
|
||||||
|
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
addSatement (sql, values): Promise<any> {return; }
|
addSatement(sql, values): Promise<any> { return; }
|
||||||
|
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
sqlBatch (sqlStatements: any): Promise<any> {return; }
|
sqlBatch(sqlStatements: any): Promise<any> { return; }
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
abortallPendingTransactions (): void {}
|
abortallPendingTransactions(): void { }
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
handleStatementSuccess (handler, response): void {}
|
handleStatementSuccess(handler, response): void { }
|
||||||
|
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
handleStatementFailure (handler, response): void {}
|
handleStatementFailure(handler, response): void { }
|
||||||
|
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
run (): void {}
|
run(): void { }
|
||||||
|
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
abort (txFailure): void {}
|
abort(txFailure): void { }
|
||||||
|
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
finish (): void {}
|
finish(): void { }
|
||||||
|
|
||||||
|
|
||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
abortFromQ (sqlerror): void {}
|
abortFromQ(sqlerror): void { }
|
||||||
|
|
||||||
|
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static echoTest (): Promise<any> {return; }
|
static echoTest(): Promise<any> { return; }
|
||||||
|
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static deleteDatabase (first): Promise<any> {return; }
|
static deleteDatabase(first): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user