@ygracs/xepg-lib-js 0.0.27-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.
@@ -0,0 +1,308 @@
1
+ // [v0.3.152-20260612]
2
+
3
+ // === module init block ===
4
+
5
+ const {
6
+ isObject, isPlainObject,
7
+ } = require('@ygracs/bsfoc-lib-js');
8
+
9
+ const xObj = require('@ygracs/xobj-lib-js');
10
+ const {
11
+ insertXObjElement,
12
+ writeXObjParam,
13
+ //TXmlContentParseOptions,
14
+ //DEF_XML_PARSE_OPTIONS: XML_DEF_PARSE_OPTIONS,
15
+ } = xObj;
16
+ // keep the next line for a type checking work properly :(
17
+ const { TXmlContentParseOptions } = require('@ygracs/xobj-lib-js/lib/xObj-defs');
18
+ // keep the next line for a type checking work properly :(
19
+ const { INode } = require('@ygracs/xobj-lib-js/lib/xObj-lib');
20
+
21
+ const {
22
+ //readAsTagName,
23
+ //readAsAttrName,
24
+ //valueToElementID,
25
+ _getXmlChildElementParam,
26
+ } = require('./xml-base');
27
+
28
+ const {
29
+ XEPG_CONSTANTS, XEPG_DEF_TNAMES,
30
+ defParseOptionsSettings,
31
+ } = require('./xepg-defs');
32
+
33
+ // === module inner block ===
34
+
35
+ const {
36
+ XEPG_DEF_DOCUMENT_SCHEMA,
37
+ } = XEPG_CONSTANTS;
38
+
39
+ const {
40
+ XEPG_CHNID_ETAG_NAME,
41
+ XEPG_CHNNAME_ETAG_NAME,
42
+ XEPG_CHNGID_ETAG_NAME,
43
+ XEPG_CHNURL_ETAG_NAME,
44
+ } = XEPG_DEF_TNAMES;
45
+
46
+ /**
47
+ * An XEPG-element options set (base)
48
+ * @typedef {Object} OPT_epgelsett_bs
49
+ * @property {TXmlContentParseOptions} [parseOptions] - parser options
50
+ */
51
+
52
+ /**
53
+ * An XEPG-element options set (base)
54
+ * @typedef {Object} XEpgElementConfigBase
55
+ * @property {TXmlContentParseOptions} parseOptions - parser options
56
+ */
57
+
58
+ /**
59
+ * Evaluates an XML-node base settings
60
+ * @function __evalXMLBaseNodeSettings
61
+ * @param {any} value - element settings to evaluate
62
+ * @returns {XEpgElementConfigBase}
63
+ * @inner
64
+ */
65
+ function __evalXMLBaseNodeSettings(value) {
66
+ /** @type {OPT_epgelsett_bs} */
67
+ let settings = isPlainObject(value) ? value : {};
68
+ if (settings instanceof Map) settings = Object.fromEntries(settings);
69
+ let {
70
+ parseOptions,
71
+ } = settings;
72
+ if (!(parseOptions instanceof TXmlContentParseOptions)) {
73
+ settings.parseOptions = new TXmlContentParseOptions(parseOptions);
74
+ };
75
+ // @ts-expect-error
76
+ return settings;
77
+ };
78
+
79
+ // === module main block ===
80
+
81
+ /**
82
+ * @typedef {string} setInfoParam
83
+ * @deprecated
84
+ * @todo \[since v0.0.30] deprecated and will be removed
85
+ */
86
+ /**
87
+ * A virtual constant meant for support jsdoc notation:
88
+ * @type {setInfoParam}
89
+ */
90
+ module.exports.setInfoParam = '';
91
+
92
+ /**
93
+ * A channel info descriptor
94
+ * @typedef {Object} IXEpgChnInfoDesc
95
+ * @property {string} chnid - channel ID
96
+ * @property {string} chname - channel name
97
+ * @property {string} [chngid] - channel 'Group ID'
98
+ * @property {string} [srcurl] - EPG-source URL
99
+ */
100
+ /**
101
+ * A virtual constant meant for support jsdoc notation:
102
+ * @type {IXEpgChnInfoDesc}
103
+ */
104
+ module.exports.IXEpgChnInfoDesc = { chnid: '', chname: '' };
105
+
106
+
107
+ /**
108
+ * @since 0.0.22
109
+ * @classdesc This class implements an interface of a channel element
110
+ */
111
+ class TXEpgChannelContainer {
112
+ /** @type {INode} */
113
+ #_host;
114
+ /** @type {OPT_epgelsett_bs} */
115
+ #_options;
116
+ /** @type {TXmlContentParseOptions} */
117
+ #_parseOptions;
118
+ /** @type {string} */
119
+ #_xepgSchema;
120
+
121
+ /**
122
+ * Creates an instance of the channel element
123
+ * @param {INode} obj - host object
124
+ * @param {OPT_epgelsett_bs} [opt] - options
125
+ */
126
+ constructor(obj, opt) {
127
+ // load content
128
+ const _host = isPlainObject(obj) ? obj : {};
129
+ // load options
130
+ const _options = __evalXMLBaseNodeSettings(opt);
131
+ let {
132
+ parseOptions,
133
+ } = _options;
134
+ // set document schema version
135
+ this.#_xepgSchema = XEPG_DEF_DOCUMENT_SCHEMA;
136
+ // save options
137
+ this.#_options = _options;
138
+ // save parser options
139
+ this.#_parseOptions = parseOptions;
140
+ // save content source
141
+ this.#_host = _host;
142
+ }
143
+
144
+ /**
145
+ * Contains a channel ID
146
+ * @type {string}
147
+ * @readonly
148
+ */
149
+ get id() {
150
+ return _getXmlChildElementParam(this.#_host, XEPG_CHNID_ETAG_NAME).trim();
151
+ }
152
+
153
+ /**
154
+ * Contains a channel name
155
+ * @type {string}
156
+ */
157
+ get name() {
158
+ return _getXmlChildElementParam(this.#_host, XEPG_CHNNAME_ETAG_NAME).trim();
159
+ }
160
+
161
+ set name(value) {
162
+ if (typeof value === 'string' && this.id !== '') {
163
+ const item = insertXObjElement(
164
+ this.#_host,
165
+ XEPG_CHNNAME_ETAG_NAME,
166
+ { force: true },
167
+ );
168
+ if (item) {
169
+ writeXObjParam(item, value.trim(), defParseOptionsSettings.textKey);
170
+ };
171
+ };
172
+ }
173
+
174
+ /**
175
+ * Contains a channel Group ID
176
+ * @type {string}
177
+ */
178
+ get gid() {
179
+ return _getXmlChildElementParam(this.#_host, XEPG_CHNGID_ETAG_NAME).trim();
180
+ }
181
+
182
+ set gid(value) {
183
+ if (typeof value === 'string' && this.id !== '') {
184
+ const item = insertXObjElement(
185
+ this.#_host,
186
+ XEPG_CHNGID_ETAG_NAME,
187
+ { force: true },
188
+ );
189
+ if (item) {
190
+ writeXObjParam(item, value.trim(), defParseOptionsSettings.textKey);
191
+ };
192
+ };
193
+ }
194
+
195
+ /**
196
+ * Contains a channel source URL
197
+ * @type {string}
198
+ */
199
+ get url() {
200
+ return _getXmlChildElementParam(this.#_host, XEPG_CHNURL_ETAG_NAME).trim();
201
+ }
202
+
203
+ set url(value) {
204
+ if (typeof value === 'string' && this.id !== '') {
205
+ const item = insertXObjElement(
206
+ this.#_host,
207
+ XEPG_CHNURL_ETAG_NAME,
208
+ { force: true },
209
+ );
210
+ if (item) {
211
+ writeXObjParam(item, value.trim(), defParseOptionsSettings.textKey);
212
+ };
213
+ };
214
+ }
215
+
216
+ /**
217
+ * Tries to set a channel ID
218
+ * @param {string} value - channel ID
219
+ * @returns {boolean}
220
+ */
221
+ setID(value) {
222
+ let isSucceed = false;
223
+ if (typeof value === 'string') {
224
+ const chnid = value.trim();
225
+ const item = insertXObjElement(
226
+ this.#_host,
227
+ XEPG_CHNID_ETAG_NAME,
228
+ { force: true },
229
+ );
230
+ if (item) {
231
+ isSucceed = writeXObjParam(item, chnid, defParseOptionsSettings.textKey);
232
+ };
233
+ };
234
+ return isSucceed;
235
+ }
236
+
237
+ /**
238
+ * Returns a channel info
239
+ * @returns {IXEpgChnInfoDesc}
240
+ */
241
+ getInfo() {
242
+ const {
243
+ id: chnid,
244
+ name: chname,
245
+ gid: chngid,
246
+ url: srcurl,
247
+ } = this;
248
+ /** @type {IXEpgChnInfoDesc} */
249
+ return {
250
+ chnid,
251
+ chname,
252
+ chngid,
253
+ srcurl,
254
+ };
255
+ }
256
+
257
+ /**
258
+ * Sets a channel info
259
+ * @param {setInfoParam|IXEpgChnInfoDesc} obj - channel info descriptor
260
+ * @returns {void}
261
+ * @todo [since v0.0.30] deprecate use of `obj`-param as string
262
+ */
263
+ setInfo(obj) {
264
+ let chnid = '';
265
+ let chname = '';
266
+ let chngid = '';
267
+ let srcurl = '';
268
+ if (isObject(obj)) {
269
+ ({ chnid } = obj);
270
+ if (typeof chnid === 'string') {
271
+ ({ chname, chngid, srcurl } = obj);
272
+ } else {
273
+ // // TODO: [?] deprecate
274
+ chnid = _getXmlChildElementParam(obj, XEPG_CHNID_ETAG_NAME).trim();
275
+ chname = _getXmlChildElementParam(obj, XEPG_CHNNAME_ETAG_NAME).trim();
276
+ chngid = _getXmlChildElementParam(obj, XEPG_CHNGID_ETAG_NAME).trim();
277
+ srcurl = _getXmlChildElementParam(obj, XEPG_CHNURL_ETAG_NAME).trim();
278
+ };
279
+ } else if (typeof obj === 'string') {
280
+ chnid = obj;
281
+ } else {
282
+ return;
283
+ };
284
+ chnid = typeof chnid === 'string' ? chnid.trim() : '';
285
+ if (chnid === '') {
286
+ chname = '';
287
+ chngid = '';
288
+ srcurl = '';
289
+ } else {
290
+ chname = typeof chname === 'string' ? chname.trim() : '';
291
+ chngid = typeof chngid === 'string' ? chngid.trim() : '';
292
+ srcurl = typeof srcurl === 'string' ? srcurl.trim() : '';
293
+ };
294
+ let item = null;
295
+ const _host = this.#_host;
296
+ const text_key = defParseOptionsSettings.textKey;
297
+ item = insertXObjElement(_host, XEPG_CHNID_ETAG_NAME, { force: true });
298
+ if (item) writeXObjParam(item, chnid, text_key);
299
+ item = insertXObjElement(_host, XEPG_CHNNAME_ETAG_NAME, { force: true });
300
+ if (item) writeXObjParam(item, chname, text_key);
301
+ item = insertXObjElement(_host, XEPG_CHNGID_ETAG_NAME, { force: true });
302
+ if (item) writeXObjParam(item, chngid, text_key);
303
+ item = insertXObjElement(_host, XEPG_CHNURL_ETAG_NAME, { force: true });
304
+ if (item) writeXObjParam(item, srcurl, text_key);
305
+ }
306
+
307
+ }
308
+ module.exports.TXEpgChannelContainer = TXEpgChannelContainer;
@@ -0,0 +1,67 @@
1
+ export namespace XEPG_CONSTANTS {
2
+ export { ALLOWED_XEPG_DOCUMENT_SCHEMA };
3
+ export { XEPG_DEF_NS_NAME };
4
+ export { XEPG_DEF_NS_PATH };
5
+ export { XEPG_XML_DOC_VERSION };
6
+ export { XEPG_DEF_ENCODING_VALUE };
7
+ export { XEPG_DEF_DOCUMENT_TYPE };
8
+ export { XEPG_DEF_DOCUMENT_SCHEMA };
9
+ export { XEPG_DEF_PROVIDER_NAME };
10
+ export { XEPG_DEF_PROVIDER_VER };
11
+ }
12
+ export namespace XEPG_DEF_TNAMES {
13
+ export { XEPG_ROOT_ETAG_NAME };
14
+ export { XEPG_HEADER_ETAG_NAME };
15
+ export { XEPG_BODY_ETAG_NAME };
16
+ export { XEPG_SCHED_ETAG_NAME };
17
+ export { XEPG_PRVINFO_ETAG_NAME };
18
+ export { XEPG_DTSINFO_ETAG_NAME };
19
+ export { XEPG_DOCDTO_ETAG_NAME };
20
+ export { XEPG_DOCDTE_ETAG_NAME };
21
+ export { XEPG_DOCTZ_ETAG_NAME };
22
+ export { XEPG_DOCSCH_ETAG_NAME };
23
+ export { XEPG_DOCTYP_ETAG_NAME };
24
+ export { XEPG_CHNID_ETAG_NAME };
25
+ export { XEPG_CHNNAME_ETAG_NAME };
26
+ export { XEPG_CHNGID_ETAG_NAME };
27
+ export { XEPG_CHNURL_ETAG_NAME };
28
+ export { XEPG_SCHEDTIME_ETAG_NAME };
29
+ export { XEPG_SCHEDTITL_ETAG_NAME };
30
+ export { XEPG_SCHEDCAT_ETAG_NAME };
31
+ export { XEPG_SCHEDPMARK_ETAG_NAME };
32
+ export { XEPG_SCHEDDESC_ETAG_NAME };
33
+ }
34
+ export const defParseOptionsSettings: import("@ygracs/xobj-lib-js").OPT_parserOptions;
35
+ /**
36
+ * A list of a document schema version supported by a library
37
+ */
38
+ declare const ALLOWED_XEPG_DOCUMENT_SCHEMA: string[];
39
+ declare const XEPG_DEF_NS_NAME: "tvp";
40
+ declare const XEPG_DEF_NS_PATH: "urn:e-doc:epg-doc:xepg";
41
+ declare const XEPG_XML_DOC_VERSION: "1.0";
42
+ declare const XEPG_DEF_ENCODING_VALUE: "UTF-8";
43
+ declare const XEPG_DEF_DOCUMENT_TYPE: "xepg";
44
+ declare const XEPG_DEF_DOCUMENT_SCHEMA: string;
45
+ declare const XEPG_DEF_PROVIDER_NAME: "xepg-lib-js";
46
+ declare const XEPG_DEF_PROVIDER_VER: "0.0.30";
47
+ declare const XEPG_ROOT_ETAG_NAME: "epgdoc";
48
+ declare const XEPG_HEADER_ETAG_NAME: "tvp:info";
49
+ declare const XEPG_BODY_ETAG_NAME: "tvp:list";
50
+ declare const XEPG_SCHED_ETAG_NAME: "tvp:item";
51
+ declare const XEPG_PRVINFO_ETAG_NAME: "tvp:provider";
52
+ declare const XEPG_DTSINFO_ETAG_NAME: "tvp:dtstype";
53
+ declare const XEPG_DOCDTO_ETAG_NAME: "tvp:time";
54
+ declare const XEPG_DOCDTE_ETAG_NAME: "tvp:expire";
55
+ declare const XEPG_DOCTZ_ETAG_NAME: "tvp:timezone";
56
+ declare const XEPG_DOCSCH_ETAG_NAME: "tvp:schema";
57
+ declare const XEPG_DOCTYP_ETAG_NAME: "tvp:doctype";
58
+ declare const XEPG_CHNID_ETAG_NAME: "tvp:chnid";
59
+ declare const XEPG_CHNNAME_ETAG_NAME: "tvp:chname";
60
+ declare const XEPG_CHNGID_ETAG_NAME: "tvp:chngid";
61
+ declare const XEPG_CHNURL_ETAG_NAME: "tvp:srcurl";
62
+ declare const XEPG_SCHEDTIME_ETAG_NAME: "tvp:time";
63
+ declare const XEPG_SCHEDTITL_ETAG_NAME: "tvp:title";
64
+ declare const XEPG_SCHEDCAT_ETAG_NAME: "tvp:cat";
65
+ declare const XEPG_SCHEDPMARK_ETAG_NAME: "tvp:pcmark";
66
+ declare const XEPG_SCHEDDESC_ETAG_NAME: "tvp:desc";
67
+ export {};
@@ -0,0 +1,88 @@
1
+ // [v0.3.149-20260612]
2
+
3
+ const {
4
+ TXmlContentParseOptions,
5
+ } = require('@ygracs/xobj-lib-js');
6
+
7
+ // === module init block ===
8
+
9
+ // === module inner block ===
10
+
11
+ // === module main block ===
12
+
13
+ /**
14
+ * A list of a document schema version supported by a library
15
+ */
16
+ const ALLOWED_XEPG_DOCUMENT_SCHEMA = [ '0.2' ];
17
+
18
+ const XEPG_DEF_NS_NAME = 'tvp';
19
+ const XEPG_DEF_NS_PATH = 'urn:e-doc:epg-doc:xepg';
20
+ const XEPG_XML_DOC_VERSION = '1.0';
21
+ const XEPG_DEF_ENCODING_VALUE = 'UTF-8';
22
+ const XEPG_DEF_DOCUMENT_TYPE = 'xepg';
23
+ const XEPG_DEF_DOCUMENT_SCHEMA = ALLOWED_XEPG_DOCUMENT_SCHEMA[0];
24
+ const XEPG_DEF_PROVIDER_NAME = 'xepg-lib-js';
25
+ const XEPG_DEF_PROVIDER_VER = '0.0.30';
26
+
27
+ const XEPG_CONSTANTS = {
28
+ ALLOWED_XEPG_DOCUMENT_SCHEMA,
29
+ XEPG_DEF_NS_NAME,
30
+ XEPG_DEF_NS_PATH,
31
+ XEPG_XML_DOC_VERSION,
32
+ XEPG_DEF_ENCODING_VALUE,
33
+ XEPG_DEF_DOCUMENT_TYPE,
34
+ XEPG_DEF_DOCUMENT_SCHEMA,
35
+ XEPG_DEF_PROVIDER_NAME,
36
+ XEPG_DEF_PROVIDER_VER,
37
+ };
38
+ module.exports.XEPG_CONSTANTS = XEPG_CONSTANTS;
39
+
40
+ const XEPG_ROOT_ETAG_NAME = 'epgdoc';
41
+ const XEPG_HEADER_ETAG_NAME = `${XEPG_DEF_NS_NAME}:info`;
42
+ const XEPG_BODY_ETAG_NAME = `${XEPG_DEF_NS_NAME}:list`;
43
+ const XEPG_SCHED_ETAG_NAME = `${XEPG_DEF_NS_NAME}:item`;
44
+ const XEPG_PRVINFO_ETAG_NAME = `${XEPG_DEF_NS_NAME}:provider`;
45
+ const XEPG_DTSINFO_ETAG_NAME = `${XEPG_DEF_NS_NAME}:dtstype`;
46
+ const XEPG_DOCDTO_ETAG_NAME = `${XEPG_DEF_NS_NAME}:time`;
47
+ const XEPG_DOCDTE_ETAG_NAME = `${XEPG_DEF_NS_NAME}:expire`;
48
+ const XEPG_DOCTZ_ETAG_NAME = `${XEPG_DEF_NS_NAME}:timezone`;
49
+ const XEPG_DOCSCH_ETAG_NAME = `${XEPG_DEF_NS_NAME}:schema`;
50
+ const XEPG_DOCTYP_ETAG_NAME = `${XEPG_DEF_NS_NAME}:doctype`;
51
+ const XEPG_CHNID_ETAG_NAME = `${XEPG_DEF_NS_NAME}:chnid`;
52
+ const XEPG_CHNNAME_ETAG_NAME = `${XEPG_DEF_NS_NAME}:chname`;
53
+ const XEPG_CHNGID_ETAG_NAME = `${XEPG_DEF_NS_NAME}:chngid`;
54
+ const XEPG_CHNURL_ETAG_NAME = `${XEPG_DEF_NS_NAME}:srcurl`;
55
+ const XEPG_SCHEDTIME_ETAG_NAME = `${XEPG_DEF_NS_NAME}:time`;
56
+ const XEPG_SCHEDTITL_ETAG_NAME = `${XEPG_DEF_NS_NAME}:title`;
57
+ const XEPG_SCHEDCAT_ETAG_NAME = `${XEPG_DEF_NS_NAME}:cat`;
58
+ const XEPG_SCHEDPMARK_ETAG_NAME = `${XEPG_DEF_NS_NAME}:pcmark`;
59
+ const XEPG_SCHEDDESC_ETAG_NAME = `${XEPG_DEF_NS_NAME}:desc`;
60
+
61
+ const XEPG_DEF_TNAMES = {
62
+ XEPG_ROOT_ETAG_NAME,
63
+ XEPG_HEADER_ETAG_NAME,
64
+ XEPG_BODY_ETAG_NAME,
65
+ XEPG_SCHED_ETAG_NAME,
66
+ XEPG_PRVINFO_ETAG_NAME,
67
+ XEPG_DTSINFO_ETAG_NAME,
68
+ XEPG_DOCDTO_ETAG_NAME,
69
+ XEPG_DOCDTE_ETAG_NAME,
70
+ XEPG_DOCTZ_ETAG_NAME,
71
+ XEPG_DOCSCH_ETAG_NAME,
72
+ XEPG_DOCTYP_ETAG_NAME,
73
+ XEPG_CHNID_ETAG_NAME,
74
+ XEPG_CHNNAME_ETAG_NAME,
75
+ XEPG_CHNGID_ETAG_NAME,
76
+ XEPG_CHNURL_ETAG_NAME,
77
+ XEPG_SCHEDTIME_ETAG_NAME,
78
+ XEPG_SCHEDTITL_ETAG_NAME,
79
+ XEPG_SCHEDCAT_ETAG_NAME,
80
+ XEPG_SCHEDPMARK_ETAG_NAME,
81
+ XEPG_SCHEDDESC_ETAG_NAME,
82
+ };
83
+ module.exports.XEPG_DEF_TNAMES = XEPG_DEF_TNAMES;
84
+
85
+ const defParseOptions = new TXmlContentParseOptions();
86
+ const defParseOptionsSettings = defParseOptions.settings;
87
+ //console.log('CHECK: defParseOptions => '+JSON.stringify(defParseOptions, null, 2));
88
+ module.exports.defParseOptionsSettings = defParseOptionsSettings;
@@ -0,0 +1,231 @@
1
+ /**
2
+ * A schedule info descriptor
3
+ */
4
+ export type IXEpgShedInfoDesc = {
5
+ /**
6
+ * - a schedule start time
7
+ */
8
+ time: number;
9
+ /**
10
+ * - schedule title
11
+ */
12
+ title: string;
13
+ /**
14
+ * - schedule category
15
+ */
16
+ cat?: string;
17
+ /**
18
+ * - schedule rating
19
+ */
20
+ pcmark?: number;
21
+ /**
22
+ * - schedule description
23
+ */
24
+ descr?: string;
25
+ };
26
+ export const IXEpgShedInfoDesc: IXEpgShedInfoDesc;
27
+ /**
28
+ * An XEPG-element options set (base)
29
+ */
30
+ export type OPT_epgelsett_bs = {
31
+ /**
32
+ * - parser options
33
+ */
34
+ parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
35
+ };
36
+ /**
37
+ * An XEPG-element options set (base)
38
+ */
39
+ export type XEpgElementConfigBase = {
40
+ /**
41
+ * - parser options
42
+ */
43
+ parseOptions: InstanceType<typeof TXmlContentParseOptions>;
44
+ };
45
+ /**
46
+ * An extra options set
47
+ */
48
+ export type OPT_extra = {
49
+ /**
50
+ * - 'DTS'-settings
51
+ */
52
+ dts_src?: object;
53
+ /**
54
+ * - 'TZ'-settings
55
+ */
56
+ tz_src?: object;
57
+ };
58
+ /**
59
+ * An XEPG-element options set (extend)
60
+ */
61
+ export type OPT_epgelsett_ex = {
62
+ /**
63
+ * - parser options
64
+ */
65
+ parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
66
+ dts_src?: object;
67
+ tz_src?: object;
68
+ };
69
+
70
+ /**
71
+ * This class implements an interface of a EPG-schedule element
72
+ * @since 0.0.22
73
+ */
74
+ export class TXEpgScheduleItem {
75
+ /**
76
+ * Creates an instance of the EPG-schedule element
77
+ */
78
+ constructor(obj: INode, opt?: OPT_epgelsett_ex, extra?: OPT_extra);
79
+ /**
80
+ * Contains a dtstype ID
81
+ */
82
+ get dtstype(): number;
83
+ /**
84
+ * Contains a TZ-offset
85
+ */
86
+ get curDocTZ(): number;
87
+ /**
88
+ * Contains a schedule start time as a timestamp
89
+ */
90
+ get time(): number;
91
+ /**
92
+ * Contains a schedule title
93
+ */
94
+ get title(): string;
95
+ /**
96
+ * Contains a schedule category
97
+ */
98
+ get category(): string;
99
+ /**
100
+ * Contains a schedule rating value (aka pcmark)
101
+ */
102
+ get rating(): number;
103
+ /**
104
+ * Contains a schedule description
105
+ */
106
+ get descr(): string;
107
+ /**
108
+ * Returns a schedule info item descriptor
109
+ */
110
+ getInfo(): IXEpgShedInfoDesc;
111
+ /**
112
+ * Sets a schedule start time.
113
+ */
114
+ setTime(value: number | string | Date): boolean;
115
+ /**
116
+ * Sets a schedule title.
117
+ */
118
+ setTitle(value: string): boolean;
119
+ /**
120
+ * Sets a schedule title.
121
+ */
122
+ setCategory(value: string): boolean;
123
+ /**
124
+ * Sets a schedule rating value.
125
+ */
126
+ setRating(value: number | string): boolean;
127
+ /**
128
+ * Sets a schedule description.
129
+ */
130
+ setDescr(value: string): boolean;
131
+ /**
132
+ * Returns an instance content as a string in an XML-format.
133
+ */
134
+ saveToXMLString(): string;
135
+ /**
136
+ * Loads an element content from a string.
137
+ * @since v0.0.24
138
+ * @throws {Error}
139
+ * @experimental
140
+ */
141
+ loadFromXMLString(xmlString: string): boolean;
142
+ #private;
143
+ }
144
+
145
+ /**
146
+ * This class implements an interface of a EPG-schedules list
147
+ */
148
+ export class TXEpgSchedulesList {
149
+ /**
150
+ * Creates an instance of the schedules list
151
+ */
152
+ constructor(obj: INode[], opt?: OPT_epgelsett_ex, extra?: OPT_extra);
153
+ /**
154
+ * Contains a quantity of a schedules
155
+ * @deprecated
156
+ * @todo \[since `v0.0.24`] deprecated. Use `TXEpgSchedulesList.count`
157
+ */
158
+ get schedQty(): number;
159
+ /**
160
+ * Contains a quantity of a schedules
161
+ * @since v0.0.24
162
+ */
163
+ get count(): number;
164
+ /**
165
+ * Contains a dtstype ID
166
+ */
167
+ get dtstype(): number;
168
+ /**
169
+ * Contains a TZ-offset
170
+ */
171
+ get curDocTZ(): number;
172
+ /**
173
+ * Indicates whether an instance has none member
174
+ * @since v0.0.24
175
+ */
176
+ isEmpty(): boolean;
177
+ /**
178
+ * Indicates whether an instance has any member
179
+ * @since v0.0.24
180
+ */
181
+ isNotEmpty(): boolean;
182
+ /**
183
+ * Checks whether a given value is a valid index and it fits the index range
184
+ * of an instance
185
+ * @since 0.0.20
186
+ * @deprecated
187
+ * @todo \[since v0.0.30] deprecated. Use {@link checkIndex} instead
188
+ */
189
+ chkIndex(value: number | string): boolean;
190
+ /**
191
+ * Checks whether a given value is a valid index and it fits the index range
192
+ * of an instance
193
+ * @since 0.0.30
194
+ */
195
+ checkIndex(value: number | string): boolean;
196
+ /**
197
+ * Returns a schedule element addressed by a given index
198
+ * @since 0.0.22
199
+ */
200
+ schedule(index: number | string): TXEpgScheduleItem | null;
201
+ /**
202
+ * Returns a schedule info item for instance element addressed
203
+ * by a given index
204
+ */
205
+ getScheduleInfo(index: number | string): IXEpgShedInfoDesc | null;
206
+ /**
207
+ * Returns a schedule info for instance members
208
+ */
209
+ getAllSchedulesInfo(): IXEpgShedInfoDesc[];
210
+ /**
211
+ * @protected
212
+ */
213
+ protected asJSON(): string;
214
+ [Symbol.iterator](): {
215
+ next: () => {
216
+ done: boolean;
217
+ value: TXEpgScheduleItem | null;
218
+ } | {
219
+ done: boolean;
220
+ value: undefined;
221
+ };
222
+ return(): {
223
+ done: boolean;
224
+ value: undefined;
225
+ };
226
+ };
227
+ #private;
228
+ }
229
+
230
+ import { TXmlContentParseOptions } from "@ygracs/xobj-lib-js";
231
+ import type { INode } from "@ygracs/xobj-lib-js";