docs(sqlite): Add interface for transaction callback function argument (#2586)

The transaction callback function argument is currently typed as `any`, however this isn't very  helpful so I have added a base interface which contains only the `executeSql` function. This function is all that is available on the object returned by WebSQL, but is also available on the full SQLite implementation.
This commit is contained in:
Matt 2018-07-08 17:43:31 +01:00 committed by Daniel Sogl
parent 3f9311090d
commit 713efd7206

View File

@ -36,14 +36,20 @@ export interface SQLiteDatabaseConfig {
/**
* @hidden
*/
export interface SQLiteTransaction {
start: () => void;
export interface DbTransaction {
executeSql: (
sql: any,
values: any,
success: Function,
error: Function
) => void;
sql: any,
values: any,
success: Function,
error: Function
) => void;
}
/**
* @hidden
*/
export interface SQLiteTransaction extends DbTransaction {
start: () => void;
addStatement: (
sql: any,
values: any,
@ -74,14 +80,14 @@ export class SQLiteObject {
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {}
/**
* @param fn {any}
* @param fn {Function}
* @returns {Promise<any>}
*/
@CordovaInstance({
successIndex: 2,
errorIndex: 1
})
transaction(fn: any): Promise<any> {
transaction(fn: (tx: DbTransaction) => void): Promise<any> {
return;
}