UNPKG

3.59 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5var tslib = require('tslib');
6var core$1 = require('@angular/core');
7var core = require('@ionic-native/core');
8
9var SQLiteObject = /** @class */ (function () {
10 function SQLiteObject(_objectInstance) {
11 this._objectInstance = _objectInstance;
12 }
13 SQLiteObject.prototype.addTransaction = function (transaction) { return core.cordovaInstance(this, "addTransaction", { "sync": true }, arguments); };
14 SQLiteObject.prototype.transaction = function (fn) { return core.cordovaInstance(this, "transaction", { "successIndex": 2, "errorIndex": 1 }, arguments); };
15 SQLiteObject.prototype.readTransaction = function (fn) { return core.cordovaInstance(this, "readTransaction", {}, arguments); };
16 SQLiteObject.prototype.startNextTransaction = function () { return core.cordovaInstance(this, "startNextTransaction", { "sync": true }, arguments); };
17 SQLiteObject.prototype.open = function () { return core.cordovaInstance(this, "open", {}, arguments); };
18 SQLiteObject.prototype.close = function () { return core.cordovaInstance(this, "close", {}, arguments); };
19 SQLiteObject.prototype.executeSql = function (statement, params) { return core.cordovaInstance(this, "executeSql", {}, arguments); };
20 SQLiteObject.prototype.sqlBatch = function (sqlStatements) { return core.cordovaInstance(this, "sqlBatch", {}, arguments); };
21 SQLiteObject.prototype.abortallPendingTransactions = function () { return core.cordovaInstance(this, "abortallPendingTransactions", { "sync": true }, arguments); };
22 Object.defineProperty(SQLiteObject.prototype, "databaseFeatures", {
23 get: function () { return core.instancePropertyGet(this, "databaseFeatures"); },
24 set: function (value) { core.instancePropertySet(this, "databaseFeatures", value); },
25 enumerable: false,
26 configurable: true
27 });
28 Object.defineProperty(SQLiteObject.prototype, "openDBs", {
29 get: function () { return core.instancePropertyGet(this, "openDBs"); },
30 set: function (value) { core.instancePropertySet(this, "openDBs", value); },
31 enumerable: false,
32 configurable: true
33 });
34 return SQLiteObject;
35}());
36var SQLite = /** @class */ (function (_super) {
37 tslib.__extends(SQLite, _super);
38 function SQLite() {
39 return _super !== null && _super.apply(this, arguments) || this;
40 }
41 SQLite.prototype.create = function (config) {
42 var _this = this;
43 return (function () {
44 if (core.checkAvailability(_this) === true) {
45 return new Promise(function (resolve, reject) {
46 sqlitePlugin.openDatabase(config, function (db) { return resolve(new SQLiteObject(db)); }, reject);
47 });
48 }
49 })();
50 };
51 SQLite.prototype.echoTest = function () { return core.cordova(this, "echoTest", {}, arguments); };
52 SQLite.prototype.selfTest = function () { return core.cordova(this, "selfTest", {}, arguments); };
53 SQLite.prototype.deleteDatabase = function (config) { return core.cordova(this, "deleteDatabase", {}, arguments); };
54 SQLite.pluginName = "SQLite";
55 SQLite.pluginRef = "sqlitePlugin";
56 SQLite.plugin = "cordova-sqlite-storage";
57 SQLite.repo = "https://github.com/litehelpers/Cordova-sqlite-storage";
58 SQLite.platforms = ["Android", "iOS", "macOS", "Windows"];
59 SQLite.decorators = [
60 { type: core$1.Injectable }
61 ];
62 return SQLite;
63}(core.IonicNativePlugin));
64
65exports.SQLite = SQLite;
66exports.SQLiteObject = SQLiteObject;