mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
refactor(lib): run prettier
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
CordovaInstance,
|
||||
InstanceProperty,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
Plugin,
|
||||
} from '@ionic-native/core';
|
||||
|
||||
declare const sqlitePlugin: any;
|
||||
@@ -37,12 +37,7 @@ export interface SQLiteDatabaseConfig {
|
||||
* @hidden
|
||||
*/
|
||||
export interface DbTransaction {
|
||||
executeSql: (
|
||||
sql: any,
|
||||
values?: any[],
|
||||
success?: Function,
|
||||
error?: Function
|
||||
) => void;
|
||||
executeSql: (sql: any, values?: any[], success?: Function, error?: Function) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +64,7 @@ export class SQLiteObject {
|
||||
@InstanceProperty() openDBs: any;
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
sync: true,
|
||||
})
|
||||
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {}
|
||||
|
||||
@@ -79,7 +74,7 @@ export class SQLiteObject {
|
||||
*/
|
||||
@CordovaInstance({
|
||||
successIndex: 2,
|
||||
errorIndex: 1
|
||||
errorIndex: 1,
|
||||
})
|
||||
transaction(fn: (tx: DbTransaction) => void): Promise<any> {
|
||||
return;
|
||||
@@ -95,7 +90,7 @@ export class SQLiteObject {
|
||||
}
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
sync: true,
|
||||
})
|
||||
startNextTransaction(): void {}
|
||||
|
||||
@@ -134,7 +129,7 @@ export class SQLiteObject {
|
||||
}
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
sync: true,
|
||||
})
|
||||
abortallPendingTransactions(): void {}
|
||||
}
|
||||
@@ -182,7 +177,7 @@ export class SQLiteObject {
|
||||
pluginRef: 'sqlitePlugin',
|
||||
plugin: 'cordova-sqlite-storage',
|
||||
repo: 'https://github.com/litehelpers/Cordova-sqlite-storage',
|
||||
platforms: ['Android', 'iOS', 'macOS', 'Windows']
|
||||
platforms: ['Android', 'iOS', 'macOS', 'Windows'],
|
||||
})
|
||||
@Injectable()
|
||||
export class SQLite extends IonicNativePlugin {
|
||||
@@ -197,11 +192,7 @@ 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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user