@ygracs/xepg-lib-js 0.0.26-b → 0.0.30
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.
- package/CHANGELOG.md +16 -3
- package/README.md +4 -2
- package/doc/xepgdoc-lib.md +67 -55
- package/index.d.ts +27 -21
- package/index.js +13 -3
- package/lib/dts-helper.d.ts +53 -37
- package/lib/dts-helper.js +73 -42
- package/lib/xepg-channel.d.ts +91 -0
- package/lib/xepg-channel.js +308 -0
- package/lib/xepg-defs.d.ts +67 -0
- package/lib/xepg-defs.js +88 -0
- package/lib/xepg-sched.d.ts +231 -0
- package/lib/xepg-sched.js +587 -0
- package/lib/xepgdoc-lib.d.ts +338 -596
- package/lib/xepgdoc-lib.js +306 -1106
- package/lib/xml-base.d.ts +40 -21
- package/lib/xml-base.js +98 -23
- package/package.json +11 -8
- /package/doc/{xepgdoc-example.xepg → xepgdoc-example-s02.xepg} +0 -0
- /package/doc/{xepgdoc-spec.md → xepgdoc-spec-02.md} +0 -0
package/lib/xepgdoc-lib.d.ts
CHANGED
|
@@ -1,596 +1,338 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* -
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* -
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
export
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
*
|
|
156
|
-
*/
|
|
157
|
-
get curDocTZ(): number;
|
|
158
|
-
set curDocTZ(value: number);
|
|
159
|
-
/**
|
|
160
|
-
*
|
|
161
|
-
* @since 0.0.22
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
*
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*
|
|
248
|
-
*/
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
*
|
|
252
|
-
* @
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*
|
|
272
|
-
* @
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
*
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
*
|
|
282
|
-
* @
|
|
283
|
-
* @
|
|
284
|
-
*/
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
*
|
|
288
|
-
* @
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
*
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
*
|
|
313
|
-
*/
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Contains a provider name
|
|
341
|
-
*/
|
|
342
|
-
get name(): string;
|
|
343
|
-
set name(value: string);
|
|
344
|
-
/**
|
|
345
|
-
* Contains a version of a provider
|
|
346
|
-
*/
|
|
347
|
-
get version(): string;
|
|
348
|
-
set version(value: string);
|
|
349
|
-
/**
|
|
350
|
-
* Contains a version of a document schema
|
|
351
|
-
*/
|
|
352
|
-
get schema(): string;
|
|
353
|
-
set schema(value: string);
|
|
354
|
-
/**
|
|
355
|
-
* Contains a document type
|
|
356
|
-
*/
|
|
357
|
-
get doctype(): string;
|
|
358
|
-
set doctype(value: string);
|
|
359
|
-
/**
|
|
360
|
-
* Sets a provider name
|
|
361
|
-
*/
|
|
362
|
-
setName(value: string): boolean;
|
|
363
|
-
/**
|
|
364
|
-
* Returns a provider info item
|
|
365
|
-
*/
|
|
366
|
-
getInfo(): xepgProvInfoDesc;
|
|
367
|
-
/**
|
|
368
|
-
* Sets a provider info
|
|
369
|
-
* @todo [since v0.0.21] deprecate use of `obj`-param as array
|
|
370
|
-
*/
|
|
371
|
-
setInfo(obj: string[] | xepgProvInfoDesc): void;
|
|
372
|
-
/**
|
|
373
|
-
* Sets an initial instance state
|
|
374
|
-
*/
|
|
375
|
-
init(opt?: xepgProvInfoDesc | string[]): void;
|
|
376
|
-
/**
|
|
377
|
-
* Returns an instance content as a string in an XML-format.
|
|
378
|
-
* @since v0.0.20
|
|
379
|
-
*/
|
|
380
|
-
saveToXMLString(): string;
|
|
381
|
-
/**
|
|
382
|
-
* Loads a element content from a string.
|
|
383
|
-
* @since v0.0.24
|
|
384
|
-
* @throws {Error}
|
|
385
|
-
* @experimental
|
|
386
|
-
*/
|
|
387
|
-
loadFromXMLString(xmlString: string): boolean;
|
|
388
|
-
#private;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* @since 0.0.22
|
|
393
|
-
* @classdesc This class implements an interface of a channel element
|
|
394
|
-
*/
|
|
395
|
-
export class TXEpgChannelContainer {
|
|
396
|
-
/**
|
|
397
|
-
* Creates an instance of the channel element
|
|
398
|
-
*/
|
|
399
|
-
constructor(obj: object, opt?: OPT_epgelsett_bs);
|
|
400
|
-
/**
|
|
401
|
-
* Contains a channel ID
|
|
402
|
-
*/
|
|
403
|
-
get id(): string;
|
|
404
|
-
/**
|
|
405
|
-
* Contains a channel name
|
|
406
|
-
*/
|
|
407
|
-
get name(): string;
|
|
408
|
-
set name(value: string);
|
|
409
|
-
/**
|
|
410
|
-
* Contains a channel Group ID
|
|
411
|
-
*/
|
|
412
|
-
get gid(): string;
|
|
413
|
-
set gid(value: string);
|
|
414
|
-
/**
|
|
415
|
-
* Contains a channel source URL
|
|
416
|
-
*/
|
|
417
|
-
get url(): string;
|
|
418
|
-
set url(value: string);
|
|
419
|
-
/**
|
|
420
|
-
* Tries to set a channel ID
|
|
421
|
-
*/
|
|
422
|
-
setID(value: string): boolean;
|
|
423
|
-
/**
|
|
424
|
-
* Returns a channel info
|
|
425
|
-
*/
|
|
426
|
-
getInfo(): xepgChnInfoDesc;
|
|
427
|
-
/**
|
|
428
|
-
* Sets a channel info
|
|
429
|
-
*/
|
|
430
|
-
setInfo(obj: string | xepgChnInfoDesc): void;
|
|
431
|
-
#private;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @classdesc This class implements an interface of a EPG-header element
|
|
436
|
-
*/
|
|
437
|
-
export class TXEpgHeaderContainer {
|
|
438
|
-
/**
|
|
439
|
-
* Creates an instance of the EPG-header element
|
|
440
|
-
*/
|
|
441
|
-
constructor(obj: object, opt?: OPT_epgelsett_bs);
|
|
442
|
-
/**
|
|
443
|
-
* Returns a `TXEpgDTSProvider` instance
|
|
444
|
-
*/
|
|
445
|
-
get dts(): TXEpgDTSProvider;
|
|
446
|
-
/**
|
|
447
|
-
* Contains a dtstype ID
|
|
448
|
-
* @todo [since v0.0.22] becomes readonly
|
|
449
|
-
*/
|
|
450
|
-
get dtstype(): number;
|
|
451
|
-
set dtstype(value: number);
|
|
452
|
-
/**
|
|
453
|
-
* Contains a TZ-offset
|
|
454
|
-
* @todo [since v0.0.22] becomes readonly
|
|
455
|
-
*/
|
|
456
|
-
get curDocTZ(): number;
|
|
457
|
-
set curDocTZ(value: number);
|
|
458
|
-
/**
|
|
459
|
-
* Returns a `TXEpgProviderContainer` instance
|
|
460
|
-
* @since 0.0.22
|
|
461
|
-
*/
|
|
462
|
-
get provider(): TXEpgProviderContainer | null;
|
|
463
|
-
/**
|
|
464
|
-
* Returns a `TXEpgChannelContainer` instance
|
|
465
|
-
* @since 0.0.22
|
|
466
|
-
*/
|
|
467
|
-
get channel(): TXEpgChannelContainer | null;
|
|
468
|
-
/**
|
|
469
|
-
* Returns a document creation date as a timestamp
|
|
470
|
-
*/
|
|
471
|
-
getDocumentDT(): number;
|
|
472
|
-
/**
|
|
473
|
-
* Sets a document creation date to a current system time
|
|
474
|
-
*/
|
|
475
|
-
setDocumentDT(): void;
|
|
476
|
-
/**
|
|
477
|
-
* Returns a document expire date as a timestamp
|
|
478
|
-
*/
|
|
479
|
-
getDocumentEDT(): number;
|
|
480
|
-
/**
|
|
481
|
-
* Sets a document expire date to a given time
|
|
482
|
-
*/
|
|
483
|
-
setDocumentEDT(value: any): void;
|
|
484
|
-
/**
|
|
485
|
-
* Returns a channel info
|
|
486
|
-
*/
|
|
487
|
-
getChannelInfo(): xepgChnInfoDesc;
|
|
488
|
-
/**
|
|
489
|
-
* Sets a channel info
|
|
490
|
-
* @deprecated
|
|
491
|
-
* @todo [since v0.0.22] deprecated. Use `TXEpgChannelContainer.setInfo`
|
|
492
|
-
*/
|
|
493
|
-
setChannelInfo(obj: xepgChnInfoDesc): void;
|
|
494
|
-
/**
|
|
495
|
-
* Returns a provider info
|
|
496
|
-
*/
|
|
497
|
-
getProviderInfo(): xepgProvInfoDesc | null;
|
|
498
|
-
/**
|
|
499
|
-
* Sets a provider info
|
|
500
|
-
* @deprecated
|
|
501
|
-
* @todo \[since `v0.0.24`] deprecated. Use `TXEpgProviderContainer.setInfo`
|
|
502
|
-
*/
|
|
503
|
-
setProviderInfo(obj: xepgProvInfoDesc): void;
|
|
504
|
-
/**
|
|
505
|
-
* Returns an instance content as a string in an XML-format.
|
|
506
|
-
* @since v0.0.20
|
|
507
|
-
*/
|
|
508
|
-
saveToXMLString(): string;
|
|
509
|
-
/**
|
|
510
|
-
* Loads an element content from a string.
|
|
511
|
-
* @since v0.0.24
|
|
512
|
-
* @throws {Error}
|
|
513
|
-
* @experimental
|
|
514
|
-
*/
|
|
515
|
-
loadFromXMLString(xmlString: string): boolean;
|
|
516
|
-
#private;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* @classdesc This class implements an interface of the container
|
|
521
|
-
* that manages a content of a XEPG-document
|
|
522
|
-
*/
|
|
523
|
-
export class TXEpgContentProvider {
|
|
524
|
-
/**
|
|
525
|
-
* Creates an instance of the XEPG-content provider
|
|
526
|
-
*/
|
|
527
|
-
constructor(opt?: OPT_epgcpsett);
|
|
528
|
-
/**
|
|
529
|
-
* Returns a `TXEpgHeaderContainer` instance
|
|
530
|
-
* @since 0.0.22
|
|
531
|
-
*/
|
|
532
|
-
get header(): TXEpgHeaderContainer | null;
|
|
533
|
-
/**
|
|
534
|
-
* Returns a `TXEpgProviderContainer` instance
|
|
535
|
-
* @since 0.0.22
|
|
536
|
-
*/
|
|
537
|
-
get provider(): TXEpgProviderContainer | null;
|
|
538
|
-
/**
|
|
539
|
-
* Returns a `TXEpgDTSProvider` instance
|
|
540
|
-
*/
|
|
541
|
-
get dts(): TXEpgDTSProvider | null;
|
|
542
|
-
/**
|
|
543
|
-
* @deprecated
|
|
544
|
-
*/
|
|
545
|
-
get Content(): this;
|
|
546
|
-
/**
|
|
547
|
-
* Returns a `TXEpgSchedulesList` instance
|
|
548
|
-
* @deprecated
|
|
549
|
-
* @todo \[since `v0.0.24`] deprecated. Use `TXEpgContentProvider.schedules`
|
|
550
|
-
*/
|
|
551
|
-
get SchedulesList(): TXEpgSchedulesList;
|
|
552
|
-
/**
|
|
553
|
-
* Returns a `TXEpgSchedulesList` instance
|
|
554
|
-
* @since 0.0.24
|
|
555
|
-
*/
|
|
556
|
-
get schedules(): TXEpgSchedulesList;
|
|
557
|
-
|
|
558
|
-
init(): void;
|
|
559
|
-
/**
|
|
560
|
-
* Returns a document content as a string in an XML-format.
|
|
561
|
-
*/
|
|
562
|
-
saveToXMLString(): string;
|
|
563
|
-
/**
|
|
564
|
-
* Saves a document content to a file.
|
|
565
|
-
* @throws {Error}
|
|
566
|
-
* @async
|
|
567
|
-
*/
|
|
568
|
-
saveToFile(source: string): Promise<fsoDescr>;
|
|
569
|
-
/**
|
|
570
|
-
* Saves a document content to a file.
|
|
571
|
-
*/
|
|
572
|
-
saveToFileSync(source: string): fsoDescr;
|
|
573
|
-
/**
|
|
574
|
-
* Loads a document content from a string.
|
|
575
|
-
* @since 0.0.18
|
|
576
|
-
* @throws {Error}
|
|
577
|
-
*/
|
|
578
|
-
loadFromXMLString(xmlString: string): boolean;
|
|
579
|
-
/**
|
|
580
|
-
* Loads a document content from a file.
|
|
581
|
-
* @throws {Error}
|
|
582
|
-
* @async
|
|
583
|
-
*/
|
|
584
|
-
loadFromFile(source: string): Promise<fsoDescr>;
|
|
585
|
-
/**
|
|
586
|
-
* Loads a document content from a file.
|
|
587
|
-
*/
|
|
588
|
-
loadFromFileSync(source: string): fsoDescr;
|
|
589
|
-
/**
|
|
590
|
-
* @protected
|
|
591
|
-
*/
|
|
592
|
-
protected asJSON(): string;
|
|
593
|
-
#private;
|
|
594
|
-
}
|
|
595
|
-
import { TXmlContentParseOptions } from "@ygracs/xobj-lib-js";
|
|
596
|
-
import { fsoDescr } from "@cntwg/file-helper";
|
|
1
|
+
/**
|
|
2
|
+
* A list of fields in order: `name`, `version`, `schema`, `doctype`
|
|
3
|
+
* @deprecated
|
|
4
|
+
*/
|
|
5
|
+
export type arrProviderInfo = [ name: string, version: string, schema: string, doctype: string ];
|
|
6
|
+
export const arrProviderInfo: arrProviderInfo;
|
|
7
|
+
/**
|
|
8
|
+
* A provider info descriptor
|
|
9
|
+
*/
|
|
10
|
+
export type IXEpgProvInfoDesc = {
|
|
11
|
+
/**
|
|
12
|
+
* - provider name
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
15
|
+
/**
|
|
16
|
+
* - provider version
|
|
17
|
+
*/
|
|
18
|
+
version?: string;
|
|
19
|
+
/**
|
|
20
|
+
* - document schema
|
|
21
|
+
*/
|
|
22
|
+
schema: string;
|
|
23
|
+
/**
|
|
24
|
+
* - document type
|
|
25
|
+
*/
|
|
26
|
+
doctype: string;
|
|
27
|
+
};
|
|
28
|
+
export const IXEpgProvInfoDesc: IXEpgProvInfoDesc;
|
|
29
|
+
/**
|
|
30
|
+
* An XEPG-element options set (base)
|
|
31
|
+
*/
|
|
32
|
+
export type OPT_epgelsett_bs = {
|
|
33
|
+
/**
|
|
34
|
+
* - parser options
|
|
35
|
+
*/
|
|
36
|
+
parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* An XEPG-element options set (base)
|
|
40
|
+
*/
|
|
41
|
+
export type XEpgElementConfigBase = {
|
|
42
|
+
/**
|
|
43
|
+
* - parser options
|
|
44
|
+
*/
|
|
45
|
+
parseOptions: InstanceType<typeof TXmlContentParseOptions>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An options set for `TXEpgContentProvider`-class
|
|
50
|
+
*/
|
|
51
|
+
export type OPT_epgcpsett = {
|
|
52
|
+
/**
|
|
53
|
+
* - parser options
|
|
54
|
+
*/
|
|
55
|
+
parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
|
|
56
|
+
/**
|
|
57
|
+
* - <*deprecated*>
|
|
58
|
+
*/
|
|
59
|
+
autoBindRoot?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* An options set for `TXEpgContentProvider`-class
|
|
63
|
+
*/
|
|
64
|
+
export type XEpgContainerConfig = {
|
|
65
|
+
/**
|
|
66
|
+
* - parser options
|
|
67
|
+
*/
|
|
68
|
+
parseOptions: InstanceType<typeof TXmlContentParseOptions>;
|
|
69
|
+
/**
|
|
70
|
+
* - <*deprecated*>
|
|
71
|
+
*/
|
|
72
|
+
autoBindRoot?: boolean | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* This class implements an interface of a EPG-provider element
|
|
77
|
+
*/
|
|
78
|
+
export class TXEpgProviderContainer {
|
|
79
|
+
/**
|
|
80
|
+
* Creates an instance of the EPG-provider element
|
|
81
|
+
*/
|
|
82
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
83
|
+
/**
|
|
84
|
+
* Contains a provider name
|
|
85
|
+
*/
|
|
86
|
+
get name(): string;
|
|
87
|
+
set name(value: string);
|
|
88
|
+
/**
|
|
89
|
+
* Contains a version of a provider
|
|
90
|
+
*/
|
|
91
|
+
get version(): string;
|
|
92
|
+
set version(value: string);
|
|
93
|
+
/**
|
|
94
|
+
* Contains a version of a document schema
|
|
95
|
+
*/
|
|
96
|
+
get schema(): string;
|
|
97
|
+
set schema(value: string);
|
|
98
|
+
/**
|
|
99
|
+
* Contains a document type
|
|
100
|
+
*/
|
|
101
|
+
get doctype(): string;
|
|
102
|
+
set doctype(value: string);
|
|
103
|
+
/**
|
|
104
|
+
* Sets a provider name
|
|
105
|
+
*/
|
|
106
|
+
setName(value: string): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Returns a provider info item
|
|
109
|
+
*/
|
|
110
|
+
getInfo(): IXEpgProvInfoDesc;
|
|
111
|
+
/**
|
|
112
|
+
* Sets a provider info
|
|
113
|
+
* @todo [since v0.0.21] deprecate use of `obj`-param as array
|
|
114
|
+
*/
|
|
115
|
+
setInfo(obj: arrProviderInfo | IXEpgProvInfoDesc): void;
|
|
116
|
+
/**
|
|
117
|
+
* Sets an initial instance state
|
|
118
|
+
*/
|
|
119
|
+
init(data?: arrProviderInfo | IXEpgProvInfoDesc): void;
|
|
120
|
+
/**
|
|
121
|
+
* Returns an instance content as a string in an XML-format.
|
|
122
|
+
* @since v0.0.20
|
|
123
|
+
*/
|
|
124
|
+
saveToXMLString(): string;
|
|
125
|
+
/**
|
|
126
|
+
* Loads a element content from a string.
|
|
127
|
+
* @since v0.0.24
|
|
128
|
+
* @throws {Error}
|
|
129
|
+
* @experimental
|
|
130
|
+
*/
|
|
131
|
+
loadFromXMLString(xmlString: string): boolean;
|
|
132
|
+
#private;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* This class implements an interface of a EPG-header element
|
|
137
|
+
*/
|
|
138
|
+
export class TXEpgHeaderContainer {
|
|
139
|
+
/**
|
|
140
|
+
* Creates an instance of the EPG-header element
|
|
141
|
+
*/
|
|
142
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
143
|
+
/**
|
|
144
|
+
* Returns a `TXEpgDTSProvider` instance
|
|
145
|
+
*/
|
|
146
|
+
get dts(): TXEpgDTSProvider;
|
|
147
|
+
/**
|
|
148
|
+
* Contains a dtstype ID
|
|
149
|
+
* @todo [since v0.0.22] becomes readonly
|
|
150
|
+
*/
|
|
151
|
+
get dtstype(): number;
|
|
152
|
+
set dtstype(value: number);
|
|
153
|
+
/**
|
|
154
|
+
* Contains a TZ-offset
|
|
155
|
+
* @todo [since v0.0.22] becomes readonly
|
|
156
|
+
*/
|
|
157
|
+
get curDocTZ(): number;
|
|
158
|
+
set curDocTZ(value: number);
|
|
159
|
+
/**
|
|
160
|
+
* Returns a `TXEpgProviderContainer` instance
|
|
161
|
+
* @since 0.0.22
|
|
162
|
+
*/
|
|
163
|
+
get provider(): TXEpgProviderContainer | null;
|
|
164
|
+
/**
|
|
165
|
+
* Returns a `TXEpgChannelContainer` instance
|
|
166
|
+
* @since 0.0.22
|
|
167
|
+
*/
|
|
168
|
+
get channel(): TXEpgChannelContainer;
|
|
169
|
+
/**
|
|
170
|
+
* Returns a document creation date as a timestamp
|
|
171
|
+
*/
|
|
172
|
+
getDocumentDT(): number;
|
|
173
|
+
/**
|
|
174
|
+
* Sets a document creation date to a current system time
|
|
175
|
+
*/
|
|
176
|
+
setDocumentDT(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Returns a document expire date as a timestamp
|
|
179
|
+
*/
|
|
180
|
+
getDocumentEDT(): number;
|
|
181
|
+
/**
|
|
182
|
+
* Sets a document expire date to a given time
|
|
183
|
+
*/
|
|
184
|
+
setDocumentEDT(value: any): void;
|
|
185
|
+
/**
|
|
186
|
+
* Returns a channel info
|
|
187
|
+
*/
|
|
188
|
+
getChannelInfo(): IXEpgChnInfoDesc;
|
|
189
|
+
/**
|
|
190
|
+
* Returns a provider info
|
|
191
|
+
*/
|
|
192
|
+
getProviderInfo(): IXEpgProvInfoDesc | null;
|
|
193
|
+
/**
|
|
194
|
+
* Returns an instance content as a string in an XML-format.
|
|
195
|
+
* @since v0.0.20
|
|
196
|
+
*/
|
|
197
|
+
saveToXMLString(): string;
|
|
198
|
+
/**
|
|
199
|
+
* Loads an element content from a string.
|
|
200
|
+
* @since v0.0.24
|
|
201
|
+
* @throws {Error}
|
|
202
|
+
* @experimental
|
|
203
|
+
*/
|
|
204
|
+
loadFromXMLString(xmlString: string): boolean;
|
|
205
|
+
#private;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* This class implements an instance of an element
|
|
210
|
+
* that manages content of a document declaration
|
|
211
|
+
* @since v0.0.30
|
|
212
|
+
*/
|
|
213
|
+
export class TXmlContentDeclaration {
|
|
214
|
+
/**
|
|
215
|
+
* Creates an instance of the element
|
|
216
|
+
* @throws {TypeError}
|
|
217
|
+
*/
|
|
218
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
219
|
+
/**
|
|
220
|
+
* Contains a version of an XML
|
|
221
|
+
*/
|
|
222
|
+
get version(): string;
|
|
223
|
+
set version(value: string);
|
|
224
|
+
/**
|
|
225
|
+
* Contains a document character set
|
|
226
|
+
*/
|
|
227
|
+
get encoding(): string;
|
|
228
|
+
set encoding(value: string);
|
|
229
|
+
/**
|
|
230
|
+
* Initializes an instance content.
|
|
231
|
+
*/
|
|
232
|
+
init(): void;
|
|
233
|
+
#private;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* This class implements an interface of the container
|
|
238
|
+
* that manages a content of a XEPG-document
|
|
239
|
+
*/
|
|
240
|
+
export class TXEpgContentProvider {
|
|
241
|
+
/**
|
|
242
|
+
* Creates an instance of the XEPG-content provider
|
|
243
|
+
*/
|
|
244
|
+
constructor(opt?: OPT_epgcpsett);
|
|
245
|
+
/**
|
|
246
|
+
* Returns a `TXEpgHeaderContainer` instance
|
|
247
|
+
* @since 0.0.22
|
|
248
|
+
*/
|
|
249
|
+
get header(): TXEpgHeaderContainer;
|
|
250
|
+
/**
|
|
251
|
+
* Returns a `TXEpgProviderContainer` instance
|
|
252
|
+
* @since 0.0.22
|
|
253
|
+
*/
|
|
254
|
+
get provider(): TXEpgProviderContainer | null;
|
|
255
|
+
/**
|
|
256
|
+
* Returns a `TXEpgDTSProvider` instance
|
|
257
|
+
*/
|
|
258
|
+
get dts(): TXEpgDTSProvider | null;
|
|
259
|
+
/**
|
|
260
|
+
* Returns a `TXEpgSchedulesList` instance
|
|
261
|
+
* @since 0.0.24
|
|
262
|
+
*/
|
|
263
|
+
get schedules(): TXEpgSchedulesList;
|
|
264
|
+
|
|
265
|
+
init(): void;
|
|
266
|
+
/**
|
|
267
|
+
* Returns a document content as a string in an XML-format.
|
|
268
|
+
*/
|
|
269
|
+
saveToXMLString(): string;
|
|
270
|
+
/**
|
|
271
|
+
* Saves a document content to a file.
|
|
272
|
+
* @throws {Error}
|
|
273
|
+
* @async
|
|
274
|
+
*/
|
|
275
|
+
saveToFile(source: string): Promise<fsoDescr>;
|
|
276
|
+
/**
|
|
277
|
+
* Saves a document content to a file.
|
|
278
|
+
*/
|
|
279
|
+
saveToFileSync(source: string): fsoDescr;
|
|
280
|
+
/**
|
|
281
|
+
* Loads a document content from a string.
|
|
282
|
+
* @since 0.0.18
|
|
283
|
+
* @throws {Error}
|
|
284
|
+
*/
|
|
285
|
+
loadFromXMLString(xmlString: string): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Loads a document content from a file.
|
|
288
|
+
* @throws {Error}
|
|
289
|
+
* @async
|
|
290
|
+
*/
|
|
291
|
+
loadFromFile(source: string): Promise<fsoDescr>;
|
|
292
|
+
/**
|
|
293
|
+
* Loads a document content from a file.
|
|
294
|
+
*/
|
|
295
|
+
loadFromFileSync(source: string): fsoDescr;
|
|
296
|
+
/**
|
|
297
|
+
* @protected
|
|
298
|
+
*/
|
|
299
|
+
protected asJSON(): string;
|
|
300
|
+
#private;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export const XEPG_DEF_PROVIDER_NAME: "xepg-lib-js";
|
|
304
|
+
export const XEPG_DEF_PROVIDER_VER: "0.0.25";
|
|
305
|
+
export const XEPG_DEF_DOCUMENT_TYPE: "xepg";
|
|
306
|
+
export const XEPG_DEF_DOCUMENT_SCHEMA: string;
|
|
307
|
+
/**
|
|
308
|
+
* This class implements an interface of a DTS-provider element
|
|
309
|
+
*/
|
|
310
|
+
export class TXEpgDTSProvider {
|
|
311
|
+
/**
|
|
312
|
+
* Creates an instance of the DTS-provider element
|
|
313
|
+
*/
|
|
314
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
315
|
+
/**
|
|
316
|
+
* Contains a dtstype ID
|
|
317
|
+
*/
|
|
318
|
+
get dtstype(): number;
|
|
319
|
+
set dtstype(value: number);
|
|
320
|
+
/**
|
|
321
|
+
* Contains a TZ-offset
|
|
322
|
+
*/
|
|
323
|
+
get curDocTZ(): number;
|
|
324
|
+
set curDocTZ(value: number);
|
|
325
|
+
/**
|
|
326
|
+
* Tries to set a `DTS`-type
|
|
327
|
+
* @since 0.0.22
|
|
328
|
+
*/
|
|
329
|
+
setType(value: number | string): boolean;
|
|
330
|
+
#private;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
import { TXmlContentParseOptions } from "@ygracs/xobj-lib-js";
|
|
334
|
+
import type { INode } from "@ygracs/xobj-lib-js";
|
|
335
|
+
import { TXEpgChannelContainer } from "./xepg-channel";
|
|
336
|
+
import { IXEpgChnInfoDesc } from "./xepg-channel";
|
|
337
|
+
import { TXEpgSchedulesList } from "./xepg-sched";
|
|
338
|
+
import { fsoDescr } from "@cntwg/file-helper";
|