-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathxema.types.js
34 lines (30 loc) · 1.36 KB
/
xema.types.js
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
/**
* @typedef {Object} XemaElementChild
* @property {number} min minimum number of occurances, 0 = optional
* @property {number|null} max maximum number of occurances, null = unbounded
* @property {string} name id of the element (note: NOT the element name per se)
*/
/**
* @typedef {Object} XemaAttributeValue
* @property {string} value the value
* @property {string} caption the human-readable display name
*/
/**
* @typedef {Object} XemaAttribute
* @property {'optional'|'obligatory'} optionality
* @property {'txt'|'lst'} filling - text for any text, lst if only a predefined set of values is allowed, which is defined in the values property
* @property {XemaAttributeValue[]} [values] (optional) list of values. Check filling property
*/
/**
* @typedef {Object} XemaElement
* @property {string} [elementName] the xml element name, use the key of this element in Xema.elements if not set.
* @property {'inl'|'txt'|'chd'|'emp'} filling inl = mixed text and elements, txt = text only, chd = element only, emp = empty (no children)
* @property {string[]} values list of options if this element can only have predefined values
* @property {XemaElementChild[]} children
* @property {Object.<string, XemaAttribute>} attributes
*/
/**
* @typedef {Object} Xema
* @property {string} root the id of the root element
* @property {Object.<string, XemaElement>} elements
*/