mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
fix(sqlite): remove trailing whitespaces
This commit is contained in:
parent
f607a03c9b
commit
7547a94c80
@ -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
|
||||
@ -31,8 +38,18 @@ export interface SQLiteDatabaseConfig {
|
||||
*/
|
||||
export interface SQLiteTransaction {
|
||||
start: () => void;
|
||||
executeSql: (sql: any, values: any, success: Function, error: Function) => void;
|
||||
addStatement: (sql: any, values: any, success: Function, error: Function) => void;
|
||||
executeSql: (
|
||||
sql: any,
|
||||
values: any,
|
||||
success: Function,
|
||||
error: Function
|
||||
) => void;
|
||||
addStatement: (
|
||||
sql: any,
|
||||
values: any,
|
||||
success: Function,
|
||||
error: Function
|
||||
) => void;
|
||||
handleStatementSuccess: (handler: Function, response: any) => void;
|
||||
handleStatementFailure: (handler: Function, response: any) => void;
|
||||
run: () => void;
|
||||
@ -45,8 +62,7 @@ export interface SQLiteTransaction {
|
||||
* @hidden
|
||||
*/
|
||||
export class SQLiteObject {
|
||||
|
||||
constructor(public _objectInstance: any) { }
|
||||
constructor(public _objectInstance: any) {}
|
||||
|
||||
@InstanceProperty databaseFeatures: { isSQLitePluginDatabase: boolean };
|
||||
|
||||
@ -55,7 +71,7 @@ export class SQLiteObject {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
addTransaction(transaction: (tx: SQLiteTransaction) => void): void { }
|
||||
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {}
|
||||
|
||||
/**
|
||||
* @param fn {any}
|
||||
@ -65,51 +81,62 @@ 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 {}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -159,7 +186,6 @@ export class SQLiteObject {
|
||||
})
|
||||
@Injectable()
|
||||
export class SQLite extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Open or create a SQLite database file.
|
||||
*
|
||||
@ -171,7 +197,11 @@ export class SQLite extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
create(config: SQLiteDatabaseConfig): Promise<SQLiteObject> {
|
||||
return new Promise((resolve, reject) => {
|
||||
sqlitePlugin.openDatabase(config, (db: any) => resolve(new SQLiteObject(db)), reject);
|
||||
sqlitePlugin.openDatabase(
|
||||
config,
|
||||
(db: any) => resolve(new SQLiteObject(db)),
|
||||
reject
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@ -180,14 +210,18 @@ export class SQLite extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
echoTest(): Promise<any> { return; }
|
||||
|
||||
echoTest(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically verify basic database access operations including opening a database
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
selfTest(): Promise<any> { return; }
|
||||
selfTest(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a database
|
||||
@ -195,6 +229,7 @@ export class SQLite extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> { return; }
|
||||
|
||||
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user