@pamlight/ngx-client
Version:
The angular library for Pamlight client SDK
119 lines (113 loc) • 4.13 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@pamlight/client')) :
typeof define === 'function' && define.amd ? define('@pamlight/ngx-client', ['exports', '@angular/core', '@pamlight/client'], factory) :
(global = global || self, factory((global.pamlight = global.pamlight || {}, global.pamlight['ngx-client'] = {}), global.ng.core, global.client));
}(this, (function (exports, core, client) { 'use strict';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxPamlightService = /** @class */ (function () {
function NgxPamlightService() {
}
/**
* @param {?} projectId
* @param {?=} dev
* @return {?}
*/
NgxPamlightService.prototype.init = /**
* @param {?} projectId
* @param {?=} dev
* @return {?}
*/
function (projectId, dev) {
/** @type {?} */
var config = {
projectId: projectId
};
this.pamlightClient = new client.PamlightClient(config);
if (dev) {
this.pamlightClient.enableDevMode();
}
return this.pamlightClient.connect();
};
/**
* @return {?}
*/
NgxPamlightService.prototype.getServerTime = /**
* @return {?}
*/
function () {
return this.pamlightClient.utilities.serverTime();
};
/**
* @template T
* @param {?} id
* @param {?=} query
* @return {?}
*/
NgxPamlightService.prototype.read = /**
* @template T
* @param {?} id
* @param {?=} query
* @return {?}
*/
function (id, query) {
return this.pamlightClient.sync(id, query);
};
/**
* @template T
* @param {?} id
* @param {?} payload
* @param {?=} getDoc
* @return {?}
*/
NgxPamlightService.prototype.write = /**
* @template T
* @param {?} id
* @param {?} payload
* @param {?=} getDoc
* @return {?}
*/
function (id, payload, getDoc) {
return this.pamlightClient.write(id, payload, getDoc);
};
NgxPamlightService.decorators = [
{ type: core.Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NgxPamlightService.ctorParameters = function () { return []; };
/** @nocollapse */ NgxPamlightService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function NgxPamlightService_Factory() { return new NgxPamlightService(); }, token: NgxPamlightService, providedIn: "root" });
return NgxPamlightService;
}());
if (false) {
/**
* @type {?}
* @private
*/
NgxPamlightService.prototype.pamlightClient;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxPamlightModule = /** @class */ (function () {
function NgxPamlightModule() {
}
NgxPamlightModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [],
imports: [],
exports: [],
providers: [NgxPamlightService]
},] }
];
return NgxPamlightModule;
}());
exports.NgxPamlightModule = NgxPamlightModule;
exports.NgxPamlightService = NgxPamlightService;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=pamlight-ngx-client.umd.js.map