ol-stac 0.0.0

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.
Files changed (107) hide show
  1. package/.eslintignore +2 -0
  2. package/.github/workflows/deploy.yml +67 -0
  3. package/.github/workflows/publish.yml +32 -0
  4. package/.github/workflows/release.yml +21 -0
  5. package/.github/workflows/test.yml +85 -0
  6. package/CHANGELOG.md +14 -0
  7. package/DEVELOPING.md +104 -0
  8. package/LICENSE.md +201 -0
  9. package/README.md +43 -0
  10. package/config/jsdoc/api/conf.json +38 -0
  11. package/config/jsdoc/api/index.md +1 -0
  12. package/config/jsdoc/api/readme.md +65 -0
  13. package/config/jsdoc/api/template/README.md +3 -0
  14. package/config/jsdoc/api/template/publish.js +743 -0
  15. package/config/jsdoc/api/template/static/scripts/linenumber.js +11 -0
  16. package/config/jsdoc/api/template/static/scripts/main.js +305 -0
  17. package/config/jsdoc/api/template/static/scripts/prettify/Apache-License-2.0.txt +202 -0
  18. package/config/jsdoc/api/template/static/scripts/prettify/lang-css.js +2 -0
  19. package/config/jsdoc/api/template/static/scripts/prettify/prettify.js +28 -0
  20. package/config/jsdoc/api/template/static/styles/carbon.css +65 -0
  21. package/config/jsdoc/api/template/static/styles/jaguar.css +512 -0
  22. package/config/jsdoc/api/template/static/styles/prettify-jsdoc.css +111 -0
  23. package/config/jsdoc/api/template/static/styles/prettify-tomorrow.css +132 -0
  24. package/config/jsdoc/api/template/static/theme +1 -0
  25. package/config/jsdoc/api/template/tmpl/container.tmpl +205 -0
  26. package/config/jsdoc/api/template/tmpl/details.tmpl +84 -0
  27. package/config/jsdoc/api/template/tmpl/example.tmpl +2 -0
  28. package/config/jsdoc/api/template/tmpl/examples.tmpl +16 -0
  29. package/config/jsdoc/api/template/tmpl/exceptions.tmpl +30 -0
  30. package/config/jsdoc/api/template/tmpl/layout.tmpl +92 -0
  31. package/config/jsdoc/api/template/tmpl/mainpage.tmpl +14 -0
  32. package/config/jsdoc/api/template/tmpl/members.tmpl +38 -0
  33. package/config/jsdoc/api/template/tmpl/method.tmpl +132 -0
  34. package/config/jsdoc/api/template/tmpl/navigation.tmpl +59 -0
  35. package/config/jsdoc/api/template/tmpl/observables.tmpl +39 -0
  36. package/config/jsdoc/api/template/tmpl/params.tmpl +109 -0
  37. package/config/jsdoc/api/template/tmpl/properties.tmpl +85 -0
  38. package/config/jsdoc/api/template/tmpl/returns.tmpl +72 -0
  39. package/config/jsdoc/api/template/tmpl/source.tmpl +8 -0
  40. package/config/jsdoc/api/template/tmpl/stability.tmpl +7 -0
  41. package/config/jsdoc/api/template/tmpl/tutorial.tmpl +19 -0
  42. package/config/jsdoc/api/template/tmpl/type.tmpl +7 -0
  43. package/config/jsdoc/info/conf.json +22 -0
  44. package/config/jsdoc/info/publish.js +175 -0
  45. package/config/jsdoc/package.json +4 -0
  46. package/config/jsdoc/plugins/api.cjs +181 -0
  47. package/config/jsdoc/plugins/default-export.cjs +35 -0
  48. package/config/jsdoc/plugins/define-plugin.cjs +33 -0
  49. package/config/jsdoc/plugins/events.cjs +39 -0
  50. package/config/jsdoc/plugins/inline-options.cjs +102 -0
  51. package/config/jsdoc/plugins/markdown.cjs +119 -0
  52. package/config/jsdoc/plugins/observable.cjs +69 -0
  53. package/config/jsdoc/plugins/virtual-plugin.cjs +16 -0
  54. package/config/rollup-full-build.js +24 -0
  55. package/config/tsconfig-build.json +25 -0
  56. package/examples/.eslintrc +29 -0
  57. package/examples/index.html +100 -0
  58. package/examples/index.js +109 -0
  59. package/examples/planetary-computer.html +14 -0
  60. package/examples/planetary-computer.js +53 -0
  61. package/examples/resources/Jugl.js +15 -0
  62. package/examples/resources/common.js +111 -0
  63. package/examples/stac-collection-webmaplinks.html +9 -0
  64. package/examples/stac-collection-webmaplinks.js +55 -0
  65. package/examples/stac-item-from-object.html +9 -0
  66. package/examples/stac-item-from-object.js +102 -0
  67. package/examples/stac-item-tileserver.html +9 -0
  68. package/examples/stac-item-tileserver.js +34 -0
  69. package/examples/stac-item.html +9 -0
  70. package/examples/stac-item.js +45 -0
  71. package/examples/stac-itemcollection.html +11 -0
  72. package/examples/stac-itemcollection.js +39 -0
  73. package/examples/templates/example.html +206 -0
  74. package/examples/templates/readme.md +3 -0
  75. package/examples/webpack/config.mjs +69 -0
  76. package/examples/webpack/example-builder.js +410 -0
  77. package/package.json +107 -0
  78. package/site/build.js +26 -0
  79. package/site/layouts/default.hbs +78 -0
  80. package/site/src/doc/faq.md +8 -0
  81. package/site/src/doc/index.md +22 -0
  82. package/site/src/doc/quickstart.md +121 -0
  83. package/site/src/doc/tutorials/index.md +8 -0
  84. package/site/src/download/index.hbs +62 -0
  85. package/site/src/favicon.ico +0 -0
  86. package/site/src/index.hbs +71 -0
  87. package/site/src/theme/index.css +26 -0
  88. package/site/src/theme/site.css +531 -0
  89. package/src/ol/events/ErrorEvent.js +25 -0
  90. package/src/ol/layer/STAC.js +780 -0
  91. package/src/ol/layer/stacUtil.js +169 -0
  92. package/src/ol/source/GeoTIFF2.js +47 -0
  93. package/tasks/.eslintrc +5 -0
  94. package/tasks/build-website.sh +90 -0
  95. package/tasks/create-release.js +107 -0
  96. package/tasks/generate-index.js +125 -0
  97. package/tasks/generate-info.js +189 -0
  98. package/tasks/get-latest-release.js +36 -0
  99. package/tasks/newest-tag.js +52 -0
  100. package/tasks/prepare-package.js +46 -0
  101. package/tasks/publish.sh +90 -0
  102. package/test/README.md +56 -0
  103. package/test/browser/.eslintrc +14 -0
  104. package/test/browser/karma.config.cjs +94 -0
  105. package/test/browser/spec/ol/layer/STAC.test.js +18 -0
  106. package/test/browser/test-extensions.js +419 -0
  107. package/tsconfig.json +62 -0
@@ -0,0 +1,132 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+ var version = self.find({kind: 'package' })[0].version;
5
+ if (/-dev$/.test(version)) {
6
+ version = 'main';
7
+ } else {
8
+ version = 'v' + version;
9
+ }
10
+ ?>
11
+ <dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
12
+ <?js if (data.stability || kind !== 'class') { ?>
13
+ <div class="nameContainer<?js if (data.inherited) { ?> inherited<?js } ?>">
14
+ <div class="anchor" id="<?js= id ?>">
15
+ </div>
16
+ <h4 class="name">
17
+ <?js= data.attribs + (kind === 'class' ? 'new ' : '') + this.getShortName(longname) + (kind !== 'event' ? data.signature : '') ?>
18
+ <?js if (data.inherited || data.inherits) { ?>
19
+ <span class="inherited"><?js= this.linkto(data.inherits, 'inherited') ?></span>
20
+ <?js } ?>
21
+ <?js= this.partial('stability.tmpl', data) ?>
22
+ </h4>
23
+ <?js if (data.meta) {?>
24
+ <div class="tag-source">
25
+ <a href="https://github.com/m-mohr/ol-stac/blob/<?js= version ?>/src/ol/<?js= meta.filename ?>"><?js= meta.filename ?></a>,
26
+ <a href="https://github.com/m-mohr/ol-stac/blob/<?js= version ?>/src/ol/<?js= meta.filename ?>#L<?js= meta.lineno ?>">line <?js= meta.lineno ?></a>
27
+ </div>
28
+ <?js } ?>
29
+ </div>
30
+ <?js } ?>
31
+ <?js if (data.summary) { ?>
32
+ <p class="summary"><?js= summary ?></p>
33
+ <?js } ?>
34
+ </dt>
35
+ <dd class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
36
+
37
+ <?js if (data.parent && data.parent.kind == 'module') { ?>
38
+ <?js const importName = data.isDefaultExport ? data.name : `{${data.name}}`; ?>
39
+ <pre class="prettyprint source"><code>import <?js= importName ?> from '<?js= data.parent.name ?>';</code></pre>
40
+ <?js } ?>
41
+
42
+ <?js if (data.description) { ?>
43
+ <div class="description">
44
+ <?js= data.description ?>
45
+ </div>
46
+ <?js } ?>
47
+
48
+ <?js if (kind === 'event' && data.type && data.type.names) {?>
49
+ <h5>Type:</h5>
50
+ <ul>
51
+ <li>
52
+ <?js= self.partial('type.tmpl', data.type.names) ?>
53
+ </li>
54
+ </ul>
55
+ <?js } ?>
56
+
57
+ <?js if (data['this']) { ?>
58
+ <h5>This:</h5>
59
+ <ul><li><?js= this.linkto(data['this']) ?></li></ul>
60
+ <?js } ?>
61
+
62
+ <?js if (data.stability || kind !== 'class') { ?>
63
+ <?js if (data.params && params.length) { ?>
64
+ <?js= this.partial('params.tmpl', params) ?>
65
+ <?js } ?>
66
+ <?js } ?>
67
+
68
+ <?js= this.partial('details.tmpl', data) ?>
69
+
70
+ <?js if (data.fires && fires.length) { ?>
71
+ <h5>Fires:</h5>
72
+ <ul><?js fires.forEach(function(f) {
73
+ var parts = f.split(/#?event:/);
74
+ var type = parts.pop();
75
+ var eventClass = self.find({longname: parts[0]})[0];
76
+ parts = type.split(' ');
77
+ type = parts.shift();
78
+ var description = parts.length ? parts.join(' ') : '';
79
+ var eventDoclet = self.find({longname: f})[0];
80
+ if (eventDoclet && !description && eventDoclet.description) {
81
+ description = eventDoclet.description.replace(/<[^>]*>/g, '');
82
+ }
83
+ ?>
84
+ <li class="<?js= (eventDoclet || data).stability !== 'stable' ? 'unstable' : '' ?>">
85
+ <code><?js= eventClass ? self.linkto(f, type) : type ?></code>
86
+ <?js if (eventClass) { ?>
87
+ (<?js= self.linkto(eventClass.longname) ?>)
88
+ <?js } ?>
89
+ <?js= self.partial('stability.tmpl', eventDoclet || (data.stability ? data : {})) ?>
90
+ <?js if (description) { ?> -
91
+ <?js= description ?>
92
+ <?js } ?>
93
+ </li>
94
+ <?js }); ?></ul>
95
+ <?js } ?>
96
+
97
+ <?js if (data.listens && listens.length) { ?>
98
+ <h5>Listens to Events:</h5>
99
+ <ul><?js listens.forEach(function(f) { ?>
100
+ <li><?js= self.linkto(f) ?></li>
101
+ <?js }); ?></ul>
102
+ <?js } ?>
103
+
104
+ <?js if (data.listeners && listeners.length) { ?>
105
+ <h5>Listeners of This Event:</h5>
106
+ <ul><?js listeners.forEach(function(f) { ?>
107
+ <li><?js= self.linkto(f) ?></li>
108
+ <?js }); ?></ul>
109
+ <?js } ?>
110
+
111
+ <?js if (data.exceptions && exceptions.length) { ?>
112
+ <h5>Throws:</h5>
113
+ <?js if (exceptions.length > 1) { ?><ul><?js
114
+ exceptions.forEach(function(r) { ?>
115
+ <li><?js= self.partial('exceptions.tmpl', r) ?></li>
116
+ <?js });
117
+ ?></ul><?js } else {
118
+ exceptions.forEach(function(r) { ?>
119
+ <?js= self.partial('exceptions.tmpl', r) ?>
120
+ <?js });
121
+ } } ?>
122
+
123
+ <?js if (data.returns && returns.length) { ?>
124
+ <?js if (returns.length > 1) { ?><h5>Returns:</h5><?js } ?>
125
+ <?js= self.partial('returns.tmpl', data.returns) ?>
126
+ <?js } ?>
127
+
128
+ <?js if (data.examples && examples.length) { ?>
129
+ <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
130
+ <?js= this.partial('examples.tmpl', examples) ?>
131
+ <?js } ?>
132
+ </dd>
@@ -0,0 +1,59 @@
1
+ <?js
2
+ var self = this;
3
+
4
+ function toShortName(name) {
5
+ return name.startsWith('module:') ? name.split('/').pop() : name;
6
+ }
7
+
8
+ function getItemCssClass(type) {
9
+ if (type === 'module') {
10
+ return 'fa-plus';
11
+ } else if (type === 'class') {
12
+ return 'fa-chevron-right';
13
+ }
14
+ return '';
15
+ }
16
+
17
+ const printListItem = (member) => {
18
+ const shortName = toShortName(member.name); ?>
19
+ <li data-name="<?js= shortName.toLowerCase() ?>"><?js= self.linkto(member.longname, shortName) ?><?js
20
+ };
21
+ const printListItemWithStability = (member) => {
22
+ const shortName = toShortName(member.name);
23
+ const cls = member.stability && member.stability !== 'stable' ? ' class="unstable"' : ''; ?>
24
+ <li data-name="<?js= shortName.toLowerCase() ?>"<?js= cls ?>><?js= self.linkto(member.longname, shortName) ?><?js
25
+ };
26
+ const printFiresListItem = (eventName) => {
27
+ const ancestor = self.find({longname: eventName})[0] ||
28
+ {longname: eventName, name: eventName.split(/#?event:/)[1]};
29
+ const eventEnum = ancestor.longname.split(/#?event:/)[0];
30
+ if (self.find({longname: eventEnum})[0]) {
31
+ printListItemWithStability(ancestor);
32
+ } else {
33
+ const cls = ancestor.stability && ancestor.stability !== 'stable' ? ' class="unstable"' : '';
34
+ const shortName = toShortName(ancestor.name); ?>
35
+ <li data-name="<?js= shortName.toLowerCase() ?>"<?js= cls ?>><?js= shortName ?><?js
36
+ }
37
+ };
38
+
39
+ function listContent(item, title, listItemPrinter) {
40
+ const type = title.toLowerCase();
41
+ if (item[type] && item[type].length) { ?>
42
+ <div class="member-list" data-type="<?js= type ?>">
43
+ <span class="subtitle"><?js= title ?></span>
44
+ <ul><?js
45
+ item[type].forEach((v) => listItemPrinter(v)); ?>
46
+ </ul>
47
+ </div><?js
48
+ }
49
+ } ?>
50
+ <li class="item item-<?js= item.type ?><?js= obj.classes || '' ?>" data-longname="<?js= item.longname ?>" data-name="<?js= item.prettyname.toLowerCase() ?>">
51
+ <span class="title toggle">
52
+ <span class="fa <?js= getItemCssClass(item.type) ?> me-2 mt-1"></span>
53
+ <span><?js= self.linkto(item.longname, item.prettyname.replace(/[.~\/]/g, '\u200b$&')) ?></span>
54
+ </span><?js
55
+ listContent(item, 'Members', printListItem);
56
+ listContent(item, 'Typedefs', printListItemWithStability);
57
+ listContent(item, 'Methods', printListItemWithStability);
58
+ listContent(item, 'Fires', printFiresListItem);
59
+ ?>
@@ -0,0 +1,39 @@
1
+ <?js
2
+ var props = obj;
3
+ ?>
4
+
5
+ <table class="props">
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th>Type</th>
10
+ <th>Settable</th>
11
+ <th><a href="module-ol_Object.ObjectEvent.html">ObjectEvent</a> type</th>
12
+ <th class="last">Description</th>
13
+ </tr>
14
+ </thead>
15
+
16
+ <tbody>
17
+ <?js
18
+ var self = this;
19
+ var propsByName = {};
20
+ props.forEach(function(prop) {
21
+ if (!prop || propsByName[prop.name]) { return; }
22
+ propsByName[prop.name] = prop;
23
+ var setter = prop.readonly ? 'no' : 'yes';
24
+ ?>
25
+
26
+ <tr class="<?js= (prop.stability && prop.stability !== 'stable') ? 'unstable' : '' ?>">
27
+ <td class="name"><code><?js= prop.name ?></code></td>
28
+ <td class="type">
29
+ <?js if (prop.type && prop.type.names) {?>
30
+ <?js= self.partial('type.tmpl', prop.type.names) ?>
31
+ <?js } ?>
32
+ </td>
33
+ <td class="setter"><?js= setter ?></td>
34
+ <td class="event"><code>change:<?js= prop.name.toLowerCase() ?></code></td>
35
+ <td class="description last"><?js= prop.description ?></td>
36
+ </tr>
37
+ <?js }); ?>
38
+ </tbody>
39
+ </table>
@@ -0,0 +1,109 @@
1
+ <?js
2
+ var params = obj;
3
+
4
+ /* sort subparams under their parent params (like opts.classname) */
5
+ var parentParam = null;
6
+ params.forEach(function(param, i) {
7
+ if (!param) { return; }
8
+ if (parentParam && param.name && param.name.startsWith(parentParam.name + '.')) {
9
+ param.name = param.name.substr(parentParam.name.length+1);
10
+ parentParam.subparams = parentParam.subparams || [];
11
+ parentParam.subparams.push(param);
12
+ params[i] = null;
13
+ }
14
+ else {
15
+ parentParam = param;
16
+ }
17
+ });
18
+
19
+ /* determine if we need extra "attributes" column */
20
+ params.hasAttributes = false;
21
+ params.hasName = false;
22
+
23
+ var colspan = 2;
24
+ params.forEach(function(param) {
25
+ if (!param) { return; }
26
+ if (param.type && param.type.names && param.type.names.includes('undefined')) {
27
+ param.optional = true;
28
+ }
29
+ if (param.name.startsWith('var_')) {
30
+ params.hasAttributes = true;
31
+ param.variable = true;
32
+ }
33
+
34
+ if (param.optional || param.nullable) {
35
+ params.hasAttributes = true;
36
+ }
37
+
38
+ if (param.name) {
39
+ params.hasName = true;
40
+ }
41
+
42
+ });
43
+ ?>
44
+
45
+ <table class="params">
46
+ <thead>
47
+ <tr>
48
+ <?js if (params.hasName) {?>
49
+ <th>Name</th>
50
+ <?js } ?>
51
+
52
+ <th>Type</th>
53
+
54
+ <th class="last">Description</th>
55
+ </tr>
56
+ </thead>
57
+
58
+ <tbody>
59
+ <?js
60
+ var self = this;
61
+
62
+ if (params[0].name === 'options' && params[0].subparams) {
63
+ var onlyOptions = true;
64
+ for (var i = 1; i < params.length; ++i) {
65
+ if (params[i]) {
66
+ onlyOptions = false;
67
+ break;
68
+ }
69
+ }
70
+ if (onlyOptions) {
71
+ var hasName = params.hasName;
72
+ params = params[0].subparams;
73
+ params.hasName = hasName;
74
+ }
75
+ }
76
+
77
+ params.forEach(function(param) {
78
+ if (!param) { return; }
79
+ ?>
80
+
81
+ <tr class="<?js= (param.stability && param.stability !== 'stable') ? 'unstable' : '' ?>">
82
+ <?js if (params.hasName) {?>
83
+ <td class="name"><code><?js= param.name ?></code></td>
84
+ <?js } ?>
85
+
86
+ <?js if (!param.subparams) {?>
87
+ <td class="type">
88
+ <?js if (param.type && param.type.names) {?>
89
+ <?js= self.partial('type.tmpl', param.type.names) + (param.optional && typeof param.defaultvalue === 'undefined' && !param.type.names.includes('undefined') ? ' | undefined' : '') ?>
90
+ <?js if (typeof param.defaultvalue !== 'undefined') { ?>
91
+ (defaults to <?js= self.htmlsafe(param.defaultvalue) ?>)
92
+ <?js } ?>
93
+ <?js } ?>
94
+ </td>
95
+
96
+ <?js } ?>
97
+
98
+ <td<?js= (param.subparams ? ' colspan=' + colspan : ' ') ?> class="description last">
99
+ <?js if (param.stability) { ?>
100
+ <?js= self.partial('stability.tmpl', param) ?>
101
+ <?js } ?>
102
+ <?js= param.description ?><?js if (param.subparams) { ?>
103
+ <?js= self.partial('params.tmpl', param.subparams) ?>
104
+ <?js } ?></td>
105
+ </tr>
106
+
107
+ <?js }); ?>
108
+ </tbody>
109
+ </table>
@@ -0,0 +1,85 @@
1
+ <?js
2
+ var props = obj;
3
+
4
+ /* sort subprops under their parent props (like opts.classname) */
5
+ var parentProp = null;
6
+ props.forEach(function(prop, i) {
7
+ if (!prop) { return; }
8
+ if (parentProp && prop.name && prop.name.startsWith(parentProp.name + '.')) {
9
+ prop.name = prop.name.substr(parentProp.name.length+1);
10
+ parentProp.subprops = parentProp.subprops || [];
11
+ parentProp.subprops.push(prop);
12
+ props[i] = null;
13
+ }
14
+ else {
15
+ parentProp = prop;
16
+ }
17
+ });
18
+
19
+ /* determine if we need extra columns, "attributes" and "default" */
20
+ props.hasAttributes = false;
21
+ props.hasDefault = false;
22
+ props.hasName = false;
23
+
24
+ props.forEach(function(prop) {
25
+ if (!prop) { return; }
26
+
27
+ if (prop.optional || prop.nullable) {
28
+ props.hasAttributes = true;
29
+ }
30
+
31
+ if (prop.name) {
32
+ props.hasName = true;
33
+ }
34
+
35
+ if (typeof prop.defaultvalue !== 'undefined') {
36
+ props.hasDefault = true;
37
+ }
38
+ });
39
+ ?>
40
+
41
+ <table class="props">
42
+ <thead>
43
+ <tr>
44
+ <?js if (props.hasName) {?>
45
+ <th>Name</th>
46
+ <?js } ?>
47
+
48
+ <th>Type</th>
49
+
50
+ <th class="last">Description</th>
51
+ </tr>
52
+ </thead>
53
+
54
+ <tbody>
55
+ <?js
56
+ var self = this;
57
+ props.forEach(function(prop) {
58
+ if (!prop) { return; }
59
+ ?>
60
+
61
+ <tr>
62
+ <?js if (props.hasName) {?>
63
+ <td class="name"><code><?js= prop.name ?></code></td>
64
+ <?js } ?>
65
+
66
+ <td class="type">
67
+ <?js if (prop.type && prop.type.names) {?>
68
+ <?js= self.partial('type.tmpl', prop.type.names) + (prop.optional && typeof prop.defaultvalue === 'undefined' && !prop.type.names.includes('undefined') ? ' | undefined' : '') ?>
69
+ <?js if (typeof prop.defaultvalue !== 'undefined') { ?>
70
+ <br>(defaults to <?js= self.htmlsafe(prop.defaultvalue) ?>)
71
+ <?js } ?>
72
+ <?js } ?>
73
+ </td>
74
+
75
+ <td class="description last">
76
+ <?js= prop.description ?>
77
+ <?js if (prop.subprops) { ?>
78
+ <h6>Properties</h6><?js= self.partial('properties.tmpl', prop.subprops) ?>
79
+ <?js } ?>
80
+ </td>
81
+ </tr>
82
+
83
+ <?js }); ?>
84
+ </tbody>
85
+ </table>
@@ -0,0 +1,72 @@
1
+ <?js
2
+ var returns = obj;
3
+ var parentReturn = null;
4
+
5
+ returns.forEach(function (ret, i) {
6
+ if (ret && (ret.description || ret.name)) {
7
+ ret.description = ret.description.toString().replace(/<\/?p>/g, '');
8
+
9
+ var isNamed = ret.name ? true : false;
10
+ var name = ret.name || ret.description;
11
+ var startSpacePos = name.indexOf(" ");
12
+
13
+ if (parentReturn !== null && name.startsWith(parentReturn.name + '.')) {
14
+ ret.name = isNamed ? name.substr(parentReturn.name.length + 1) : name.substr(parentReturn.name.length + 1, startSpacePos - (parentReturn.name.length + 1));
15
+
16
+ parentReturn.subReturns = parentReturn.subReturns || [];
17
+ parentReturn.subReturns.push(ret);
18
+ returns[i] = null;
19
+ } else {
20
+ if (!isNamed) {
21
+ ret.name = ret.description.substr(0, startSpacePos !== -1 ? startSpacePos : ret.description.length);
22
+ }
23
+
24
+ parentReturn = ret;
25
+ }
26
+ }
27
+ });
28
+ ?>
29
+
30
+ <?js
31
+ if (returns.length > 1) {
32
+ ?>
33
+ <table class="params">
34
+ <thead>
35
+ <tr>
36
+ <th>Name</th>
37
+ <th>Type</th>
38
+ <th class="last">Description</th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ <?js
43
+ var self = this;
44
+ returns.forEach(function(ret) {
45
+ if (!ret) {
46
+ return false;
47
+ }
48
+ ?>
49
+ <tr>
50
+ <td class="name"><code><?js= ret.name ?></code></td>
51
+ <td class="type">
52
+ <?js
53
+ if (ret.type && ret.type.names) {
54
+ ret.type.names.forEach(function(name, i) { ?>
55
+ <?js= self.linkto(name) ?>
56
+ <?js if (i < ret.type.names.length-1) { ?> | <?js } ?>
57
+ <?js });
58
+ }
59
+ ?>
60
+ </td>
61
+ <td class="description last"><?js= ret.description ?><?js if (ret.subReturns) { ?>
62
+ <?js= self.partial('returns.tmpl', ret.subReturns) ?>
63
+ <?js } ?></td>
64
+ </tr>
65
+ <?js }); ?>
66
+ </tbody>
67
+ </table>
68
+ <?js } else if (returns[0].description) { ?>
69
+ <h5>Returns:</h5>
70
+ <?js= returns[0].description ?>
71
+ <br />
72
+ <?js } ?>
@@ -0,0 +1,8 @@
1
+ <?js
2
+ var data = obj;
3
+ ?>
4
+ <section>
5
+ <article>
6
+ <pre class="prettyprint source"><code><?js= data.code ?></code></pre>
7
+ </article>
8
+ </section>
@@ -0,0 +1,7 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+
5
+ if (data.stability && data.stability != 'stable') { ?>
6
+ <span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
7
+ <?js } ?>
@@ -0,0 +1,19 @@
1
+ <section>
2
+
3
+ <header>
4
+ <?js if (children.length > 0) { ?>
5
+ <ul><?js
6
+ var self = this;
7
+ children.forEach(function(t) { ?>
8
+ <li><?js= self.tutoriallink(t.name) ?></li>
9
+ <?js }); ?></ul>
10
+ <?js } ?>
11
+
12
+ <h2><?js= header ?></h2>
13
+ </header>
14
+
15
+ <article>
16
+ <?js= content ?>
17
+ </article>
18
+
19
+ </section>
@@ -0,0 +1,7 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+ data.forEach(function(name, i) { ?>
5
+ <span class="param-type"><?js= self.linkto(name) ?></span>
6
+ <?js if (i < data.length-1) { ?>|<?js } ?>
7
+ <?js }); ?>
@@ -0,0 +1,22 @@
1
+ {
2
+ "opts": {
3
+ "recurse": true,
4
+ "template": "config/jsdoc/info"
5
+ },
6
+ "tags": {
7
+ "allowUnknownTags": true
8
+ },
9
+ "source": {
10
+ "includePattern": "\\.js$"
11
+ },
12
+ "plugins": [
13
+ "jsdoc-plugin-intersection",
14
+ "jsdoc-plugin-typescript",
15
+ "config/jsdoc/plugins/define-plugin.cjs",
16
+ "config/jsdoc/plugins/virtual-plugin.cjs",
17
+ "config/jsdoc/plugins/default-export.cjs"
18
+ ],
19
+ "typescript": {
20
+ "moduleRoot": "src"
21
+ }
22
+ }