-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ionicnative): add instance wrapper
- Loading branch information
Showing
5 changed files
with
237 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {Cordova, Plugin} from "./plugin"; | ||
import {Observable} from "rxjs/Observable"; | ||
import {CordovaInstance} from "./plugin"; | ||
/** | ||
* Created by Ibrahim on 3/29/2016. | ||
*/ | ||
declare var plugin : any; | ||
/** | ||
* @name Google Maps | ||
*/ | ||
@Plugin({ | ||
pluginRef: 'plugin.google.maps' | ||
}) | ||
export class GoogleMaps { | ||
|
||
private _objectInstance : any; | ||
|
||
constructor (elementId : string, public niggasIn = "paris") { | ||
this._objectInstance = {};//plugin.google.maps.Map.getMap(document.getElementById(elementId)); | ||
} | ||
|
||
@Cordova({ | ||
eventObservable: true, | ||
event: 'plugin.google.maps.event.MAP_READY' | ||
}) | ||
static onInit () : Observable<GoogleMaps> {return} | ||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
setDebuggable (isDebuggable : boolean) : void {} | ||
|
||
setClickable (isClickable : boolean) : void {} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import {CordovaInstance, Plugin, Cordova} from './plugin'; | ||
declare var sqlitePlugin; | ||
/** | ||
* @name SQLite | ||
*/ | ||
@Plugin({ | ||
pluginRef: 'sqlitePlugin' | ||
}) | ||
export class SQLite { | ||
|
||
private _objectInstance : any; | ||
get databaseFeatures() : any { | ||
return this._objectInstance.databaseFeatures; | ||
} | ||
|
||
constructor (config : any) { | ||
new Promise((resolve, reject) => { | ||
sqlitePlugin.openDatabase(config, resolve, reject); | ||
}).then( | ||
db => this._objectInstance = db, | ||
error => console.warn(error) | ||
); | ||
} | ||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
addTransaction (transaction : any) : void {} | ||
|
||
@CordovaInstance() | ||
transaction (fn : any) : Promise<any> {return} | ||
|
||
@CordovaInstance() | ||
readTransaction (fn : any) : Promise<any> {return} | ||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
startNextTransaction () : void {} | ||
|
||
@CordovaInstance() | ||
close () : Promise<any> {return} | ||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
start () : void {} | ||
|
||
@CordovaInstance() | ||
executeSql (statement : string, params : any) : Promise<any> {return} | ||
|
||
@CordovaInstance() | ||
addSatement (sql, values) : Promise<any> {return} | ||
|
||
@CordovaInstance() | ||
sqlBatch (sqlStatements : any) : Promise<any> {return} | ||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
abortallPendingTransactions () : void {} | ||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
handleStatementSuccess (handler, response) : void {} | ||
|
||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
handleStatementFailure (handler, response) : void {} | ||
|
||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
run () : void {} | ||
|
||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
abort (txFailure) : void {} | ||
|
||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
finish () : void {} | ||
|
||
|
||
|
||
@CordovaInstance({ | ||
sync: true | ||
}) | ||
abortFromQ (sqlerror) : void {} | ||
|
||
|
||
@Cordova() | ||
static echoTest () : Promise<any> {return} | ||
|
||
@Cordova() | ||
static deleteDatabase (first) : Promise<any> {return} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters