UNPKG

@pamlight/ngx-client

Version:

The angular library for Pamlight client SDK

121 lines (115 loc) 3.5 kB
import { Injectable, ɵɵdefineInjectable, NgModule } from '@angular/core'; import { PamlightClient } from '@pamlight/client'; /** * @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 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: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ NgxPamlightService.ctorParameters = function () { return []; }; /** @nocollapse */ NgxPamlightService.ngInjectableDef = ɵɵ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: NgModule, args: [{ declarations: [], imports: [], exports: [], providers: [NgxPamlightService] },] } ]; return NgxPamlightModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { NgxPamlightModule, NgxPamlightService }; //# sourceMappingURL=pamlight-ngx-client.js.map