@ygracs/xepg-lib-js 0.0.20 → 0.0.21

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 CHANGED
@@ -1,3 +1,14 @@
1
+ #### *v0.0.21*
2
+
3
+ Pre-release version.
4
+
5
+ > - update `xepgdoc-lib.md`;
6
+ > - update dependency on `@ygracs/bsfoc-lib-js` module to v0.2.2;
7
+ > - update dependency on `@ygracs/dtf-lib-js` module to v0.0.27;
8
+ > - update dependency on `@ygracs/xobj-lib-js` module to v0.2.1;
9
+ > - change name for class `TXepgDTSProvider` into `TXEpgDTSProvider`;
10
+ > - remove method `asXML` for `TXEpgProviderContainer` class.
11
+
1
12
  #### *v0.0.20*
2
13
 
3
14
  Pre-release version.
@@ -96,81 +107,6 @@ Pre-release version.
96
107
  > - add `TXepgDTSProvider` class;
97
108
  > - deprecate property `SchedulesQty` of `TXEpgSchedulesList` class.
98
109
 
99
- #### *v0.0.10*
100
-
101
- Pre-release version.
102
-
103
- > - some fixes in `xepgdoc-lib.js` module.
104
-
105
- #### *v0.0.9*
106
-
107
- Pre-release version.
108
-
109
- > - `xepgdoc-lib.md` updated;
110
- > - `xepgdoc-spec.md` updated;
111
- > - some fixes in `xepgdoc-lib.js` module;
112
- > - some fixes in `dtFunc.js` module;
113
- > - `$module/lib/dts-helper.js` added;
114
- > - move module `xepgdoc-lib-v2.js` to its own project;
115
- > - updated dependency on `@cntwg/xml-lib-js` module to v0.0.13;
116
- > - updated dependency on `@ygracs/xml-js6` module to v0.0.3b.
117
-
118
- #### *v0.0.8*
119
-
120
- Pre-release version.
121
-
122
- > - updated dependency on `@cntwg/xml-lib-js` module to v0.0.10;
123
- > - switch dependency from `@cntwg/bsfoc-lib-js` module to `@ygracs/bsfoc-lib-js` module.
124
-
125
- #### *v0.0.7*
126
-
127
- Pre-release version.
128
-
129
- > - updated dependency on `@cntwg/bsfoc-lib-js` module to v0.0.11;
130
- > - updated dependency on `@cntwg/xml-lib-js` module to v0.0.9.
131
-
132
- #### *v0.0.6*
133
-
134
- Pre-release version.
135
-
136
- > - some fixes in `xepgdoc-lib.js` module.
137
-
138
- #### *v0.0.5*
139
-
140
- Pre-release version.
141
-
142
- > - updated dependency on `@cntwg/bsfoc-lib-js` module to v0.0.8;
143
- > - updated dependency on `@cntwg/xml-lib-js` module to v0.0.8;
144
- > - add method `loadFromFileSync` to `TXEpgContentProvider` (v1);
145
- > - add method `saveToFileSync` to `TXEpgContentProvider` (v1);
146
- > - some fixes in `xepgdoc-lib.js` module;
147
- > - `$module/lib/xepgdoc-lib-v2.js` added;
148
- > - `xepgdoc-lib-v2.md` added;
149
- > - `xepgdoc-spec.md` added.
150
-
151
- #### *v0.0.4*
152
-
153
- Pre-release version.
154
-
155
- > - removed class `TXEpgContentBodyContainer` from `xepgdoc-lib.js` module;
156
- > - merdged class `TXEpgContentContainer` into `TXEpgContentProvider`;
157
- > - `xepgdoc-lib.md` added.
158
-
159
- #### *v0.0.3*
160
-
161
- Pre-release version.
162
-
163
- > - updated dependency on `@cntwg/xml-lib-js` module to v0.0.7;
164
- > - renamed class `TXEpgScheduleContainer` to `TXEpgSchedulesList`;
165
- > - `xepgdoc-lib.md` added;
166
- > - MIT-license applied.
167
-
168
- #### *v0.0.2*
169
-
170
- Pre-release version.
171
-
172
- > - fixed some errors in `xepgdoc-lib.js` module.
173
-
174
- #### *v0.0.1*
110
+ #### *v0.0.10-v0.0.1*
175
111
 
176
112
  Pre-release version.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2024 Yuri Grachev
3
+ Copyright (c) 2019-2025 Yuri Grachev
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- |***rev.*:**|0.0.6|
1
+ |***rev.*:**|0.0.7|
2
2
  |:---|---:|
3
- |***date***:|2024-10-29|
3
+ |***date***:|2025-02-28|
4
4
 
5
5
  ## Introduction
6
6
 
@@ -19,7 +19,7 @@ This module contains the following components:
19
19
  - classes:
20
20
 
21
21
  + `TXEpgSchedulesList`;
22
- + `TXepgDTSProvider`;
22
+ + `TXEpgDTSProvider`;
23
23
  + `TXEpgProviderContainer`;
24
24
  + `TXEpgHeaderContainer`;
25
25
  + `TXEpgContentContainer`.
@@ -1,15 +1,71 @@
1
- |***rev.*:**|0.0.15|
1
+ |***rev.*:**|0.1.18|
2
2
  |:---|---:|
3
- |***date***:|2024-10-28|
3
+ |***date***:|2025-02-27|
4
4
 
5
5
  ## Introduction
6
6
 
7
7
  This paper describes a constants and an object classes provided by `xepgdoc-lib.js` module.
8
8
 
9
+ ### Base type definitions
10
+
11
+ This section contains some definitions for a general types of the objects (e.g. options set) that frequently used in a function or a class method descriptions.
12
+
13
+ <a name="typedef+fsoDescr"></a>
14
+ #### `fsoDescr` - descriptor
15
+
16
+ This descriptor is an `object` that describes a status for an operation with some FS-object (*e.g. object such as a file*).
17
+
18
+ | property name | value type | optional | description |
19
+ |:---|---|---:|:---|
20
+ | `isERR` | `boolean` | no | a flag which indicates whether an error was happen |
21
+ | `errCode` | `number` | yes | an error code |
22
+ | `errEvent` | `string` | no | an error event identifier |
23
+ | `errMsg` | `string` | no | an error message |
24
+ | `source` | `string` | no | path to a file |
25
+ | `content` | `any` | no | content |
26
+
27
+ <a name="typedef+xepgProvInfoDesc"></a>
28
+ #### `xepgProvInfoDesc` - descriptor
29
+
30
+ This descriptor is an `object` that describes a content provider.
31
+
32
+ | property name | value type | optional | description |
33
+ |:---|---|---:|:---|
34
+ | `name` | `string` | yes | a provider name |
35
+ | `version` | `string` | yes | a provider version |
36
+ | `schema` | `string` | no | a document schema version |
37
+ | `doctype` | `string` | no | a document type |
38
+
39
+ <a name="typedef+xepgChnInfoDesc"></a>
40
+ #### `xepgChnInfoDesc` - descriptor
41
+
42
+ This descriptor is an `object` that describes a channel info.
43
+
44
+ | property name | value type | optional | description |
45
+ |:---|---|---:|:---|
46
+ | `chnid` | `srting` | no | a channel ID |
47
+ | `chname` | `string` | no | a name of the channel |
48
+ | `chngid` | `string` | yes | a channel 'Group ID' |
49
+ | `srcurl` | `string` | yes | a link to source |
50
+
51
+ <a name="typedef+xepgShedInfoDesc"></a>
52
+ #### `xepgShedInfoDesc` - descriptor
53
+
54
+ This descriptor is an `object` that describes a content provider.
55
+
56
+ | property name | value type | optional | description |
57
+ |:---|---|---:|:---|
58
+ | `time` | `number` | a schedule start time |
59
+ | `title` | `string` | a schedule title |
60
+ | `cat` | `string` | a schedule category |
61
+ | `pcmark` | `number` | a schedule rating |
62
+ | `descr` | `string` | a schedule description |
63
+
9
64
  ## Module constants
10
65
 
11
66
  ## Module classes
12
67
 
68
+ <a name="TXEpgSchedulesList"></a>
13
69
  ### **TXEpgSchedulesList**
14
70
 
15
71
  This class provides a functionality for handle an EPG-schedules list.
@@ -22,7 +78,7 @@ The class constructor creates a new instance of the class.
22
78
 
23
79
  The class constructor receives arguments listed below:
24
80
 
25
- |name|type|default value|description|
81
+ | parameter name | value type | default value | description |
26
82
  |:---|---|---:|:---|
27
83
  |`object`|`array`|---|a host object|
28
84
  |`options`|`object`|---|an options settings|
@@ -31,18 +87,35 @@ The class constructor receives arguments listed below:
31
87
 
32
88
  The table below describes a properties of a `TXEpgSchedulesList` class:
33
89
 
34
- |property name|property type|read only|description|
35
- |:---|---|---|:---|
36
- |`schedQty`|`number`|yes|returns a quantity of the elements|
37
- |`dtstype`|`index`|yes|returns a "dtstype"-value|
38
- |`curDocTZ`|`number`|yes|returns a current TimeZone|
90
+ <a name="TXEpgSchedulesList+schedQty"></a>
91
+ ##### **schedQty**
92
+
93
+ | property type | read only | description |
94
+ |---|---|:---|
95
+ | `number` | yes | contains a quantity of the elements the container holds |
96
+
97
+ <a name="TXEpgSchedulesList+dtstype"></a>
98
+ ##### **dtstype**
99
+
100
+ | property type | read only | description |
101
+ |---|---|:---|
102
+ | `number` | yes | contains a "dtstype"-value |
103
+
104
+ <a name="TXEpgSchedulesList+curDocTZ"></a>
105
+ ##### **curDocTZ**
106
+
107
+ | property type | read only | description |
108
+ |---|---|:---|
109
+ | `number` | yes | contains a current TimeZone |
39
110
 
40
111
  #### class methods
41
112
 
113
+ <a name="TXEpgSchedulesList+hasNoSchedules"></a>
42
114
  ##### **hasNoSchedules()** => `boolean`
43
115
 
44
116
  This method returns `true` if a document contains no schedules.
45
117
 
118
+ <a name="TXEpgSchedulesList+hasSchedules"></a>
46
119
  ##### **hasSchedules()** => `boolean`
47
120
 
48
121
  This method returns `true` if a document contains at least one schedule.
@@ -51,17 +124,28 @@ This method returns `true` if a document contains at least one schedule.
51
124
 
52
125
  > WARNING: This method deprecated (*since `v0.0.20`*). Use `chkIndex` instead.
53
126
 
127
+ <a name="TXEpgSchedulesList+chkIndex"></a>
54
128
  ##### **chkIndex(value)** => `boolean`
55
129
 
56
130
  > since: `v0.0.20`
57
131
 
58
132
  This method checks if a given `value` represents a valid schedule index and if so returns `true`.
59
133
 
60
- ##### **getScheduleInfo(index)** => `object`
134
+ | parameter name | value type | default value | description |
135
+ |:---|---|---:|:---|
136
+ | `value` | `number`, `string` | --- | a value to be verified |
137
+
138
+ <a name="TXEpgSchedulesList+getScheduleInfo"></a>
139
+ ##### **getScheduleInfo(index)** => `xepgShedInfoDesc`
61
140
 
62
141
  This method returns an object that contains a schedule information.
63
142
 
64
- ##### **getAllSchedulesInfo()** => `object[]`
143
+ | parameter name | value type | default value | description |
144
+ |:---|---|---:|:---|
145
+ | `index` | `number`, `string` | --- | an element index |
146
+
147
+ <a name="TXEpgSchedulesList+getAllSchedulesInfo"></a>
148
+ ##### **getAllSchedulesInfo()** => `xepgShedInfoDesc[]`
65
149
 
66
150
  This method returns an array that contains an information for all available schedules.
67
151
 
@@ -69,6 +153,7 @@ This method returns an array that contains an information for all available sche
69
153
 
70
154
  ##### **asJSON()**
71
155
 
156
+ <a name="TXEpgProviderContainer"></a>
72
157
  ### **TXEpgProviderContainer**
73
158
 
74
159
  This class implements a structure that holds an information about a program provider within which the content of the document was written.
@@ -94,22 +179,47 @@ The `options` structure is listed below:
94
179
 
95
180
  #### class properties
96
181
 
97
- The table below describes a properties of a `TXEpgProviderContainer` class:
182
+ <a name="TXEpgProviderContainer+name"></a>
183
+ ##### **name**
98
184
 
99
- |property name|property type|read only|description|
100
- |:---|---|---|:---|
101
- |`name`|`string`|no|defines a provider name|
102
- |`version`|`string`|no|defines a provider version string|
103
- |`schema`|`string`|no|defines a document schema version|
104
- |`doctype`|`string`|no|defines a document type|
185
+ | property type | read only | description |
186
+ |---|---|:---|
187
+ | `string` | no | contains a provider name |
188
+
189
+ <a name="TXEpgProviderContainer+version"></a>
190
+ ##### **version**
191
+
192
+ | property type | read only | description |
193
+ |---|---|:---|
194
+ | `string` | no | contains a provider version string |
195
+
196
+ <a name="TXEpgProviderContainer+schema"></a>
197
+ ##### **schema**
198
+
199
+ | property type | read only | description |
200
+ |---|---|:---|
201
+ | `string` | no | contains a document schema version |
202
+
203
+ <a name="TXEpgProviderContainer+doctype"></a>
204
+ ##### **doctype**
205
+
206
+ | property type | read only | description |
207
+ |---|---|:---|
208
+ | `string` | no | contains a document type |
105
209
 
106
210
  #### class methods
107
211
 
212
+ <a name="TXEpgProviderContainer+setName"></a>
108
213
  ##### **setName(value)** => `boolean`
109
214
 
110
215
  This method sets a name of a provider to a given `value`.
111
216
 
112
- ##### **getInfo()** => `object`
217
+ | parameter name | value type | default value | description |
218
+ |:---|---|---:|:---|
219
+ | `value` | `string` | --- | provider name |
220
+
221
+ <a name="TXEpgProviderContainer+getInfo"></a>
222
+ ##### **getInfo()** => `xepgProvInfoDesc`
113
223
 
114
224
  This method returns an `object` that contains information about content provider. An object contains a field listed in the table below:
115
225
 
@@ -120,11 +230,16 @@ This method returns an `object` that contains information about content provider
120
230
  |`schema`|`string`|a document schema version|
121
231
  |`doctype`|`string`|a document type|
122
232
 
123
-
233
+ <a name="TXEpgProviderContainer+setInfo"></a>
124
234
  ##### **setInfo(obj)** => `void`
125
235
 
126
236
  This method loads information about content provider.
127
237
 
238
+ | parameter name | value type | default value | description |
239
+ |:---|---|---:|:---|
240
+ | `obj` | `xepgProvInfoDesc` | --- | provider info descriptor |
241
+
242
+ <a name="TXEpgProviderContainer+saveToXMLString"></a>
128
243
  ##### **saveToXMLString()** => `string`
129
244
 
130
245
  > since: `v0.0.20`
@@ -135,6 +250,7 @@ This method saves an element content to a string.
135
250
 
136
251
  ##### **init()**
137
252
 
253
+ <a name="TXEpgDTSProvider"></a>
138
254
  ### **TXEpgDTSProvider**
139
255
 
140
256
  #### class constructor
@@ -158,13 +274,21 @@ The `options` structure is listed below:
158
274
 
159
275
  #### class properties
160
276
 
161
- The table below describes a properties of a `TXEpgDTSProvider` class:
277
+ <a name="TXEpgDTSProvider+dtstype"></a>
278
+ ##### **dtstype**
279
+
280
+ | property type | read only | description |
281
+ |---|---|:---|
282
+ | `number` | no | defines a "dtstype"-value |
162
283
 
163
- |property name|property type|read only|description|
164
- |:---|---|---|:---|
165
- |`dtstype`|`index`|no|defines a "dtstype"-value|
166
- |`curDocTZ`|`number`|no|defines a current TimeZone|
284
+ <a name="TXEpgDTSProvider+curDocTZ"></a>
285
+ ##### **curDocTZ**
167
286
 
287
+ | property type | read only | description |
288
+ |---|---|:---|
289
+ | `number` | no | defines a current TimeZone |
290
+
291
+ <a name="TXEpgHeaderContainer"></a>
168
292
  ### **TXEpgHeaderContainer**
169
293
 
170
294
  #### class constructor
@@ -188,36 +312,64 @@ The `options` structure is listed below:
188
312
 
189
313
  #### class properties
190
314
 
191
- The table below describes a properties of a `TXEpgHeaderContainer` class:
315
+ <a name="TXEpgHeaderContainer+dts"></a>
316
+ ##### **dts**
192
317
 
193
- |property name|property type|read only|description|
194
- |:---|---|---:|:---|
195
- |`dtstype`|`index`|no|defines a "dtstype"-value|
196
- |`curDocTZ`|`number`|no|defines a current TimeZone|
197
- |`Provider`|`TXEpgProviderContainer`|yes|returns a `TXEpgProviderContainer`|
198
- |`dts`|`TXepgDTSProvider`|yes|returns a `TXEpgDTSProvider`|
318
+ | property type | read only | description |
319
+ |---|---|:---|
320
+ | `TXEpgDTSProvider` | yes | returns a `TXEpgDTSProvider` |
321
+
322
+ <a name="TXEpgHeaderContainer+dtstype"></a>
323
+ ##### **dtstype**
324
+
325
+ | property type | read only | description |
326
+ |---|---|:---|
327
+ | `number` | no | defines a "dtstype"-value |
328
+
329
+ <a name="TXEpgHeaderContainer+curDocTZ"></a>
330
+ ##### **curDocTZ**
331
+
332
+ | property type | read only | description |
333
+ |---|---|:---|
334
+ | `number` | no | defines a current TimeZone |
335
+
336
+ <a name="TXEpgHeaderContainer+Provider"></a>
337
+ ##### **Provider**
338
+
339
+ | property type | read only | description |
340
+ |---|---|:---|
341
+ | `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` |
199
342
 
200
343
  #### class methods
201
344
 
345
+ <a name="TXEpgHeaderContainer+getDocumentDT"></a>
202
346
  ##### **getDocumentDT()** => `number`
203
347
 
204
348
  This method returns a time value of a document creation as a timestamp.
205
349
 
350
+ <a name="TXEpgHeaderContainer+setDocumentDT"></a>
206
351
  ##### **setDocumentDT()** => `void`
207
352
 
208
353
  This method sets a time value of a document creation.
209
354
 
355
+ <a name="TXEpgHeaderContainer+getDocumentEDT"></a>
210
356
  ##### **getDocumentEDT()** => `number`
211
357
 
212
358
  This method returns a time value from which a document is expired as a timestamp.
213
359
 
360
+ <a name="TXEpgHeaderContainer+setDocumentEDT"></a>
214
361
  ##### **setDocumentEDT(value)** => `void`
215
362
 
216
363
  This method sets a time value at which a document will be expired.
217
364
 
218
- ##### **getChannelInfo()** => `object`
365
+ | parameter name | value type | default value | description |
366
+ |:---|---|---:|:---|
367
+ | `value` | `number`, `string`, `Date` | --- | document expire time |
368
+
369
+ <a name="TXEpgHeaderContainer+getChannelInfo"></a>
370
+ ##### **getChannelInfo()** => `xepgChnInfoDesc`
219
371
 
220
- This method returns an object which contains a channel information.
372
+ This method returns an `object` which contains a channel information.
221
373
 
222
374
  An object contains the following fields:
223
375
 
@@ -228,10 +380,17 @@ An object contains the following fields:
228
380
  |`chname`|`string`|a name of the channel|
229
381
  |`srcurl`|`string`|a link to source|
230
382
 
383
+ <a name="TXEpgHeaderContainer+setChannelInfo"></a>
231
384
  ##### **setChannelInfo(obj)** => `void`
232
385
 
233
386
  This method fills a channel information with a given data.
234
387
 
388
+ | parameter name | value type | default value | description |
389
+ |:---|---|---:|:---|
390
+ | `obj` | `xepgChnInfoDesc` | --- | channel info descriptor |
391
+
392
+ > \[!] NOTE: `[since v0.0.21]` a use of a `string` or `array` types a as values of an `obj` are deprecated and will be dropped soon.
393
+
235
394
  The `obj` parameter can be a string or an array or an object.
236
395
 
237
396
  If a string is given it mean to contains the `chnid` value.
@@ -249,18 +408,21 @@ If an object is given it contains the following fields:
249
408
  |`chngid`|`string`|a channel group|
250
409
  |`srcurl`|`string`|a link to source|
251
410
 
252
- ##### **getProviderInfo()** => `object`
411
+ <a name="TXEpgHeaderContainer+getProviderInfo"></a>
412
+ ##### **getProviderInfo()** => `xepgProvInfoDesc`
253
413
 
254
414
  This method returns an object which contains an information about document provider.
255
415
 
256
416
  ##### **setProviderInfo(obj)**
257
417
 
418
+ <a name="TXEpgHeaderContainer+saveToXMLString"></a>
258
419
  ##### **saveToXMLString()** => `string`
259
420
 
260
421
  > since: `v0.0.20`
261
422
 
262
423
  This method saves an element content to a string.
263
424
 
425
+ <a name="TXEpgContentProvider"></a>
264
426
  ### **TXEpgContentProvider**
265
427
 
266
428
  #### class constructor
@@ -284,50 +446,93 @@ The `options` structure is listed below:
284
446
 
285
447
  #### class properties
286
448
 
287
- The table below describes a properties of a `TXEpgContentProvider` class:
449
+ <a name="TXEpgContentProvider+Header"></a>
450
+ ##### **Header**
451
+
452
+ | property type | read only | description |
453
+ |---|---|:---|
454
+ | `TXEpgHeaderContainer` | yes | returns a `TXEpgHeaderContainer` |
455
+
456
+ <a name="TXEpgContentProvider+Provider"></a>
457
+ ##### **Provider**
458
+
459
+ | property type | read only | description |
460
+ |---|---|:---|
461
+ | `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` |
288
462
 
289
- |property name|property type|read only|description|
290
- |:---|---|---|:---|
291
- |`Header`|`TXEpgHeaderContainer`|yes|returns a `TXEpgHeaderContainer`|
292
- |`Provider`|`TXEpgProviderContainer`|yes|returns a `TXEpgProviderContainer`|
293
- |`SchedulesList`|`TXEpgSchedulesList`|yes|returns a `TXEpgSchedulesList`|
294
- |`dts`|`TXEpgDTSProvider`|yes|returns a `TXEpgDTSProvider`|
463
+ <a name="TXEpgContentProvider+dts"></a>
464
+ ##### **dts**
465
+
466
+ | property type | read only | description |
467
+ |---|---|:---|
468
+ | `TXEpgDTSProvider` | yes | returns a `TXEpgDTSProvider` |
469
+
470
+ <a name="TXEpgContentProvider+SchedulesList"></a>
471
+ ##### **SchedulesList**
472
+
473
+ | property type | read only | description |
474
+ |---|---|:---|
475
+ | `TXEpgSchedulesList` | yes | returns a `TXEpgSchedulesList` |
295
476
 
296
477
  #### class methods
297
478
 
479
+ <a name="TXEpgContentProvider+saveToXMLString"></a>
480
+ ##### **saveToXMLString()** => `string`
481
+
482
+ This method saves a document content to a string.
483
+
484
+ <a name="TXEpgContentProvider+saveToFileSync"></a>
485
+ ##### **saveToFileSync(src)** => `fsoDescr`
486
+
487
+ This method saves a document content into a file addressed by `src`.
488
+
489
+ | parameter name | value type | default value | description |
490
+ |:---|---|---:|:---|
491
+ | `src` | `string` | --- | path to a file |
492
+
298
493
  ##### **loadFromString(xmlString, options)** => `boolean`
299
494
 
300
495
  > WARNING: This method deprecated (*since `v0.0.18`*). Use `loadFromXMLString` instead.
301
496
 
302
- ##### **loadFromXMLString(xmlString, options)** => `boolean`
497
+ <a name="TXEpgContentProvider+loadFromXMLString"></a>
498
+ ##### **loadFromXMLString(str)** => `boolean`
303
499
 
304
500
  > since: `v0.0.18`
305
501
 
306
- This method loads a document content from string containing text in XML format.
307
-
308
- ##### **loadFromFile(src)** => `object`
502
+ This method loads a document content from a string given by `str`.
309
503
 
310
- This method loads a document content from a file. A `src` provided a string that is a path to the file.
504
+ | parameter name | value type | default value | description |
505
+ |:---|---|---:|:---|
506
+ | `str` | `string` | --- | some content |
311
507
 
312
- ##### **loadFromFileSync(src)** => `object`
508
+ <a name="TXEpgContentProvider+loadFromFileSync"></a>
509
+ ##### **loadFromFileSync(src)** => `fsoDescr`
313
510
 
314
- This method loads a document content from a file. A `src` provided a string that is a path to the file.
511
+ This method loads a document content from a file addressed by `src`.
315
512
 
316
- ##### **saveToXMLString()** => `string`
513
+ | parameter name | value type | default value | description |
514
+ |:---|---|---:|:---|
515
+ | `src` | `string` | --- | path to a file |
317
516
 
318
- This method saves a document content to a string.
517
+ #### class methods (*async*)
319
518
 
320
- ##### **saveToFile(src)** => `object`
519
+ <a name="TXEpgContentProvider+saveToFile"></a>
520
+ ##### **saveToFile(src)** => `Promise<fsoDescr, Error>`
321
521
 
322
- This method saves a document content to a file. A `src` provided a string that is a path to the file.
522
+ This method saves a document content into a file addressed by `src`.
323
523
 
324
- ##### **saveToFileSync(src)** => `object`
524
+ | parameter name | value type | default value | description |
525
+ |:---|---|---:|:---|
526
+ | `src` | `string` | --- | path to a file |
325
527
 
326
- This method saves a document content to a file. A `src` provided a string that is a path to the file.
528
+ <a name="TXEpgContentProvider+loadFromFile"></a>
529
+ ##### **loadFromFile(src)** => `Promise<fsoDescr, Error>`
327
530
 
328
- ##### **asXML(options)**
531
+ This method loads a document content from a file addressed by `src`.
329
532
 
330
- > WARNING: This method deprecated (*since `v0.0.18`*). Use `saveToXMLString` instead.
533
+ | parameter name | value type | default value | description |
534
+ |:---|---|---:|:---|
535
+ | `src` | `string` | --- | path to a file |
331
536
 
332
537
  #### class methods (*special*)
333
538
 
@@ -0,0 +1,65 @@
1
+ <!-- DTD for TV-listings
2
+ ======================
3
+ * [rev.0.2.002-20241016]
4
+ * [schema 0.2] -->
5
+
6
+ <!ELEMENT epgdoc (tvp:info, tvp:list)>
7
+ <!ATTLIST epgdoc xmlns:tvp CDATA #REQUIRED >
8
+
9
+ <!ELEMENT tvp:info (tvp:provider,
10
+ (tvp:channel?|(tvp:chnid, tvp:chngid?, tvp:chname)),
11
+ tvp:srcurl?,
12
+ tvp:time?, tvp:expire?, tvp:timezone, tvp:dtstype)>
13
+
14
+ <!ELEMENT tvp:provider (name, version?, tvp:schema, tvp:doctype)>
15
+
16
+ <!ELEMENT name (#PCDATA)>
17
+ <!ATTLIST name lang CDATA #IMPLIED >
18
+
19
+ <!ELEMENT version (#PCDATA)>
20
+
21
+ <!ELEMENT tvp:schema (#PCDATA)>
22
+
23
+ <!ELEMENT tvp:doctype (#PCDATA)>
24
+
25
+ <!-- NOTE: tag <tvp:channel> reserved for schema 0.3+ -->
26
+ <!ELEMENT tvp:channel (tvp:chnid, tvp:chngid?, tvp:chname*)>
27
+
28
+ <!ELEMENT tvp:chnid (#PCDATA)>
29
+
30
+ <!ELEMENT tvp:chngid (#PCDATA)>
31
+
32
+ <!ELEMENT tvp:chname (#PCDATA)>
33
+ <!ATTLIST tvp:chname lang CDATA #IMPLIED >
34
+
35
+ <!ELEMENT tvp:srcurl (#PCDATA)>
36
+
37
+ <!ELEMENT tvp:time (#PCDATA)>
38
+
39
+ <!ELEMENT tvp:expire (#PCDATA)>
40
+
41
+ <!ELEMENT tvp:timezone (#PCDATA)>
42
+
43
+ <!ELEMENT tvp:dtstype (value, name)>
44
+
45
+ <!ELEMENT value (#PCDATA)>
46
+
47
+ <!ELEMENT tvp:list ((tvp:item|tvp:schedule)*)>
48
+
49
+ <!ELEMENT tvp:item (tvp:time, tvp:title+, tvp:pcmark?, tvp:cat*, tvp:desc*)>
50
+
51
+ <!ELEMENT tvp:title (#PCDATA)>
52
+ <!ATTLIST tvp:chname lang CDATA #IMPLIED >
53
+
54
+ <!ELEMENT tvp:pcmark (#PCDATA)>
55
+
56
+ <!ELEMENT tvp:cat (#PCDATA)>
57
+ <!ATTLIST tvp:cat lang CDATA #IMPLIED >
58
+
59
+ <!ELEMENT tvp:desc (#PCDATA)>
60
+ <!ATTLIST tvp:desc lang CDATA #IMPLIED >
61
+
62
+ <!-- NOTE: tag <tvp:channel> reserved for schema 0.3+ -->
63
+ <!ELEMENT tvp:schedule (tvp:title+, tvp:pcmark?, tvp:cat*, tvp:desc*)>
64
+ <!ATTLIST tvp:schedule start CDATA #REQUIRED
65
+ stop CDATA #IMPLIED >