@denevads/dnv-smo 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export * from "./";
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./"), exports);
@@ -0,0 +1,31 @@
1
+ export interface setDatasource {
2
+ xml: string;
3
+ }
4
+ export interface variable {
5
+ variable: string;
6
+ valor: string;
7
+ }
8
+ export interface location {
9
+ top: string;
10
+ left: string;
11
+ width: string;
12
+ height: string;
13
+ }
14
+ export interface Slide {
15
+ codigo: string;
16
+ idioma: string;
17
+ denominacion: string;
18
+ hash: string;
19
+ }
20
+ export interface DataSalida {
21
+ dataKey: string;
22
+ data: Slide[];
23
+ }
24
+ export interface ExecFunction {
25
+ funcion: string;
26
+ params: string;
27
+ }
28
+ export interface Notify {
29
+ destion: string;
30
+ value: any;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/smo.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import { setDatasource, variable, location, DataSalida, ExecFunction, Notify } from "./interfaces/callbacks";
4
+ export declare class SMO extends EventEmitter {
5
+ vars: any;
6
+ id: string;
7
+ smoCallBacks: smoCallBacks;
8
+ utils: Utils;
9
+ constructor();
10
+ init(): void;
11
+ initOnMessage(): void;
12
+ start(): void;
13
+ setDatasource(datasource: setDatasource): void;
14
+ getVariable(variable: variable): void;
15
+ setCurrentStream(stream: string): void;
16
+ infoCurrentLocation(location: location): void;
17
+ setSalidaData(data: DataSalida): void;
18
+ updatefromsalida(data: any): void;
19
+ }
20
+ declare class smoCallBacks {
21
+ smo: SMO;
22
+ constructor(_smo: SMO);
23
+ onSmoLoad(): void;
24
+ onSmoReady(): void;
25
+ smoLog(msn: string, level: LogLevel): void;
26
+ smoAlarma(msn: string, level: AlarmaLevel): void;
27
+ reiniciarDispositivo(msn: string): void;
28
+ urlNext(): void;
29
+ exitInteractivity(): void;
30
+ showBrowser(): void;
31
+ closeBrowser(): void;
32
+ urlNextDirectamente(): void;
33
+ setVariable(variable: string, valor: string): void;
34
+ getVariable(variable: string): void;
35
+ getFile(file: string): void;
36
+ setLocalData(variable: string, valor: string): void;
37
+ getLocalData(variable: string): void;
38
+ getCurrentStream(): void;
39
+ finAviso(id: string): void;
40
+ refreshDatasource(codigo: string): void;
41
+ getLocation(): void;
42
+ getSalidaData(data: string): void;
43
+ ejecutaFuncion(data: ExecFunction): void;
44
+ addObserver(data: string): void;
45
+ notify(data: Notify): void;
46
+ playOnceChannelByTrigger(trigger: string): void;
47
+ stopPlayOnceChannelByTrigger(): void;
48
+ playOnceChannel(codigoCanal: string): void;
49
+ stopPlayChannel(): void;
50
+ }
51
+ declare class Utils {
52
+ smo: SMO;
53
+ smoCallBacks: smoCallBacks;
54
+ constructor(_smo: SMO, _smoCallBacks: smoCallBacks);
55
+ dataToJSON(data: setDatasource): any;
56
+ getDatasource(): void;
57
+ startCheckDatasource(): void;
58
+ }
59
+ export declare enum SMO_EVENT_TYPE {
60
+ start = "start",
61
+ setDatasource = "setDatasource",
62
+ getVariable = "getVariable",
63
+ setCurrentStream = "setCurrentStream",
64
+ infoCurrentLocation = "infoCurrentLocation",
65
+ setSalidaData = "setSalidaData",
66
+ updatefromsalida = "updatefromsalida"
67
+ }
68
+ export declare enum LogLevel {
69
+ Debug = 0,
70
+ Info = 1,
71
+ Warning = 2,
72
+ Error = 3
73
+ }
74
+ export declare enum AlarmaLevel {
75
+ Ok_off = 0,
76
+ Ok = 1,
77
+ Scanning = 2,
78
+ Timeout = 3,
79
+ Warning = 4,
80
+ Error = 5
81
+ }
82
+ export {};
package/dist/smo.js ADDED
@@ -0,0 +1,423 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AlarmaLevel = exports.LogLevel = exports.SMO_EVENT_TYPE = exports.SMO = void 0;
19
+ var events_1 = require("events");
20
+ var SMO = /** @class */ (function (_super) {
21
+ __extends(SMO, _super);
22
+ function SMO() {
23
+ var _this = _super.call(this) || this;
24
+ _this.vars = {};
25
+ _this.id = "";
26
+ _this.init();
27
+ _this.initOnMessage();
28
+ _this.smoCallBacks = new smoCallBacks(_this);
29
+ _this.utils = new Utils(_this, _this.smoCallBacks);
30
+ return _this;
31
+ }
32
+ SMO.prototype.init = function () {
33
+ var match, pl = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) {
34
+ return decodeURIComponent(s.replace(pl, " "));
35
+ }, query = window.location.search.substring(1);
36
+ while (match = search.exec(query)) {
37
+ this.vars[decode(match[1])] = decode(match[2]);
38
+ }
39
+ if (this.vars.idSmo) {
40
+ this.id = this.vars.idSmo;
41
+ return;
42
+ }
43
+ console.warn("No idSmo found in URL");
44
+ };
45
+ SMO.prototype.initOnMessage = function () {
46
+ var selft = this;
47
+ window.onmessage = function (e) {
48
+ if (e.data.target) {
49
+ var targets = e.data.target.split('.');
50
+ var func = targets[targets.length - 1];
51
+ if (func == SMO_EVENT_TYPE.start) {
52
+ selft.start();
53
+ return;
54
+ }
55
+ if (func == SMO_EVENT_TYPE.setDatasource) {
56
+ selft.setDatasource(e.data.objData);
57
+ return;
58
+ }
59
+ if (func == SMO_EVENT_TYPE.getVariable) {
60
+ selft.getVariable(e.data.objData);
61
+ return;
62
+ }
63
+ if (func == SMO_EVENT_TYPE.setCurrentStream) {
64
+ selft.setCurrentStream(e.data.objData);
65
+ return;
66
+ }
67
+ if (func == SMO_EVENT_TYPE.infoCurrentLocation) {
68
+ selft.infoCurrentLocation(e.data.objData);
69
+ return;
70
+ }
71
+ if (func == SMO_EVENT_TYPE.setSalidaData) {
72
+ selft.setSalidaData(e.data.objData);
73
+ return;
74
+ }
75
+ if (func == SMO_EVENT_TYPE.updatefromsalida) {
76
+ selft.updatefromsalida(e.data.objdata);
77
+ return;
78
+ }
79
+ console.warn("message not implemented!!" + func);
80
+ /* try {
81
+ var targets = e.data.target.split('.');
82
+ var fn = window;
83
+ var obj = window;
84
+ for (var i = 0; i < targets.length; i++) {
85
+ obj = fn;
86
+ fn = obj[targets[i]];
87
+ }
88
+ fn.call(obj, e.data.objData); // conservamos el valor de this
89
+ } catch (ex) {
90
+ //Si no ha podido llamar es porque no existe el entorno
91
+
92
+ }*/
93
+ }
94
+ };
95
+ };
96
+ SMO.prototype.start = function () {
97
+ this.emit(SMO_EVENT_TYPE.start);
98
+ };
99
+ SMO.prototype.setDatasource = function (datasource) {
100
+ this.emit(SMO_EVENT_TYPE.setDatasource, datasource);
101
+ };
102
+ SMO.prototype.getVariable = function (variable) {
103
+ this.emit(SMO_EVENT_TYPE.getVariable, variable);
104
+ };
105
+ SMO.prototype.setCurrentStream = function (stream) {
106
+ this.emit(SMO_EVENT_TYPE.setCurrentStream, stream);
107
+ };
108
+ SMO.prototype.infoCurrentLocation = function (location) {
109
+ this.emit(SMO_EVENT_TYPE.infoCurrentLocation, location);
110
+ };
111
+ SMO.prototype.setSalidaData = function (data) {
112
+ this.emit(SMO_EVENT_TYPE.setSalidaData, data);
113
+ };
114
+ SMO.prototype.updatefromsalida = function (data) {
115
+ this.emit(SMO_EVENT_TYPE.updatefromsalida, data);
116
+ };
117
+ return SMO;
118
+ }(events_1.EventEmitter));
119
+ exports.SMO = SMO;
120
+ var smoCallBacks = /** @class */ (function () {
121
+ function smoCallBacks(_smo) {
122
+ this.smo = _smo;
123
+ }
124
+ smoCallBacks.prototype.onSmoLoad = function () {
125
+ window.parent.postMessage({
126
+ target: "Dnv.smoCallbacks.onSmoLoad",
127
+ objData: undefined,
128
+ idSmo: this.smo.id
129
+ }, "*");
130
+ };
131
+ smoCallBacks.prototype.onSmoReady = function () {
132
+ window.parent.postMessage({
133
+ target: "Dnv.smoCallbacks.onSmoReady",
134
+ objData: undefined,
135
+ idSmo: this.smo.id
136
+ }, "*");
137
+ };
138
+ smoCallBacks.prototype.smoLog = function (msn, level) {
139
+ if (level == undefined) {
140
+ level = LogLevel.Info;
141
+ }
142
+ //level = Dnv.LogLevel.Debug...
143
+ if (level == LogLevel.Debug) {
144
+ console.debug(msn);
145
+ }
146
+ if (level == LogLevel.Info) {
147
+ console.log(msn);
148
+ }
149
+ if (level == LogLevel.Warning) {
150
+ console.warn(msn);
151
+ }
152
+ if (level == LogLevel.Error) {
153
+ console.error(msn);
154
+ }
155
+ if (window.parent != window) {
156
+ window.parent.postMessage({
157
+ target: "Dnv.smoCallbacks.smoLog",
158
+ objData: {
159
+ level: level,
160
+ txt: msn
161
+ },
162
+ idSmo: this.smo.id
163
+ }, "*");
164
+ }
165
+ };
166
+ smoCallBacks.prototype.smoAlarma = function (msn, level) {
167
+ window.parent.postMessage({
168
+ target: "Dnv.smoCallbacks.smoAlarma",
169
+ objData: {
170
+ level: level,
171
+ txt: msn
172
+ },
173
+ idSmo: this.smo.id
174
+ }, "*");
175
+ };
176
+ smoCallBacks.prototype.reiniciarDispositivo = function (msn) {
177
+ //Permite reiniciar el player, proporcionando una razón para el reinicio. Solo Player HTML5
178
+ window.parent.postMessage({
179
+ target: "Dnv.smoCallbacks.reiniciarDispositivo",
180
+ objData: {
181
+ txt: msn // Razón del reinicio
182
+ },
183
+ idSmo: this.smo.id
184
+ }, "*");
185
+ };
186
+ smoCallBacks.prototype.urlNext = function () {
187
+ //Permite avanzar plantilla. Solo si Reloj Maestro activado.
188
+ window.parent.postMessage({
189
+ target: "Dnv.smoCallbacks.urlNext",
190
+ objData: undefined,
191
+ idSmo: this.smo.id
192
+ }, "*");
193
+ };
194
+ smoCallBacks.prototype.exitInteractivity = function () {
195
+ //Para canales interactivos, vuelve al canal de reposo. Solo Android y Player PC.
196
+ window.parent.postMessage({
197
+ target: "Dnv.smoCallbacks.exitInteractivity",
198
+ objData: undefined,
199
+ idSmo: this.smo.id
200
+ }, "*");
201
+ };
202
+ smoCallBacks.prototype.showBrowser = function () {
203
+ /* DEPRECATED NOT IMPLEMENTED */
204
+ };
205
+ smoCallBacks.prototype.closeBrowser = function () {
206
+ /* DEPRECATED NOT IMPLEMENTED */
207
+ };
208
+ smoCallBacks.prototype.urlNextDirectamente = function () {
209
+ /* NOT IMPLEMENTED */
210
+ };
211
+ smoCallBacks.prototype.setVariable = function (variable, valor) {
212
+ window.parent.postMessage({
213
+ target: "Dnv.smoCallbacks.setVariable",
214
+ objData: {
215
+ variable: variable,
216
+ valor: valor
217
+ },
218
+ idSmo: this.smo.id
219
+ }, "*");
220
+ };
221
+ smoCallBacks.prototype.getVariable = function (variable) {
222
+ window.parent.postMessage({
223
+ target: "Dnv.smoCallbacks.getVariable",
224
+ objData: {
225
+ variable: variable
226
+ },
227
+ idSmo: this.smo.id
228
+ }, "*");
229
+ /* MIRAR SMO.getVariable */
230
+ };
231
+ smoCallBacks.prototype.getFile = function (file) {
232
+ parent.postMessage({
233
+ target: "Dnv.smoCallbacks.getFile",
234
+ objData: file,
235
+ idSmo: this.smo.id
236
+ }, "*");
237
+ };
238
+ smoCallBacks.prototype.setLocalData = function (variable, valor) {
239
+ parent.postMessage({
240
+ target: "Dnv.smoCallbacks.setLocalData",
241
+ objData: {
242
+ nameData: variable,
243
+ data: valor
244
+ },
245
+ idSmo: this.smo.id
246
+ }, "*");
247
+ };
248
+ smoCallBacks.prototype.getLocalData = function (variable) {
249
+ parent.postMessage({
250
+ target: "Dnv.smoCallbacks.getLocalData",
251
+ objData: variable,
252
+ idSmo: this.smo.id
253
+ }, "*");
254
+ /* MIRAR SMO.setDatasource */
255
+ };
256
+ smoCallBacks.prototype.getCurrentStream = function () {
257
+ parent.postMessage({
258
+ target: "Dnv.smoCallbacks.getCurrentStream",
259
+ objData: undefined,
260
+ idSmo: this.smo.id
261
+ }, "*");
262
+ /* MIRAR SMO.setCurrentStream' */
263
+ };
264
+ smoCallBacks.prototype.finAviso = function (id) {
265
+ parent.postMessage({
266
+ target: "Dnv.smoCallbacks.finAviso",
267
+ objData: id,
268
+ idSmo: this.smo.id
269
+ }, "*");
270
+ };
271
+ smoCallBacks.prototype.refreshDatasource = function (codigo) {
272
+ parent.postMessage({
273
+ target: "Dnv.smoCallbacks.refreshDatasource",
274
+ objData: codigo,
275
+ idSmo: this.smo.id
276
+ }, "*");
277
+ };
278
+ smoCallBacks.prototype.getLocation = function () {
279
+ parent.postMessage({
280
+ target: "Dnv.smoCallbacks.getLocation",
281
+ objData: undefined,
282
+ idSmo: this.smo.id
283
+ }, "*");
284
+ /* MIRAR SMO.infoCurrentLocation */
285
+ };
286
+ smoCallBacks.prototype.getSalidaData = function (data) {
287
+ parent.postMessage({
288
+ target: "Dnv.smoCallbacks.getSalidaData",
289
+ objData: data,
290
+ idSmo: this.smo.id
291
+ }, "*");
292
+ /* MIRAR SMO.setSalidaData */
293
+ };
294
+ smoCallBacks.prototype.ejecutaFuncion = function (data) {
295
+ /*data ={
296
+ funcion: "", // Nombre de la función que se debe ejecutar
297
+ params: "" // Parámetros que debemos enviarle a la funcion. sin separadores ni nada, un string y se usa como tal. Solo esta implementada en un caso y se usa como tal sin parsear ni nada
298
+ } */
299
+ parent.postMessage({
300
+ target: "Dnv.smoCallbacks.ejecutaFuncion",
301
+ objData: data,
302
+ idSmo: this.smo.id
303
+ }, "*");
304
+ };
305
+ smoCallBacks.prototype.addObserver = function (data) {
306
+ /*data ="fruta"
307
+ */
308
+ parent.postMessage({
309
+ target: "Dnv.smoCallbacks.addObserver",
310
+ objData: data,
311
+ idSmo: this.smo.id
312
+ }, "*");
313
+ };
314
+ smoCallBacks.prototype.notify = function (data) {
315
+ /*data ={
316
+ destino: "fruta",
317
+ value: "{'fruta':'manzana', 'color':'roja'}"
318
+ } */
319
+ parent.postMessage({
320
+ target: "Dnv.smoCallbacks.notify",
321
+ objData: data,
322
+ idSmo: this.smo.id
323
+ }, "*");
324
+ };
325
+ smoCallBacks.prototype.playOnceChannelByTrigger = function (trigger) {
326
+ parent.postMessage({
327
+ target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
328
+ objData: { triggerCanal: trigger },
329
+ idSmo: this.smo.id
330
+ }, "*");
331
+ };
332
+ smoCallBacks.prototype.stopPlayOnceChannelByTrigger = function () {
333
+ parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannelByTrigger", objData: {}, idSmo: this.smo.id }, "*");
334
+ };
335
+ smoCallBacks.prototype.playOnceChannel = function (codigoCanal) {
336
+ parent.postMessage({ target: "Dnv.smoCallbacks.playOnceChannel", objData: { codigoCanal: codigoCanal, params: "PLAYONCE_CHANNEL|" + codigoCanal }, idSmo: this.smo.id }, "*");
337
+ };
338
+ smoCallBacks.prototype.stopPlayChannel = function () {
339
+ parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannel", objData: {}, idSmo: this.smo.id }, "*");
340
+ };
341
+ return smoCallBacks;
342
+ }());
343
+ var Utils = /** @class */ (function () {
344
+ function Utils(_smo, _smoCallBacks) {
345
+ this.smo = _smo;
346
+ this.smoCallBacks = _smoCallBacks;
347
+ }
348
+ Utils.prototype.dataToJSON = function (data) {
349
+ try {
350
+ var parser = new DOMParser();
351
+ var xmlDoc = parser.parseFromString(data.xml, "text/xml");
352
+ var dataForJSON = xmlDoc.getElementsByTagName("item")[0].innerHTML;
353
+ dataForJSON = dataForJSON.replace(/{'/g, '{"').replace(/'}/g, '"}').replace(/:'/g, ':"').replace(/':/g, '":').replace(/,'/g, ',"').replace(/',/g, '",').replace(/\['/g, '["').replace(/'\]/g, '"]').replace(/(\r\n|\n|\r)/gm, "");
354
+ return JSON.parse(dataForJSON);
355
+ }
356
+ catch (error) {
357
+ return {};
358
+ }
359
+ };
360
+ Utils.prototype.getDatasource = function () {
361
+ if (this.smo.vars.url == undefined) {
362
+ this.smoCallBacks.getFile(this.smo.vars.LocalData);
363
+ return;
364
+ }
365
+ this.smoCallBacks.getFile(this.smo.vars.url);
366
+ };
367
+ Utils.prototype.startCheckDatasource = function () {
368
+ this.getDatasource();
369
+ var self = this;
370
+ setInterval(function () {
371
+ self.getDatasource();
372
+ }, 10000);
373
+ };
374
+ return Utils;
375
+ }());
376
+ var SMO_EVENT_TYPE;
377
+ (function (SMO_EVENT_TYPE) {
378
+ SMO_EVENT_TYPE["start"] = "start";
379
+ SMO_EVENT_TYPE["setDatasource"] = "setDatasource";
380
+ SMO_EVENT_TYPE["getVariable"] = "getVariable";
381
+ SMO_EVENT_TYPE["setCurrentStream"] = "setCurrentStream";
382
+ SMO_EVENT_TYPE["infoCurrentLocation"] = "infoCurrentLocation";
383
+ SMO_EVENT_TYPE["setSalidaData"] = "setSalidaData";
384
+ SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
385
+ })(SMO_EVENT_TYPE = exports.SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = {}));
386
+ /* start():void{
387
+ this.emit("start");
388
+ }
389
+ setDatasource(datasource:setDatasource):void {
390
+ this.emit("setDatasource",datasource);
391
+ }
392
+ getVariable(variable:variable):void{
393
+ this.emit("getVariable",variable);
394
+ }
395
+ setCurrentStream(stream:string):void{
396
+ this.emit("setCurrentStream",stream);
397
+ }
398
+ infoCurrentLocation(location:location):void{
399
+ this.emit("infoCurrentLocation",location);
400
+ }
401
+ setSalidaData(data:DataSalida):void{
402
+ this.emit("setSalidaData",data);
403
+ }
404
+
405
+ updatefromsalida(data:any):void{
406
+ this.emit("updatefromsalida",data);
407
+ } */
408
+ var LogLevel;
409
+ (function (LogLevel) {
410
+ LogLevel[LogLevel["Debug"] = 0] = "Debug";
411
+ LogLevel[LogLevel["Info"] = 1] = "Info";
412
+ LogLevel[LogLevel["Warning"] = 2] = "Warning";
413
+ LogLevel[LogLevel["Error"] = 3] = "Error";
414
+ })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
415
+ var AlarmaLevel;
416
+ (function (AlarmaLevel) {
417
+ AlarmaLevel[AlarmaLevel["Ok_off"] = 0] = "Ok_off";
418
+ AlarmaLevel[AlarmaLevel["Ok"] = 1] = "Ok";
419
+ AlarmaLevel[AlarmaLevel["Scanning"] = 2] = "Scanning";
420
+ AlarmaLevel[AlarmaLevel["Timeout"] = 3] = "Timeout";
421
+ AlarmaLevel[AlarmaLevel["Warning"] = 4] = "Warning";
422
+ AlarmaLevel[AlarmaLevel["Error"] = 5] = "Error";
423
+ })(AlarmaLevel = exports.AlarmaLevel || (exports.AlarmaLevel = {}));
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@denevads/dnv-smo",
3
+ "version": "1.0.0",
4
+ "description": "SMO module",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc"
9
+ },
10
+ "compilerOptions": {
11
+ "outDir": "./dist",
12
+ "types": []
13
+ },
14
+ "keywords": [],
15
+ "author": "Xavier",
16
+ "license": "MIT",
17
+ "devDependencies": {
18
+ "@types/node": "^17.0.42"
19
+ }
20
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./";
@@ -0,0 +1,33 @@
1
+
2
+ export interface setDatasource{
3
+ xml:string
4
+ }
5
+ export interface variable{
6
+ variable:string,
7
+ valor:string
8
+ }
9
+ export interface location{
10
+ top:string,
11
+ left:string,
12
+ width:string,
13
+ height:string
14
+ }
15
+ export interface Slide {
16
+ codigo: string;
17
+ idioma: string;
18
+ denominacion: string;
19
+ hash: string;
20
+ }
21
+
22
+ export interface DataSalida {
23
+ dataKey: string;
24
+ data: Slide[];
25
+ }
26
+ export interface ExecFunction{
27
+ funcion:string,
28
+ params:string
29
+ }
30
+ export interface Notify{
31
+ destion:string,
32
+ value:any
33
+ }
package/src/smo.ts ADDED
@@ -0,0 +1,414 @@
1
+ import {EventEmitter} from 'events';
2
+ import { setDatasource,variable,location,DataSalida, ExecFunction, Notify } from "./interfaces/callbacks";
3
+
4
+ export class SMO extends EventEmitter{
5
+ public vars:any = {};
6
+ public id:string ="";
7
+ public smoCallBacks:smoCallBacks;
8
+ public utils:Utils;
9
+ constructor(){
10
+ super();
11
+ this.init();
12
+ this.initOnMessage();
13
+ this.smoCallBacks = new smoCallBacks(this);
14
+ this.utils = new Utils(this,this.smoCallBacks);
15
+ }
16
+ public init():void{
17
+ let match,
18
+ pl = /\+/g,
19
+ search = /([^&=]+)=?([^&]*)/g,
20
+ decode = function(s:string) {
21
+ return decodeURIComponent(s.replace(pl, " "));
22
+ },
23
+ query = window.location.search.substring(1);
24
+ while (match = search.exec(query)) {
25
+ this.vars[decode(match[1])] = decode(match[2]);
26
+ }
27
+
28
+ if (this.vars.idSmo) {
29
+ this.id = this.vars.idSmo;
30
+ return;
31
+ }
32
+ console.warn("No idSmo found in URL");
33
+ }
34
+ initOnMessage():void{
35
+ let selft = this;
36
+ window.onmessage = function(e) {
37
+ if (e.data.target) {
38
+ var targets = e.data.target.split('.');
39
+ var func = targets[targets.length-1];
40
+ if(func == SMO_EVENT_TYPE.start){
41
+ selft.start();
42
+ return;
43
+ }
44
+ if(func == SMO_EVENT_TYPE.setDatasource){
45
+ selft.setDatasource(e.data.objData);
46
+ return;
47
+ }
48
+ if(func == SMO_EVENT_TYPE.getVariable){
49
+ selft.getVariable(e.data.objData);
50
+ return;
51
+ }
52
+ if(func ==SMO_EVENT_TYPE.setCurrentStream){
53
+ selft.setCurrentStream(e.data.objData);
54
+ return;
55
+ }
56
+ if(func==SMO_EVENT_TYPE.infoCurrentLocation){
57
+ selft.infoCurrentLocation(e.data.objData);
58
+ return;
59
+ }
60
+ if(func==SMO_EVENT_TYPE.setSalidaData){
61
+ selft.setSalidaData(e.data.objData);
62
+ return;
63
+ }
64
+ if(func ==SMO_EVENT_TYPE.updatefromsalida){
65
+ selft.updatefromsalida(e.data.objdata);
66
+ return;
67
+ }
68
+ console.warn("message not implemented!!" +func);
69
+ /* try {
70
+ var targets = e.data.target.split('.');
71
+ var fn = window;
72
+ var obj = window;
73
+ for (var i = 0; i < targets.length; i++) {
74
+ obj = fn;
75
+ fn = obj[targets[i]];
76
+ }
77
+ fn.call(obj, e.data.objData); // conservamos el valor de this
78
+ } catch (ex) {
79
+ //Si no ha podido llamar es porque no existe el entorno
80
+
81
+ }*/
82
+ }
83
+ }
84
+ }
85
+ start():void{
86
+ this.emit(SMO_EVENT_TYPE.start);
87
+ }
88
+ setDatasource(datasource:setDatasource):void {
89
+ this.emit(SMO_EVENT_TYPE.setDatasource,datasource);
90
+ }
91
+ getVariable(variable:variable):void{
92
+ this.emit(SMO_EVENT_TYPE.getVariable,variable);
93
+ }
94
+ setCurrentStream(stream:string):void{
95
+ this.emit(SMO_EVENT_TYPE.setCurrentStream,stream);
96
+ }
97
+ infoCurrentLocation(location:location):void{
98
+ this.emit(SMO_EVENT_TYPE.infoCurrentLocation,location);
99
+ }
100
+ setSalidaData(data:DataSalida):void{
101
+ this.emit(SMO_EVENT_TYPE.setSalidaData,data);
102
+ }
103
+
104
+ updatefromsalida(data:any):void{
105
+ this.emit(SMO_EVENT_TYPE.updatefromsalida,data);
106
+ }
107
+
108
+ }
109
+ class smoCallBacks{
110
+ smo:SMO;
111
+ constructor(_smo:SMO){
112
+ this.smo =_smo;
113
+ }
114
+ public onSmoLoad():void {
115
+
116
+ window.parent.postMessage({
117
+ target: "Dnv.smoCallbacks.onSmoLoad",
118
+ objData: undefined,
119
+ idSmo: this.smo.id
120
+ }, "*");
121
+ }
122
+ public onSmoReady():void {
123
+ window.parent.postMessage({
124
+ target: "Dnv.smoCallbacks.onSmoReady",
125
+ objData: undefined,
126
+ idSmo: this.smo.id
127
+ }, "*");
128
+ }
129
+ public smoLog(msn:string, level:LogLevel):void {
130
+ if (level == undefined) {
131
+ level = LogLevel.Info;
132
+ }
133
+ //level = Dnv.LogLevel.Debug...
134
+ if (level == LogLevel.Debug) {
135
+ console.debug(msn);
136
+ }
137
+ if (level == LogLevel.Info) {
138
+ console.log(msn);
139
+ }
140
+ if (level == LogLevel.Warning) {
141
+ console.warn(msn);
142
+ }
143
+ if (level == LogLevel.Error) {
144
+ console.error(msn);
145
+ }
146
+ if (window.parent != window) {
147
+ window.parent.postMessage({
148
+ target: "Dnv.smoCallbacks.smoLog",
149
+ objData: {
150
+ level: level,
151
+ txt: msn
152
+ },
153
+ idSmo: this.smo.id
154
+ }, "*");
155
+ }
156
+
157
+ }
158
+ public smoAlarma(msn:string, level:AlarmaLevel):void {
159
+ window.parent.postMessage({
160
+ target: "Dnv.smoCallbacks.smoAlarma",
161
+ objData: {
162
+ level: level,
163
+ txt: msn
164
+ },
165
+ idSmo: this.smo.id
166
+ }, "*");
167
+ }
168
+ public reiniciarDispositivo(msn:string):void {
169
+ //Permite reiniciar el player, proporcionando una razón para el reinicio. Solo Player HTML5
170
+ window.parent.postMessage({
171
+ target: "Dnv.smoCallbacks.reiniciarDispositivo",
172
+ objData: {
173
+ txt: msn // Razón del reinicio
174
+ },
175
+ idSmo: this.smo.id
176
+ }, "*");
177
+ }
178
+ urlNext():void {
179
+ //Permite avanzar plantilla. Solo si Reloj Maestro activado.
180
+ window.parent.postMessage({
181
+ target: "Dnv.smoCallbacks.urlNext",
182
+ objData: undefined,
183
+ idSmo: this.smo.id
184
+ }, "*");
185
+ }
186
+ exitInteractivity():void {
187
+ //Para canales interactivos, vuelve al canal de reposo. Solo Android y Player PC.
188
+ window.parent.postMessage({
189
+ target: "Dnv.smoCallbacks.exitInteractivity",
190
+ objData: undefined,
191
+ idSmo: this.smo.id
192
+ }, "*");
193
+ }
194
+ showBrowser():void {
195
+ /* DEPRECATED NOT IMPLEMENTED */
196
+ }
197
+ closeBrowser():void {
198
+ /* DEPRECATED NOT IMPLEMENTED */
199
+ }
200
+ urlNextDirectamente():void {
201
+ /* NOT IMPLEMENTED */
202
+ }
203
+ setVariable(variable:string, valor:string) {
204
+ window.parent.postMessage({
205
+ target: "Dnv.smoCallbacks.setVariable",
206
+ objData: {
207
+ variable: variable,
208
+ valor: valor
209
+ },
210
+ idSmo: this.smo.id
211
+ }, "*");
212
+ }
213
+ getVariable(variable:string):void {
214
+ window.parent.postMessage({
215
+ target: "Dnv.smoCallbacks.getVariable",
216
+ objData: {
217
+ variable: variable
218
+ },
219
+ idSmo: this.smo.id
220
+ }, "*");
221
+ /* MIRAR SMO.getVariable */
222
+ }
223
+ getFile(file:string):void {
224
+ parent.postMessage({
225
+ target: "Dnv.smoCallbacks.getFile",
226
+ objData: file,
227
+ idSmo: this.smo.id
228
+ }, "*");
229
+ }
230
+ setLocalData(variable:string, valor:string):void {
231
+ parent.postMessage({
232
+ target: "Dnv.smoCallbacks.setLocalData",
233
+ objData: {
234
+ nameData: variable,
235
+ data: valor
236
+ },
237
+ idSmo: this.smo.id
238
+ }, "*");
239
+ }
240
+ getLocalData(variable:string):void {
241
+ parent.postMessage({
242
+ target: "Dnv.smoCallbacks.getLocalData",
243
+ objData: variable, // nameData
244
+ idSmo: this.smo.id
245
+ }, "*");
246
+ /* MIRAR SMO.setDatasource */
247
+ }
248
+ getCurrentStream():void {
249
+
250
+ parent.postMessage({
251
+ target: "Dnv.smoCallbacks.getCurrentStream",
252
+ objData: undefined,
253
+ idSmo: this.smo.id
254
+ }, "*");
255
+ /* MIRAR SMO.setCurrentStream' */
256
+ }
257
+ finAviso(id:string):void {
258
+ parent.postMessage({
259
+ target: "Dnv.smoCallbacks.finAviso",
260
+ objData: id, // id del aviso
261
+ idSmo: this.smo.id
262
+ }, "*");
263
+ }
264
+ refreshDatasource(codigo:string):void {
265
+ parent.postMessage({
266
+ target: "Dnv.smoCallbacks.refreshDatasource",
267
+ objData: codigo, // Codigo del datasource
268
+ idSmo: this.smo.id
269
+ }, "*");
270
+ }
271
+ getLocation():void {
272
+ parent.postMessage({
273
+ target: "Dnv.smoCallbacks.getLocation",
274
+ objData: undefined,
275
+ idSmo: this.smo.id
276
+ }, "*");
277
+ /* MIRAR SMO.infoCurrentLocation */
278
+ }
279
+ getSalidaData(data:string):void {
280
+ parent.postMessage({
281
+ target: "Dnv.smoCallbacks.getSalidaData",
282
+ objData: data, // Nombre del "data" que solicita. El player recibe ese string y hace un select case del mismo para devolver un json con datos al smo\html5 que le ha invocado.
283
+ idSmo: this.smo.id
284
+ }, "*");
285
+ /* MIRAR SMO.setSalidaData */
286
+ }
287
+ ejecutaFuncion(data:ExecFunction):void {
288
+ /*data ={
289
+ funcion: "", // Nombre de la función que se debe ejecutar
290
+ params: "" // Parámetros que debemos enviarle a la funcion. sin separadores ni nada, un string y se usa como tal. Solo esta implementada en un caso y se usa como tal sin parsear ni nada
291
+ } */
292
+ parent.postMessage({
293
+ target: "Dnv.smoCallbacks.ejecutaFuncion",
294
+ objData: data,
295
+ idSmo: this.smo.id
296
+ }, "*");
297
+ }
298
+ addObserver(data:string):void {
299
+ /*data ="fruta"
300
+ */
301
+ parent.postMessage({
302
+ target: "Dnv.smoCallbacks.addObserver",
303
+ objData: data,
304
+ idSmo: this.smo.id
305
+ }, "*");
306
+ }
307
+ notify(data:Notify):void {
308
+ /*data ={
309
+ destino: "fruta",
310
+ value: "{'fruta':'manzana', 'color':'roja'}"
311
+ } */
312
+ parent.postMessage({
313
+ target: "Dnv.smoCallbacks.notify",
314
+ objData: data,
315
+ idSmo: this.smo.id
316
+
317
+ }, "*");
318
+ }
319
+ playOnceChannelByTrigger(trigger:string):void {
320
+ parent.postMessage({
321
+ target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
322
+ objData: { triggerCanal: trigger },
323
+ idSmo: this.smo.id
324
+ }, "*");
325
+ }
326
+ stopPlayOnceChannelByTrigger():void {
327
+ parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannelByTrigger", objData: {}, idSmo: this.smo.id }, "*");
328
+ }
329
+ playOnceChannel(codigoCanal:string):void {
330
+ parent.postMessage({ target: "Dnv.smoCallbacks.playOnceChannel", objData: { codigoCanal: codigoCanal, params: "PLAYONCE_CHANNEL|" + codigoCanal }, idSmo: this.smo.id }, "*");
331
+ }
332
+ stopPlayChannel():void {
333
+ parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannel", objData: {}, idSmo: this.smo.id }, "*");
334
+ }
335
+ }
336
+ class Utils{
337
+ smo:SMO;
338
+ smoCallBacks:smoCallBacks;
339
+ constructor(_smo:SMO,_smoCallBacks:smoCallBacks){
340
+ this.smo = _smo;
341
+ this.smoCallBacks =_smoCallBacks;
342
+ }
343
+ dataToJSON(data:setDatasource):any {
344
+ try {
345
+ var parser = new DOMParser();
346
+ var xmlDoc = parser.parseFromString(data.xml, "text/xml");
347
+ var dataForJSON = xmlDoc.getElementsByTagName("item")[0].innerHTML;
348
+ dataForJSON = dataForJSON.replace(/{'/g, '{"').replace(/'}/g, '"}').replace(/:'/g, ':"').replace(/':/g, '":').replace(/,'/g, ',"').replace(/',/g, '",').replace(/\['/g, '["').replace(/'\]/g, '"]').replace(/(\r\n|\n|\r)/gm, "");
349
+ return JSON.parse(dataForJSON);
350
+ } catch (error) {
351
+ return {};
352
+ }
353
+ }
354
+ getDatasource():void{
355
+ if(this.smo.vars.url == undefined){
356
+ this.smoCallBacks.getFile(this.smo.vars.LocalData);
357
+ return;
358
+ }
359
+ this.smoCallBacks.getFile(this.smo.vars.url);
360
+
361
+ }
362
+ startCheckDatasource():void{
363
+ this.getDatasource();
364
+ let self = this;
365
+ setInterval(function() {
366
+ self.getDatasource();
367
+ }, 10000);
368
+ }
369
+ }
370
+ export enum SMO_EVENT_TYPE{
371
+ start = "start",
372
+ setDatasource = "setDatasource",
373
+ getVariable = "getVariable",
374
+ setCurrentStream = "setCurrentStream",
375
+ infoCurrentLocation = "infoCurrentLocation",
376
+ setSalidaData ="setSalidaData",
377
+ updatefromsalida = "updatefromsalida"
378
+ }
379
+ /* start():void{
380
+ this.emit("start");
381
+ }
382
+ setDatasource(datasource:setDatasource):void {
383
+ this.emit("setDatasource",datasource);
384
+ }
385
+ getVariable(variable:variable):void{
386
+ this.emit("getVariable",variable);
387
+ }
388
+ setCurrentStream(stream:string):void{
389
+ this.emit("setCurrentStream",stream);
390
+ }
391
+ infoCurrentLocation(location:location):void{
392
+ this.emit("infoCurrentLocation",location);
393
+ }
394
+ setSalidaData(data:DataSalida):void{
395
+ this.emit("setSalidaData",data);
396
+ }
397
+
398
+ updatefromsalida(data:any):void{
399
+ this.emit("updatefromsalida",data);
400
+ } */
401
+ export enum LogLevel {
402
+ Debug= 0,
403
+ Info= 1,
404
+ Warning= 2,
405
+ Error= 3
406
+ }
407
+ export enum AlarmaLevel {
408
+ Ok_off= 0,
409
+ Ok= 1,
410
+ Scanning= 2,
411
+ Timeout= 3,
412
+ Warning= 4,
413
+ Error= 5
414
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,106 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Enable incremental compilation */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+ "declaration": true,
13
+ /* Language and Environment */
14
+ "target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
22
+ // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+
26
+ /* Modules */
27
+ "module": "commonjs", /* Specify what module code is generated. */
28
+ // "rootDir": "./", /* Specify the root folder within your source files. */
29
+ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
30
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
32
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
33
+ // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
34
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
35
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
36
+ // "resolveJsonModule": true, /* Enable importing .json files */
37
+ // "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
38
+
39
+ /* JavaScript Support */
40
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
41
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
42
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
43
+
44
+ /* Emit */
45
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
46
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
47
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
48
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
49
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
50
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
51
+ // "removeComments": true, /* Disable emitting comments. */
52
+ // "noEmit": true, /* Disable emitting files from a compilation. */
53
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
54
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
55
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
56
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
57
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
58
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
59
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
60
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
61
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
62
+ // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
63
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
64
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
65
+ // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
66
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
67
+
68
+ /* Interop Constraints */
69
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
70
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
71
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
72
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
73
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
74
+
75
+ /* Type Checking */
76
+ "strict": true, /* Enable all strict type-checking options. */
77
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
78
+ // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
79
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
80
+ // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
81
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
82
+ // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
83
+ // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
84
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
85
+ // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
86
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
87
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
88
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
89
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
90
+ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
91
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
92
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
93
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
94
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
95
+
96
+ /* Completeness */
97
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
98
+ "skipLibCheck": false /* Skip type checking all .d.ts files. */
99
+ },
100
+ "include": [
101
+ "./src/**/*",
102
+ ],
103
+ "exclude":[
104
+ "node_modules"
105
+ ]
106
+ }