@ygracs/xepg-lib-js 0.0.27-b → 0.0.31
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 +20 -5
- package/README.md +4 -2
- package/doc/xepgdoc-lib.md +14 -7
- package/index.d.ts +5 -1
- package/index.js +12 -3
- package/lib/dts-helper.d.ts +19 -3
- package/lib/dts-helper.js +74 -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 +87 -339
- package/lib/xepgdoc-lib.js +102 -883
- package/lib/xml-base.d.ts +20 -0
- package/lib/xml-base.js +101 -1
- package/package.json +10 -7
package/lib/xepgdoc-lib.d.ts
CHANGED
|
@@ -1,74 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
export type OPT_epgelsett_bs = {
|
|
5
|
-
/**
|
|
6
|
-
* - parser options
|
|
7
|
-
*/
|
|
8
|
-
parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* An XEPG-element options set (base)
|
|
2
|
+
* A list of fields in order: `name`, `version`, `schema`, `doctype`
|
|
3
|
+
* @deprecated
|
|
12
4
|
*/
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
* - parser options
|
|
16
|
-
*/
|
|
17
|
-
parseOptions: InstanceType<typeof TXmlContentParseOptions>;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* A schedule info descriptor
|
|
21
|
-
*/
|
|
22
|
-
export type xepgShedInfoDesc = {
|
|
23
|
-
/**
|
|
24
|
-
* - a schedule start time
|
|
25
|
-
*/
|
|
26
|
-
time: number;
|
|
27
|
-
/**
|
|
28
|
-
* - schedule title
|
|
29
|
-
*/
|
|
30
|
-
title: string;
|
|
31
|
-
/**
|
|
32
|
-
* - schedule category
|
|
33
|
-
*/
|
|
34
|
-
cat?: string;
|
|
35
|
-
/**
|
|
36
|
-
* - schedule rating
|
|
37
|
-
*/
|
|
38
|
-
pcmark?: number;
|
|
39
|
-
/**
|
|
40
|
-
* - schedule description
|
|
41
|
-
*/
|
|
42
|
-
descr?: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* An extra options set
|
|
46
|
-
*/
|
|
47
|
-
export type OPT_extra = {
|
|
48
|
-
/**
|
|
49
|
-
* - 'DTS'-settings
|
|
50
|
-
*/
|
|
51
|
-
dts_src?: object;
|
|
52
|
-
/**
|
|
53
|
-
* - 'TZ'-settings
|
|
54
|
-
*/
|
|
55
|
-
tz_src?: object;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* An XEPG-element options set (extend)
|
|
59
|
-
*/
|
|
60
|
-
export type OPT_epgelsett_ex = {
|
|
61
|
-
/**
|
|
62
|
-
* - parser options
|
|
63
|
-
*/
|
|
64
|
-
parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
|
|
65
|
-
dts_src?: object;
|
|
66
|
-
tz_src?: object;
|
|
67
|
-
};
|
|
5
|
+
export type arrProviderInfo = [ name: string, version: string, schema: string, doctype: string ];
|
|
6
|
+
export const arrProviderInfo: arrProviderInfo;
|
|
68
7
|
/**
|
|
69
8
|
* A provider info descriptor
|
|
70
9
|
*/
|
|
71
|
-
export type
|
|
10
|
+
export type IXEpgProvInfoDesc = {
|
|
72
11
|
/**
|
|
73
12
|
* - provider name
|
|
74
13
|
*/
|
|
@@ -86,26 +25,24 @@ export type xepgProvInfoDesc = {
|
|
|
86
25
|
*/
|
|
87
26
|
doctype: string;
|
|
88
27
|
};
|
|
28
|
+
export const IXEpgProvInfoDesc: IXEpgProvInfoDesc;
|
|
89
29
|
/**
|
|
90
|
-
*
|
|
30
|
+
* An XEPG-element options set (base)
|
|
91
31
|
*/
|
|
92
|
-
export type
|
|
93
|
-
/**
|
|
94
|
-
* - channel ID
|
|
95
|
-
*/
|
|
96
|
-
chnid: string;
|
|
97
|
-
/**
|
|
98
|
-
* - channel name
|
|
99
|
-
*/
|
|
100
|
-
chname: string;
|
|
32
|
+
export type OPT_epgelsett_bs = {
|
|
101
33
|
/**
|
|
102
|
-
* -
|
|
34
|
+
* - parser options
|
|
103
35
|
*/
|
|
104
|
-
|
|
36
|
+
parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* An XEPG-element options set (base)
|
|
40
|
+
*/
|
|
41
|
+
export type XEpgElementConfigBase = {
|
|
105
42
|
/**
|
|
106
|
-
* -
|
|
43
|
+
* - parser options
|
|
107
44
|
*/
|
|
108
|
-
|
|
45
|
+
parseOptions: InstanceType<typeof TXmlContentParseOptions>;
|
|
109
46
|
};
|
|
110
47
|
|
|
111
48
|
/**
|
|
@@ -135,215 +72,6 @@ export type XEpgContainerConfig = {
|
|
|
135
72
|
autoBindRoot?: boolean | undefined;
|
|
136
73
|
};
|
|
137
74
|
|
|
138
|
-
/**
|
|
139
|
-
* This class implements an instance of an element
|
|
140
|
-
* that manages content of a document declaration
|
|
141
|
-
* @since v0.0.2x
|
|
142
|
-
*/
|
|
143
|
-
export class TXmlContentDeclaration {
|
|
144
|
-
/**
|
|
145
|
-
* Creates an instance of the element
|
|
146
|
-
* @throws {TypeError}
|
|
147
|
-
*/
|
|
148
|
-
constructor(obj: object, opt?: OPT_epgelsett_bs);
|
|
149
|
-
/**
|
|
150
|
-
* Contains a version of an XML
|
|
151
|
-
*/
|
|
152
|
-
get version(): string;
|
|
153
|
-
set version(value: string);
|
|
154
|
-
/**
|
|
155
|
-
* Contains a document character set
|
|
156
|
-
*/
|
|
157
|
-
get encoding(): string;
|
|
158
|
-
set encoding(value: string);
|
|
159
|
-
/**
|
|
160
|
-
* Initializes an instance content.
|
|
161
|
-
*/
|
|
162
|
-
init(): void;
|
|
163
|
-
#private;
|
|
164
|
-
}
|
|
165
|
-
export const XEPG_DEF_PROVIDER_NAME: "xepg-lib-js";
|
|
166
|
-
export const XEPG_DEF_PROVIDER_VER: "0.0.21";
|
|
167
|
-
export const XEPG_DEF_DOCUMENT_TYPE: "xepg";
|
|
168
|
-
export const XEPG_DEF_DOCUMENT_SCHEMA: string;
|
|
169
|
-
/**
|
|
170
|
-
* This class implements an interface of a DTS-provider element
|
|
171
|
-
*/
|
|
172
|
-
export class TXEpgDTSProvider {
|
|
173
|
-
/**
|
|
174
|
-
* Creates an instance of the DTS-provider element
|
|
175
|
-
*/
|
|
176
|
-
constructor(obj: object, opt?: OPT_epgelsett_bs);
|
|
177
|
-
/**
|
|
178
|
-
* Contains a dtstype ID
|
|
179
|
-
*/
|
|
180
|
-
get dtstype(): number;
|
|
181
|
-
set dtstype(value: number);
|
|
182
|
-
/**
|
|
183
|
-
* Contains a TZ-offset
|
|
184
|
-
*/
|
|
185
|
-
get curDocTZ(): number;
|
|
186
|
-
set curDocTZ(value: number);
|
|
187
|
-
/**
|
|
188
|
-
* Tries to set a `DTS`-type
|
|
189
|
-
* @since 0.0.22
|
|
190
|
-
*/
|
|
191
|
-
setType(value: any): boolean;
|
|
192
|
-
#private;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* This class implements an interface of a EPG-schedule element
|
|
197
|
-
* @since 0.0.22
|
|
198
|
-
*/
|
|
199
|
-
export class TXEpgScheduleItem {
|
|
200
|
-
/**
|
|
201
|
-
* Creates an instance of the EPG-schedule element
|
|
202
|
-
*/
|
|
203
|
-
constructor(obj: object, opt?: OPT_epgelsett_ex, extra?: OPT_extra);
|
|
204
|
-
/**
|
|
205
|
-
* Contains a dtstype ID
|
|
206
|
-
*/
|
|
207
|
-
get dtstype(): number;
|
|
208
|
-
/**
|
|
209
|
-
* Contains a TZ-offset
|
|
210
|
-
*/
|
|
211
|
-
get curDocTZ(): number;
|
|
212
|
-
/**
|
|
213
|
-
* Contains a schedule start time as a timestamp
|
|
214
|
-
*/
|
|
215
|
-
get time(): number;
|
|
216
|
-
/**
|
|
217
|
-
* Contains a schedule title
|
|
218
|
-
*/
|
|
219
|
-
get title(): string;
|
|
220
|
-
/**
|
|
221
|
-
* Contains a schedule category
|
|
222
|
-
*/
|
|
223
|
-
get category(): string;
|
|
224
|
-
/**
|
|
225
|
-
* Contains a schedule rating value (aka pcmark)
|
|
226
|
-
*/
|
|
227
|
-
get rating(): number;
|
|
228
|
-
/**
|
|
229
|
-
* Contains a schedule description
|
|
230
|
-
*/
|
|
231
|
-
get descr(): string;
|
|
232
|
-
/**
|
|
233
|
-
* Returns a schedule info item descriptor
|
|
234
|
-
*/
|
|
235
|
-
getInfo(): xepgShedInfoDesc;
|
|
236
|
-
/**
|
|
237
|
-
* Sets a schedule start time.
|
|
238
|
-
*/
|
|
239
|
-
setTime(value: number | string | Date): boolean;
|
|
240
|
-
/**
|
|
241
|
-
* Sets a schedule title.
|
|
242
|
-
*/
|
|
243
|
-
setTitle(value: string): boolean;
|
|
244
|
-
/**
|
|
245
|
-
* Sets a schedule title.
|
|
246
|
-
*/
|
|
247
|
-
setCategory(value: string): boolean;
|
|
248
|
-
/**
|
|
249
|
-
* Sets a schedule rating value.
|
|
250
|
-
*/
|
|
251
|
-
setRating(value: number | string): boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Sets a schedule description.
|
|
254
|
-
*/
|
|
255
|
-
setDescr(value: string): boolean;
|
|
256
|
-
/**
|
|
257
|
-
* Returns an instance content as a string in an XML-format.
|
|
258
|
-
*/
|
|
259
|
-
saveToXMLString(): string;
|
|
260
|
-
/**
|
|
261
|
-
* Loads an element content from a string.
|
|
262
|
-
* @since v0.0.24
|
|
263
|
-
* @throws {Error}
|
|
264
|
-
* @experimental
|
|
265
|
-
*/
|
|
266
|
-
loadFromXMLString(xmlString: string): boolean;
|
|
267
|
-
#private;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* This class implements an interface of a EPG-schedules list
|
|
272
|
-
*/
|
|
273
|
-
export class TXEpgSchedulesList {
|
|
274
|
-
/**
|
|
275
|
-
* Creates an instance of the schedules list
|
|
276
|
-
*/
|
|
277
|
-
constructor(obj: any[], opt?: OPT_epgelsett_ex, extra?: OPT_extra);
|
|
278
|
-
/**
|
|
279
|
-
* Contains a quantity of a schedules
|
|
280
|
-
* @deprecated
|
|
281
|
-
* @todo \[since `v0.0.24`] deprecated. Use `TXEpgSchedulesList.count`
|
|
282
|
-
*/
|
|
283
|
-
get schedQty(): number;
|
|
284
|
-
/**
|
|
285
|
-
* Contains a quantity of a schedules
|
|
286
|
-
* @since v0.0.24
|
|
287
|
-
*/
|
|
288
|
-
get count(): number;
|
|
289
|
-
/**
|
|
290
|
-
* Contains a dtstype ID
|
|
291
|
-
*/
|
|
292
|
-
get dtstype(): number;
|
|
293
|
-
/**
|
|
294
|
-
* Contains a TZ-offset
|
|
295
|
-
*/
|
|
296
|
-
get curDocTZ(): number;
|
|
297
|
-
/**
|
|
298
|
-
* Indicates whether an instance has none member
|
|
299
|
-
* @since v0.0.24
|
|
300
|
-
*/
|
|
301
|
-
isEmpty(): boolean;
|
|
302
|
-
/**
|
|
303
|
-
* Indicates whether an instance has any member
|
|
304
|
-
* @since v0.0.24
|
|
305
|
-
*/
|
|
306
|
-
isNotEmpty(): boolean;
|
|
307
|
-
/**
|
|
308
|
-
* Checks whether a given value is a valid index and it fits the index range
|
|
309
|
-
* of an instance
|
|
310
|
-
* @since 0.0.20
|
|
311
|
-
*/
|
|
312
|
-
chkIndex(value: number | string): boolean;
|
|
313
|
-
/**
|
|
314
|
-
* Returns a schedule element addressed by a given index
|
|
315
|
-
* @since 0.0.22
|
|
316
|
-
*/
|
|
317
|
-
schedule(index: number | string): TXEpgScheduleItem | null;
|
|
318
|
-
/**
|
|
319
|
-
* Returns a schedule info item for instance element addressed
|
|
320
|
-
* by a given index
|
|
321
|
-
*/
|
|
322
|
-
getScheduleInfo(index: number | string): xepgShedInfoDesc | null;
|
|
323
|
-
/**
|
|
324
|
-
* Returns a schedule info for instance members
|
|
325
|
-
*/
|
|
326
|
-
getAllSchedulesInfo(): xepgShedInfoDesc[];
|
|
327
|
-
/**
|
|
328
|
-
* @protected
|
|
329
|
-
*/
|
|
330
|
-
protected asJSON(): string;
|
|
331
|
-
[Symbol.iterator](): {
|
|
332
|
-
next: () => {
|
|
333
|
-
done: boolean;
|
|
334
|
-
value: TXEpgScheduleItem | null;
|
|
335
|
-
} | {
|
|
336
|
-
done: boolean;
|
|
337
|
-
value: undefined;
|
|
338
|
-
};
|
|
339
|
-
return(): {
|
|
340
|
-
done: boolean;
|
|
341
|
-
value: undefined;
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
#private;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
75
|
/**
|
|
348
76
|
* This class implements an interface of a EPG-provider element
|
|
349
77
|
*/
|
|
@@ -351,7 +79,7 @@ export class TXEpgProviderContainer {
|
|
|
351
79
|
/**
|
|
352
80
|
* Creates an instance of the EPG-provider element
|
|
353
81
|
*/
|
|
354
|
-
constructor(obj:
|
|
82
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
355
83
|
/**
|
|
356
84
|
* Contains a provider name
|
|
357
85
|
*/
|
|
@@ -379,16 +107,16 @@ export class TXEpgProviderContainer {
|
|
|
379
107
|
/**
|
|
380
108
|
* Returns a provider info item
|
|
381
109
|
*/
|
|
382
|
-
getInfo():
|
|
110
|
+
getInfo(): IXEpgProvInfoDesc;
|
|
383
111
|
/**
|
|
384
112
|
* Sets a provider info
|
|
385
113
|
* @todo [since v0.0.21] deprecate use of `obj`-param as array
|
|
386
114
|
*/
|
|
387
|
-
setInfo(obj:
|
|
115
|
+
setInfo(obj: arrProviderInfo | IXEpgProvInfoDesc): void;
|
|
388
116
|
/**
|
|
389
117
|
* Sets an initial instance state
|
|
390
118
|
*/
|
|
391
|
-
init(
|
|
119
|
+
init(data?: arrProviderInfo | IXEpgProvInfoDesc): void;
|
|
392
120
|
/**
|
|
393
121
|
* Returns an instance content as a string in an XML-format.
|
|
394
122
|
* @since v0.0.20
|
|
@@ -404,49 +132,6 @@ export class TXEpgProviderContainer {
|
|
|
404
132
|
#private;
|
|
405
133
|
}
|
|
406
134
|
|
|
407
|
-
/**
|
|
408
|
-
* This class implements an interface of a channel element
|
|
409
|
-
* @since 0.0.22
|
|
410
|
-
*/
|
|
411
|
-
export class TXEpgChannelContainer {
|
|
412
|
-
/**
|
|
413
|
-
* Creates an instance of the channel element
|
|
414
|
-
*/
|
|
415
|
-
constructor(obj: object, opt?: OPT_epgelsett_bs);
|
|
416
|
-
/**
|
|
417
|
-
* Contains a channel ID
|
|
418
|
-
*/
|
|
419
|
-
get id(): string;
|
|
420
|
-
/**
|
|
421
|
-
* Contains a channel name
|
|
422
|
-
*/
|
|
423
|
-
get name(): string;
|
|
424
|
-
set name(value: string);
|
|
425
|
-
/**
|
|
426
|
-
* Contains a channel Group ID
|
|
427
|
-
*/
|
|
428
|
-
get gid(): string;
|
|
429
|
-
set gid(value: string);
|
|
430
|
-
/**
|
|
431
|
-
* Contains a channel source URL
|
|
432
|
-
*/
|
|
433
|
-
get url(): string;
|
|
434
|
-
set url(value: string);
|
|
435
|
-
/**
|
|
436
|
-
* Tries to set a channel ID
|
|
437
|
-
*/
|
|
438
|
-
setID(value: string): boolean;
|
|
439
|
-
/**
|
|
440
|
-
* Returns a channel info
|
|
441
|
-
*/
|
|
442
|
-
getInfo(): xepgChnInfoDesc;
|
|
443
|
-
/**
|
|
444
|
-
* Sets a channel info
|
|
445
|
-
*/
|
|
446
|
-
setInfo(obj: string | xepgChnInfoDesc): void;
|
|
447
|
-
#private;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
135
|
/**
|
|
451
136
|
* This class implements an interface of a EPG-header element
|
|
452
137
|
*/
|
|
@@ -454,7 +139,7 @@ export class TXEpgHeaderContainer {
|
|
|
454
139
|
/**
|
|
455
140
|
* Creates an instance of the EPG-header element
|
|
456
141
|
*/
|
|
457
|
-
constructor(obj:
|
|
142
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
458
143
|
/**
|
|
459
144
|
* Returns a `TXEpgDTSProvider` instance
|
|
460
145
|
*/
|
|
@@ -500,11 +185,11 @@ export class TXEpgHeaderContainer {
|
|
|
500
185
|
/**
|
|
501
186
|
* Returns a channel info
|
|
502
187
|
*/
|
|
503
|
-
getChannelInfo():
|
|
188
|
+
getChannelInfo(): IXEpgChnInfoDesc;
|
|
504
189
|
/**
|
|
505
190
|
* Returns a provider info
|
|
506
191
|
*/
|
|
507
|
-
getProviderInfo():
|
|
192
|
+
getProviderInfo(): IXEpgProvInfoDesc | null;
|
|
508
193
|
/**
|
|
509
194
|
* Returns an instance content as a string in an XML-format.
|
|
510
195
|
* @since v0.0.20
|
|
@@ -520,6 +205,34 @@ export class TXEpgHeaderContainer {
|
|
|
520
205
|
#private;
|
|
521
206
|
}
|
|
522
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
|
+
|
|
523
236
|
/**
|
|
524
237
|
* This class implements an interface of the container
|
|
525
238
|
* that manages a content of a XEPG-document
|
|
@@ -586,5 +299,40 @@ export class TXEpgContentProvider {
|
|
|
586
299
|
protected asJSON(): string;
|
|
587
300
|
#private;
|
|
588
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
|
+
|
|
589
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";
|
|
590
338
|
import { fsoDescr } from "@cntwg/file-helper";
|