rclnodejs 1.8.3 → 1.9.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.
- package/README.md +46 -37
- package/index.js +39 -0
- package/lib/action/client.js +61 -3
- package/lib/action/server_goal_handle.js +26 -1
- package/lib/message_info.js +94 -0
- package/lib/node.js +260 -13
- package/lib/parameter_event_handler.js +566 -0
- package/lib/parameter_watcher.js +12 -12
- package/lib/qos_overriding_options.js +358 -0
- package/lib/subscription.js +38 -5
- package/lib/timer.js +3 -2
- package/lib/wait_for_message.js +111 -0
- package/package.json +7 -4
- package/prebuilds/linux-arm64/humble-jammy-arm64-rclnodejs.node +0 -0
- package/prebuilds/linux-arm64/jazzy-noble-arm64-rclnodejs.node +0 -0
- package/prebuilds/linux-arm64/kilted-noble-arm64-rclnodejs.node +0 -0
- package/prebuilds/linux-x64/humble-jammy-x64-rclnodejs.node +0 -0
- package/prebuilds/linux-x64/jazzy-noble-x64-rclnodejs.node +0 -0
- package/prebuilds/linux-x64/kilted-noble-x64-rclnodejs.node +0 -0
- package/scripts/run_asan_test.sh +118 -0
- package/src/executor.cpp +36 -2
- package/src/executor.h +11 -0
- package/src/rcl_action_client_bindings.cpp +70 -1
- package/src/rcl_context_bindings.cpp +3 -3
- package/src/rcl_graph_bindings.cpp +2 -2
- package/src/rcl_subscription_bindings.cpp +70 -2
- package/src/rcl_timer_bindings.cpp +21 -2
- package/src/rcl_utilities.cpp +2 -2
- package/tools/jsdoc/Makefile +5 -0
- package/tools/jsdoc/README.md +96 -0
- package/tools/jsdoc/build-index.js +610 -0
- package/tools/jsdoc/publish.js +854 -0
- package/tools/jsdoc/regenerate-published-docs.js +605 -0
- package/tools/jsdoc/static/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/tools/jsdoc/static/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/tools/jsdoc/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/tools/jsdoc/static/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Light-webfont.eot +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/tools/jsdoc/static/fonts/OpenSans-Light-webfont.woff +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/tools/jsdoc/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/tools/jsdoc/static/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/tools/jsdoc/static/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/tools/jsdoc/static/scripts/linenumber.js +25 -0
- package/tools/jsdoc/static/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/tools/jsdoc/static/scripts/prettify/lang-css.js +36 -0
- package/tools/jsdoc/static/scripts/prettify/prettify.js +738 -0
- package/tools/jsdoc/static/styles/jsdoc-default.css +1012 -0
- package/tools/jsdoc/static/styles/prettify-jsdoc.css +111 -0
- package/tools/jsdoc/static/styles/prettify-tomorrow.css +132 -0
- package/tools/jsdoc/tmpl/augments.tmpl +10 -0
- package/tools/jsdoc/tmpl/container.tmpl +193 -0
- package/tools/jsdoc/tmpl/details.tmpl +143 -0
- package/tools/jsdoc/tmpl/example.tmpl +2 -0
- package/tools/jsdoc/tmpl/examples.tmpl +13 -0
- package/tools/jsdoc/tmpl/exceptions.tmpl +17 -0
- package/tools/jsdoc/tmpl/layout.tmpl +83 -0
- package/tools/jsdoc/tmpl/mainpage.tmpl +163 -0
- package/tools/jsdoc/tmpl/members.tmpl +43 -0
- package/tools/jsdoc/tmpl/method.tmpl +124 -0
- package/tools/jsdoc/tmpl/params.tmpl +133 -0
- package/tools/jsdoc/tmpl/properties.tmpl +110 -0
- package/tools/jsdoc/tmpl/returns.tmpl +12 -0
- package/tools/jsdoc/tmpl/source.tmpl +8 -0
- package/tools/jsdoc/tmpl/tutorial.tmpl +19 -0
- package/tools/jsdoc/tmpl/type.tmpl +7 -0
- package/types/action_client.d.ts +8 -0
- package/types/index.d.ts +34 -0
- package/types/message_info.d.ts +72 -0
- package/types/node.d.ts +90 -5
- package/types/parameter_event_handler.d.ts +150 -0
- package/types/qos.d.ts +55 -0
- package/types/subscription.d.ts +14 -2
- package/types/timer.d.ts +3 -2
- package/test_data_integrity.js +0 -108
- package/test_repro_exact.js +0 -57
- package/test_repro_hz.js +0 -86
- package/test_repro_pub.js +0 -36
- package/test_repro_stress.js +0 -83
- package/test_repro_sub.js +0 -64
- package/test_xproc_data.js +0 -64
- package/types/interfaces.d.ts +0 -8895
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>JSDoc: <?js= title ?></title>
|
|
7
|
+
|
|
8
|
+
<script src="scripts/prettify/prettify.js"> </script>
|
|
9
|
+
<script src="scripts/prettify/lang-css.js"> </script>
|
|
10
|
+
<!--[if lt IE 9]>
|
|
11
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
12
|
+
<![endif]-->
|
|
13
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
15
|
+
</head>
|
|
16
|
+
|
|
17
|
+
<?js
|
|
18
|
+
var packageInfo = this.packageInfo || {};
|
|
19
|
+
var packageName = packageInfo.name || 'rclnodejs';
|
|
20
|
+
var packageVersion = packageInfo.version || '';
|
|
21
|
+
var packageDescription = packageInfo.description || 'ROS 2 client library for Node.js and TypeScript';
|
|
22
|
+
?>
|
|
23
|
+
<body>
|
|
24
|
+
<div class="site-backdrop"></div>
|
|
25
|
+
<div class="site-grid"></div>
|
|
26
|
+
<div class="app-shell">
|
|
27
|
+
<aside class="site-sidebar">
|
|
28
|
+
<div class="brand-card">
|
|
29
|
+
<a class="brand-link" href="index.html">
|
|
30
|
+
<span class="brand-kicker">ROS 2 JavaScript Client</span>
|
|
31
|
+
<strong class="brand-title"><?js= packageName ?></strong>
|
|
32
|
+
<?js if (packageVersion) { ?>
|
|
33
|
+
<span class="brand-version">v<?js= packageVersion ?></span>
|
|
34
|
+
<?js } ?>
|
|
35
|
+
</a>
|
|
36
|
+
<p class="brand-description"><?js= packageDescription ?></p>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<button class="nav-toggle" type="button" aria-expanded="false" aria-controls="site-nav">
|
|
40
|
+
Browse API
|
|
41
|
+
</button>
|
|
42
|
+
|
|
43
|
+
<nav class="site-nav" id="site-nav">
|
|
44
|
+
<?js= this.nav ?>
|
|
45
|
+
</nav>
|
|
46
|
+
</aside>
|
|
47
|
+
|
|
48
|
+
<div class="site-main">
|
|
49
|
+
<header class="site-header">
|
|
50
|
+
<p class="page-eyebrow"><?js= title === 'Home' ? 'Documentation' : 'API Reference' ?></p>
|
|
51
|
+
<h1 class="page-title"><?js= title ?></h1>
|
|
52
|
+
<p class="page-subtitle"><?js= packageDescription ?></p>
|
|
53
|
+
</header>
|
|
54
|
+
|
|
55
|
+
<main id="main">
|
|
56
|
+
<?js= content ?>
|
|
57
|
+
</main>
|
|
58
|
+
|
|
59
|
+
<footer class="site-footer">
|
|
60
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a><?js if(env.conf.templates && env.conf.templates.default && env.conf.templates.default.includeDate !== false) { ?> on <?js= (new Date()) ?><?js } ?>
|
|
61
|
+
</footer>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
prettyPrint();
|
|
67
|
+
(function() {
|
|
68
|
+
var button = document.querySelector('.nav-toggle');
|
|
69
|
+
var shell = document.querySelector('.app-shell');
|
|
70
|
+
|
|
71
|
+
if (!button || !shell) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
button.addEventListener('click', function() {
|
|
76
|
+
var isOpen = shell.classList.toggle('nav-open');
|
|
77
|
+
button.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
|
78
|
+
});
|
|
79
|
+
}());
|
|
80
|
+
</script>
|
|
81
|
+
<script src="scripts/linenumber.js"> </script>
|
|
82
|
+
</body>
|
|
83
|
+
</html>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = obj;
|
|
3
|
+
var self = this;
|
|
4
|
+
var homepage = this.homepage || {};
|
|
5
|
+
?>
|
|
6
|
+
|
|
7
|
+
<?js if (data.kind === 'package') { ?>
|
|
8
|
+
<section class="hero-card">
|
|
9
|
+
<div class="hero-layout">
|
|
10
|
+
<div class="hero-copy">
|
|
11
|
+
<p class="hero-kicker">JavaScript and TypeScript ROS 2 API</p>
|
|
12
|
+
<h2><?js= data.name ?> <span><?js= data.version ?></span></h2>
|
|
13
|
+
<?js if (data.description) { ?>
|
|
14
|
+
<p class="hero-description"><?js= data.description ?></p>
|
|
15
|
+
<?js } ?>
|
|
16
|
+
<p class="hero-lead">Build ROS 2 nodes with a Node.js-native workflow, generated message bindings, and TypeScript-friendly APIs.</p>
|
|
17
|
+
<div class="hero-actions">
|
|
18
|
+
<a class="hero-action primary" href="<?js= homepage.installUrl || '#installation' ?>">Get Started</a>
|
|
19
|
+
<a class="hero-action" href="<?js= homepage.coreModuleUrl || 'module-rclnodejs.html' ?>">Browse Core API</a>
|
|
20
|
+
<a class="hero-action" href="<?js= homepage.typescriptUrl || '#using-rclnodejs-with-typescript' ?>">TypeScript Guide</a>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="hero-tags">
|
|
23
|
+
<span>ROS 2</span>
|
|
24
|
+
<span>Node.js</span>
|
|
25
|
+
<span>TypeScript</span>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="hero-panel">
|
|
30
|
+
<p class="hero-panel-title">Quick Start</p>
|
|
31
|
+
<pre class="prettyprint hero-snippet"><code>npm i rclnodejs</code></pre>
|
|
32
|
+
<ul class="hero-points">
|
|
33
|
+
<li>Works with sourced ROS 2 environments</li>
|
|
34
|
+
<li>Supports generated message and IDL workflows</li>
|
|
35
|
+
<li>Covers topics, services, actions, lifecycle, and time</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</section>
|
|
40
|
+
|
|
41
|
+
<section class="homepage-strip stats-strip">
|
|
42
|
+
<?js (homepage.stats || []).forEach(function(stat) { ?>
|
|
43
|
+
<article class="stats-card">
|
|
44
|
+
<strong><?js= stat.value ?></strong>
|
|
45
|
+
<span><?js= stat.label ?></span>
|
|
46
|
+
<p><?js= stat.detail ?></p>
|
|
47
|
+
</article>
|
|
48
|
+
<?js }); ?>
|
|
49
|
+
</section>
|
|
50
|
+
<?js } ?>
|
|
51
|
+
|
|
52
|
+
<?js if (data.kind === 'mainpage') { ?>
|
|
53
|
+
<section class="homepage-grid">
|
|
54
|
+
<article class="homepage-card homepage-card-wide">
|
|
55
|
+
<p class="section-kicker">Why rclnodejs</p>
|
|
56
|
+
<h3>Engineering ergonomics for robotics teams using JavaScript</h3>
|
|
57
|
+
<p>rclnodejs lets teams build ROS 2 software in Node.js without losing alignment with the broader ROS ecosystem. The API stays close to core ROS concepts while fitting JavaScript and TypeScript workflows.</p>
|
|
58
|
+
</article>
|
|
59
|
+
|
|
60
|
+
<article class="homepage-card">
|
|
61
|
+
<p class="section-kicker">Core API</p>
|
|
62
|
+
<h3><a href="<?js= homepage.coreModuleUrl || 'module-rclnodejs.html' ?>">Start with the runtime module</a></h3>
|
|
63
|
+
<p>Move from the package entry point into Node, Publisher, Subscription, Client, Service, and Action primitives.</p>
|
|
64
|
+
</article>
|
|
65
|
+
|
|
66
|
+
<article class="homepage-card">
|
|
67
|
+
<p class="section-kicker">Reference</p>
|
|
68
|
+
<h3><a href="<?js= homepage.globalUrl || 'global.html' ?>">Inspect globals and enums</a></h3>
|
|
69
|
+
<p>Policies, event types, clock kinds, return codes, and shared constants are collected in one place for fast lookup.</p>
|
|
70
|
+
</article>
|
|
71
|
+
</section>
|
|
72
|
+
|
|
73
|
+
<section class="homepage-guides">
|
|
74
|
+
<header class="doc-page-header compact-header">
|
|
75
|
+
<p class="section-kicker">Guides</p>
|
|
76
|
+
<h3>Get productive without leaving the entry page</h3>
|
|
77
|
+
<p>These short guides cover the main README workflows: setup, typed development, and interface generation.</p>
|
|
78
|
+
</header>
|
|
79
|
+
|
|
80
|
+
<div class="guide-grid">
|
|
81
|
+
<article class="guide-card" id="guide-installation">
|
|
82
|
+
<p class="section-kicker">Setup</p>
|
|
83
|
+
<h3>Installation and environment</h3>
|
|
84
|
+
<p>Install Node.js 16.13.0 or newer, install a compatible ROS 2 distribution, then source the ROS 2 setup file before using the package.</p>
|
|
85
|
+
<pre class="prettyprint"><code>source /opt/ros/<distro>/setup.bash
|
|
86
|
+
npm i rclnodejs</code></pre>
|
|
87
|
+
<ul class="guide-list">
|
|
88
|
+
<li>Use <code>npm i rclnodejs@x.y.z</code> when you need a specific package version.</li>
|
|
89
|
+
<li>Generate a local reference site at any time with <code>npm run docs</code>.</li>
|
|
90
|
+
<li>Start exploring the runtime surface in <a href="<?js= homepage.coreModuleUrl || 'module-rclnodejs.html' ?>">the core API module</a>.</li>
|
|
91
|
+
</ul>
|
|
92
|
+
</article>
|
|
93
|
+
|
|
94
|
+
<article class="guide-card" id="guide-typescript">
|
|
95
|
+
<p class="section-kicker">TypeScript</p>
|
|
96
|
+
<h3>Typed project setup</h3>
|
|
97
|
+
<p>rclnodejs ships declaration files in the <code>types/</code> folder so projects get editor assistance, generated message types, and compile-time checks.</p>
|
|
98
|
+
<pre class="prettyprint"><code>{
|
|
99
|
+
"compilerOptions": {
|
|
100
|
+
"module": "commonjs",
|
|
101
|
+
"moduleResolution": "node",
|
|
102
|
+
"target": "es6"
|
|
103
|
+
}
|
|
104
|
+
}</code></pre>
|
|
105
|
+
<ul class="guide-list">
|
|
106
|
+
<li>Use the generated declarations for message interfaces after running the message generator.</li>
|
|
107
|
+
<li>Follow the <a href="<?js= homepage.typescriptUrl || '#guide-typescript' ?>">TypeScript workflow</a> here before moving into application code.</li>
|
|
108
|
+
<li>Pair typed code with the class docs for Node, Publisher, Subscription, Service, and Action primitives.</li>
|
|
109
|
+
</ul>
|
|
110
|
+
</article>
|
|
111
|
+
|
|
112
|
+
<article class="guide-card" id="guide-message-generation">
|
|
113
|
+
<p class="section-kicker">Interfaces</p>
|
|
114
|
+
<h3>Message and IDL generation</h3>
|
|
115
|
+
<p>When your ROS installation changes or your project depends on additional message packages, regenerate the JavaScript and TypeScript bindings from the current environment.</p>
|
|
116
|
+
<pre class="prettyprint"><code>npx generate-ros-messages
|
|
117
|
+
npm run generate-messages-idl</code></pre>
|
|
118
|
+
<ul class="guide-list">
|
|
119
|
+
<li>Use <code>npx generate-ros-messages</code> for standard ROS interfaces available in the sourced environment.</li>
|
|
120
|
+
<li>Use <code>npm run generate-messages-idl</code> when you need IDL-driven generation.</li>
|
|
121
|
+
<li>Generated JavaScript files are written under your installed package's <code>generated/</code> directory.</li>
|
|
122
|
+
</ul>
|
|
123
|
+
</article>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div class="guide-grid guide-grid-secondary">
|
|
127
|
+
<article class="guide-card">
|
|
128
|
+
<p class="section-kicker">First Node</p>
|
|
129
|
+
<h3>Publish a message in a few lines</h3>
|
|
130
|
+
<p>The package stays close to ROS 2 concepts while keeping the Node.js workflow straightforward.</p>
|
|
131
|
+
<pre class="prettyprint"><code>const rclnodejs = require('rclnodejs');
|
|
132
|
+
rclnodejs.init().then(() => {
|
|
133
|
+
const node = new rclnodejs.Node('publisher_example_node');
|
|
134
|
+
const publisher = node.createPublisher('std_msgs/msg/String', 'topic');
|
|
135
|
+
publisher.publish('Hello ROS 2 from rclnodejs');
|
|
136
|
+
node.spin();
|
|
137
|
+
});</code></pre>
|
|
138
|
+
</article>
|
|
139
|
+
|
|
140
|
+
<article class="guide-card">
|
|
141
|
+
<p class="section-kicker">Further Reading</p>
|
|
142
|
+
<h3>Keep moving from overview to implementation</h3>
|
|
143
|
+
<ul class="guide-list guide-list-tight">
|
|
144
|
+
<li><a href="<?js= homepage.coreModuleUrl || 'module-rclnodejs.html' ?>">Core module reference</a></li>
|
|
145
|
+
<li><a href="<?js= homepage.globalUrl || 'global.html' ?>">Globals and enums</a></li>
|
|
146
|
+
<li><a href="module-validator.html">Validation helpers</a></li>
|
|
147
|
+
<li><a href="https://github.com/RobotWebTools/rclnodejs/tree/develop/example">Examples in the repository</a></li>
|
|
148
|
+
</ul>
|
|
149
|
+
</article>
|
|
150
|
+
</div>
|
|
151
|
+
</section>
|
|
152
|
+
|
|
153
|
+
<?js if (data.readme) { ?>
|
|
154
|
+
<section class="doc-section prose-section readme-section">
|
|
155
|
+
<header class="doc-page-header compact-header">
|
|
156
|
+
<p class="section-kicker">Manual</p>
|
|
157
|
+
<h3>Full project guide</h3>
|
|
158
|
+
<p>The complete README remains below for installation details, CLI workflows, TypeScript usage, and message-generation procedures.</p>
|
|
159
|
+
</header>
|
|
160
|
+
<article class="prose-card"><?js= data.readme ?></article>
|
|
161
|
+
</section>
|
|
162
|
+
<?js } ?>
|
|
163
|
+
<?js } ?>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = obj;
|
|
3
|
+
var self = this;
|
|
4
|
+
?>
|
|
5
|
+
<section class="symbol-card symbol-kind-<?js= kind ?>">
|
|
6
|
+
<div class="symbol-heading">
|
|
7
|
+
<span class="symbol-kind"><?js= kind ?></span>
|
|
8
|
+
<h4 class="name" id="<?js= id ?>"><?js= data.attribs + name + (data.signature ? data.signature : '') ?></h4>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<?js if (data.summary) { ?>
|
|
12
|
+
<p class="summary"><?js= summary ?></p>
|
|
13
|
+
<?js } ?>
|
|
14
|
+
|
|
15
|
+
<?js if (data.description) { ?>
|
|
16
|
+
<div class="description">
|
|
17
|
+
<?js= data.description ?>
|
|
18
|
+
</div>
|
|
19
|
+
<?js } ?>
|
|
20
|
+
|
|
21
|
+
<?js if (data.type && data.type.names) {?>
|
|
22
|
+
<h5>Type:</h5>
|
|
23
|
+
<ul>
|
|
24
|
+
<li>
|
|
25
|
+
<?js= self.partial('type.tmpl', data.type.names) ?>
|
|
26
|
+
</li>
|
|
27
|
+
</ul>
|
|
28
|
+
<?js } ?>
|
|
29
|
+
|
|
30
|
+
<?js= this.partial('details.tmpl', data) ?>
|
|
31
|
+
|
|
32
|
+
<?js if (data.fires && fires.length) { ?>
|
|
33
|
+
<h5>Fires:</h5>
|
|
34
|
+
<ul><?js fires.forEach(function(f) { ?>
|
|
35
|
+
<li><?js= self.linkto(f) ?></li>
|
|
36
|
+
<?js }); ?></ul>
|
|
37
|
+
<?js } ?>
|
|
38
|
+
|
|
39
|
+
<?js if (data.examples && examples.length) { ?>
|
|
40
|
+
<h5>Example<?js= examples.length > 1? 's':'' ?></h5>
|
|
41
|
+
<?js= this.partial('examples.tmpl', examples) ?>
|
|
42
|
+
<?js } ?>
|
|
43
|
+
</section>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = obj;
|
|
3
|
+
var self = this;
|
|
4
|
+
?>
|
|
5
|
+
<section class="symbol-card symbol-kind-<?js= kind ?>">
|
|
6
|
+
<?js if (data.kind !== 'module' && !data.hideconstructor) { ?>
|
|
7
|
+
<?js if (data.kind === 'class' && data.classdesc) { ?>
|
|
8
|
+
<p class="section-kicker">Constructor</p>
|
|
9
|
+
<?js } ?>
|
|
10
|
+
|
|
11
|
+
<?js if (data.kind !== 'namespace') { ?>
|
|
12
|
+
<div class="symbol-heading">
|
|
13
|
+
<span class="symbol-kind"><?js= kind ?></span>
|
|
14
|
+
<h4 class="name" id="<?js= id ?>"><?js= data.attribs + (kind === 'class' ? 'new ' : '') +
|
|
15
|
+
name + (data.signature || '') ?></h4>
|
|
16
|
+
</div>
|
|
17
|
+
<?js } ?>
|
|
18
|
+
|
|
19
|
+
<?js if (data.summary) { ?>
|
|
20
|
+
<p class="summary"><?js= summary ?></p>
|
|
21
|
+
<?js } ?>
|
|
22
|
+
<?js } ?>
|
|
23
|
+
|
|
24
|
+
<?js if (data.kind !== 'module' && data.description && !data.hideconstructor) { ?>
|
|
25
|
+
<div class="description">
|
|
26
|
+
<?js= data.description ?>
|
|
27
|
+
</div>
|
|
28
|
+
<?js } ?>
|
|
29
|
+
|
|
30
|
+
<?js if (data.augments && data.alias && data.alias.indexOf('module:') === 0) { ?>
|
|
31
|
+
<h5>Extends:</h5>
|
|
32
|
+
<?js= self.partial('augments.tmpl', data) ?>
|
|
33
|
+
<?js } ?>
|
|
34
|
+
|
|
35
|
+
<?js if (kind === 'event' && data.type && data.type.names) {?>
|
|
36
|
+
<h5>Type:</h5>
|
|
37
|
+
<ul>
|
|
38
|
+
<li>
|
|
39
|
+
<?js= self.partial('type.tmpl', data.type.names) ?>
|
|
40
|
+
</li>
|
|
41
|
+
</ul>
|
|
42
|
+
<?js } ?>
|
|
43
|
+
|
|
44
|
+
<?js if (data['this']) { ?>
|
|
45
|
+
<h5>This:</h5>
|
|
46
|
+
<ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
|
|
47
|
+
<?js } ?>
|
|
48
|
+
|
|
49
|
+
<?js if (data.params && params.length && !data.hideconstructor) { ?>
|
|
50
|
+
<h5>Parameters:</h5>
|
|
51
|
+
<?js= this.partial('params.tmpl', params) ?>
|
|
52
|
+
<?js } ?>
|
|
53
|
+
|
|
54
|
+
<?js= this.partial('details.tmpl', data) ?>
|
|
55
|
+
|
|
56
|
+
<?js if (data.kind !== 'module' && data.requires && data.requires.length) { ?>
|
|
57
|
+
<h5>Requires:</h5>
|
|
58
|
+
<ul><?js data.requires.forEach(function(r) { ?>
|
|
59
|
+
<li><?js= self.linkto(r) ?></li>
|
|
60
|
+
<?js }); ?></ul>
|
|
61
|
+
<?js } ?>
|
|
62
|
+
|
|
63
|
+
<?js if (data.fires && fires.length) { ?>
|
|
64
|
+
<h5>Fires:</h5>
|
|
65
|
+
<ul><?js fires.forEach(function(f) { ?>
|
|
66
|
+
<li><?js= self.linkto(f) ?></li>
|
|
67
|
+
<?js }); ?></ul>
|
|
68
|
+
<?js } ?>
|
|
69
|
+
|
|
70
|
+
<?js if (data.listens && listens.length) { ?>
|
|
71
|
+
<h5>Listens to Events:</h5>
|
|
72
|
+
<ul><?js listens.forEach(function(f) { ?>
|
|
73
|
+
<li><?js= self.linkto(f) ?></li>
|
|
74
|
+
<?js }); ?></ul>
|
|
75
|
+
<?js } ?>
|
|
76
|
+
|
|
77
|
+
<?js if (data.listeners && listeners.length) { ?>
|
|
78
|
+
<h5>Listeners of This Event:</h5>
|
|
79
|
+
<ul><?js listeners.forEach(function(f) { ?>
|
|
80
|
+
<li><?js= self.linkto(f) ?></li>
|
|
81
|
+
<?js }); ?></ul>
|
|
82
|
+
<?js } ?>
|
|
83
|
+
|
|
84
|
+
<?js if (data.exceptions && exceptions.length) { ?>
|
|
85
|
+
<h5>Throws:</h5>
|
|
86
|
+
<?js if (exceptions.length > 1) { ?><ul><?js
|
|
87
|
+
exceptions.forEach(function(r) { ?>
|
|
88
|
+
<li><?js= self.partial('exceptions.tmpl', r) ?></li>
|
|
89
|
+
<?js });
|
|
90
|
+
?></ul><?js } else {
|
|
91
|
+
exceptions.forEach(function(r) { ?>
|
|
92
|
+
<?js= self.partial('exceptions.tmpl', r) ?>
|
|
93
|
+
<?js });
|
|
94
|
+
} } ?>
|
|
95
|
+
|
|
96
|
+
<?js if (data.returns && returns.length) { ?>
|
|
97
|
+
<h5>Returns:</h5>
|
|
98
|
+
<?js if (returns.length > 1) { ?><ul><?js
|
|
99
|
+
returns.forEach(function(r) { ?>
|
|
100
|
+
<li><?js= self.partial('returns.tmpl', r) ?></li>
|
|
101
|
+
<?js });
|
|
102
|
+
?></ul><?js } else {
|
|
103
|
+
returns.forEach(function(r) { ?>
|
|
104
|
+
<?js= self.partial('returns.tmpl', r) ?>
|
|
105
|
+
<?js });
|
|
106
|
+
} } ?>
|
|
107
|
+
|
|
108
|
+
<?js if (data.yields && yields.length) { ?>
|
|
109
|
+
<h5>Yields:</h5>
|
|
110
|
+
<?js if (yields.length > 1) { ?><ul><?js
|
|
111
|
+
yields.forEach(function(r) { ?>
|
|
112
|
+
<li><?js= self.partial('returns.tmpl', r) ?></li>
|
|
113
|
+
<?js });
|
|
114
|
+
?></ul><?js } else {
|
|
115
|
+
yields.forEach(function(r) { ?>
|
|
116
|
+
<?js= self.partial('returns.tmpl', r) ?>
|
|
117
|
+
<?js });
|
|
118
|
+
} } ?>
|
|
119
|
+
|
|
120
|
+
<?js if (data.examples && examples.length) { ?>
|
|
121
|
+
<h5>Example<?js= examples.length > 1? 's':'' ?></h5>
|
|
122
|
+
<?js= this.partial('examples.tmpl', examples) ?>
|
|
123
|
+
<?js } ?>
|
|
124
|
+
</section>
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
var paramRegExp;
|
|
8
|
+
|
|
9
|
+
if (!param) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (parentParam && parentParam.name && param.name) {
|
|
14
|
+
try {
|
|
15
|
+
paramRegExp = new RegExp('^(?:' + parentParam.name + '(?:\\[\\])*)\\.(.+)$');
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
// there's probably a typo in the JSDoc comment that resulted in a weird
|
|
19
|
+
// parameter name
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if ( paramRegExp.test(param.name) ) {
|
|
24
|
+
param.name = RegExp.$1;
|
|
25
|
+
parentParam.subparams = parentParam.subparams || [];
|
|
26
|
+
parentParam.subparams.push(param);
|
|
27
|
+
params[i] = null;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
parentParam = param;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
parentParam = param;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/* determine if we need extra columns, "attributes" and "default" */
|
|
39
|
+
params.hasAttributes = false;
|
|
40
|
+
params.hasDefault = false;
|
|
41
|
+
params.hasName = false;
|
|
42
|
+
|
|
43
|
+
params.forEach(function(param) {
|
|
44
|
+
if (!param) { return; }
|
|
45
|
+
|
|
46
|
+
if (param.optional || param.nullable || param.variable) {
|
|
47
|
+
params.hasAttributes = true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (param.name) {
|
|
51
|
+
params.hasName = true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (typeof param.defaultvalue !== 'undefined') {
|
|
55
|
+
params.hasDefault = true;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
?>
|
|
59
|
+
|
|
60
|
+
<div class="table-wrap">
|
|
61
|
+
<table class="params">
|
|
62
|
+
<thead>
|
|
63
|
+
<tr>
|
|
64
|
+
<?js if (params.hasName) {?>
|
|
65
|
+
<th>Name</th>
|
|
66
|
+
<?js } ?>
|
|
67
|
+
|
|
68
|
+
<th>Type</th>
|
|
69
|
+
|
|
70
|
+
<?js if (params.hasAttributes) {?>
|
|
71
|
+
<th>Attributes</th>
|
|
72
|
+
<?js } ?>
|
|
73
|
+
|
|
74
|
+
<?js if (params.hasDefault) {?>
|
|
75
|
+
<th>Default</th>
|
|
76
|
+
<?js } ?>
|
|
77
|
+
|
|
78
|
+
<th class="last">Description</th>
|
|
79
|
+
</tr>
|
|
80
|
+
</thead>
|
|
81
|
+
|
|
82
|
+
<tbody>
|
|
83
|
+
<?js
|
|
84
|
+
var self = this;
|
|
85
|
+
params.forEach(function(param) {
|
|
86
|
+
if (!param) { return; }
|
|
87
|
+
?>
|
|
88
|
+
|
|
89
|
+
<tr>
|
|
90
|
+
<?js if (params.hasName) {?>
|
|
91
|
+
<td class="name"><code><?js= param.name ?></code></td>
|
|
92
|
+
<?js } ?>
|
|
93
|
+
|
|
94
|
+
<td class="type">
|
|
95
|
+
<?js if (param.type && param.type.names) {?>
|
|
96
|
+
<?js= self.partial('type.tmpl', param.type.names) ?>
|
|
97
|
+
<?js } ?>
|
|
98
|
+
</td>
|
|
99
|
+
|
|
100
|
+
<?js if (params.hasAttributes) {?>
|
|
101
|
+
<td class="attributes">
|
|
102
|
+
<?js if (param.optional) { ?>
|
|
103
|
+
<optional><br>
|
|
104
|
+
<?js } ?>
|
|
105
|
+
|
|
106
|
+
<?js if (param.nullable) { ?>
|
|
107
|
+
<nullable><br>
|
|
108
|
+
<?js } ?>
|
|
109
|
+
|
|
110
|
+
<?js if (param.variable) { ?>
|
|
111
|
+
<repeatable><br>
|
|
112
|
+
<?js } ?>
|
|
113
|
+
</td>
|
|
114
|
+
<?js } ?>
|
|
115
|
+
|
|
116
|
+
<?js if (params.hasDefault) {?>
|
|
117
|
+
<td class="default">
|
|
118
|
+
<?js if (typeof param.defaultvalue !== 'undefined') { ?>
|
|
119
|
+
<?js= self.htmlsafe(param.defaultvalue) ?>
|
|
120
|
+
<?js } ?>
|
|
121
|
+
</td>
|
|
122
|
+
<?js } ?>
|
|
123
|
+
|
|
124
|
+
<td class="description last"><?js= param.description ?><?js if (param.subparams) { ?>
|
|
125
|
+
<h6>Properties</h6>
|
|
126
|
+
<?js= self.partial('params.tmpl', param.subparams) ?>
|
|
127
|
+
<?js } ?></td>
|
|
128
|
+
</tr>
|
|
129
|
+
|
|
130
|
+
<?js }); ?>
|
|
131
|
+
</tbody>
|
|
132
|
+
</table>
|
|
133
|
+
</div>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = obj;
|
|
3
|
+
var props = data.subprops || data.properties;
|
|
4
|
+
|
|
5
|
+
/* sort subprops under their parent props (like opts.classname) */
|
|
6
|
+
var parentProp = null;
|
|
7
|
+
props.forEach(function(prop, i) {
|
|
8
|
+
if (!prop) { return; }
|
|
9
|
+
if ( parentProp && prop.name && prop.name.indexOf(parentProp.name + '.') === 0 ) {
|
|
10
|
+
prop.name = prop.name.substr(parentProp.name.length+1);
|
|
11
|
+
parentProp.subprops = parentProp.subprops || [];
|
|
12
|
+
parentProp.subprops.push(prop);
|
|
13
|
+
props[i] = null;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
parentProp = prop;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/* determine if we need extra columns, "attributes" and "default" */
|
|
21
|
+
props.hasAttributes = false;
|
|
22
|
+
props.hasDefault = false;
|
|
23
|
+
props.hasName = false;
|
|
24
|
+
|
|
25
|
+
props.forEach(function(prop) {
|
|
26
|
+
if (!prop) { return; }
|
|
27
|
+
|
|
28
|
+
if (prop.optional || prop.nullable) {
|
|
29
|
+
props.hasAttributes = true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (prop.name) {
|
|
33
|
+
props.hasName = true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (typeof prop.defaultvalue !== 'undefined' && !data.isEnum) {
|
|
37
|
+
props.hasDefault = true;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
?>
|
|
41
|
+
|
|
42
|
+
<div class="table-wrap">
|
|
43
|
+
<table class="props">
|
|
44
|
+
<thead>
|
|
45
|
+
<tr>
|
|
46
|
+
<?js if (props.hasName) {?>
|
|
47
|
+
<th>Name</th>
|
|
48
|
+
<?js } ?>
|
|
49
|
+
|
|
50
|
+
<th>Type</th>
|
|
51
|
+
|
|
52
|
+
<?js if (props.hasAttributes) {?>
|
|
53
|
+
<th>Attributes</th>
|
|
54
|
+
<?js } ?>
|
|
55
|
+
|
|
56
|
+
<?js if (props.hasDefault) {?>
|
|
57
|
+
<th>Default</th>
|
|
58
|
+
<?js } ?>
|
|
59
|
+
|
|
60
|
+
<th class="last">Description</th>
|
|
61
|
+
</tr>
|
|
62
|
+
</thead>
|
|
63
|
+
|
|
64
|
+
<tbody>
|
|
65
|
+
<?js
|
|
66
|
+
var self = this;
|
|
67
|
+
props.forEach(function(prop) {
|
|
68
|
+
if (!prop) { return; }
|
|
69
|
+
?>
|
|
70
|
+
|
|
71
|
+
<tr>
|
|
72
|
+
<?js if (props.hasName) {?>
|
|
73
|
+
<td class="name"><code><?js= prop.name ?></code></td>
|
|
74
|
+
<?js } ?>
|
|
75
|
+
|
|
76
|
+
<td class="type">
|
|
77
|
+
<?js if (prop.type && prop.type.names) {?>
|
|
78
|
+
<?js= self.partial('type.tmpl', prop.type.names) ?>
|
|
79
|
+
<?js } ?>
|
|
80
|
+
</td>
|
|
81
|
+
|
|
82
|
+
<?js if (props.hasAttributes) {?>
|
|
83
|
+
<td class="attributes">
|
|
84
|
+
<?js if (prop.optional) { ?>
|
|
85
|
+
<optional><br>
|
|
86
|
+
<?js } ?>
|
|
87
|
+
|
|
88
|
+
<?js if (prop.nullable) { ?>
|
|
89
|
+
<nullable><br>
|
|
90
|
+
<?js } ?>
|
|
91
|
+
</td>
|
|
92
|
+
<?js } ?>
|
|
93
|
+
|
|
94
|
+
<?js if (props.hasDefault) {?>
|
|
95
|
+
<td class="default">
|
|
96
|
+
<?js if (typeof prop.defaultvalue !== 'undefined') { ?>
|
|
97
|
+
<?js= self.htmlsafe(prop.defaultvalue) ?>
|
|
98
|
+
<?js } ?>
|
|
99
|
+
</td>
|
|
100
|
+
<?js } ?>
|
|
101
|
+
|
|
102
|
+
<td class="description last"><?js= prop.description ?><?js if (prop.subprops) { ?>
|
|
103
|
+
<h6>Properties</h6><?js= self.partial('properties.tmpl', prop) ?>
|
|
104
|
+
<?js } ?></td>
|
|
105
|
+
</tr>
|
|
106
|
+
|
|
107
|
+
<?js }); ?>
|
|
108
|
+
</tbody>
|
|
109
|
+
</table>
|
|
110
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = obj || {};
|
|
3
|
+
if (data.description) {
|
|
4
|
+
?>
|
|
5
|
+
<div class="param-desc">
|
|
6
|
+
<?js= description ?>
|
|
7
|
+
</div>
|
|
8
|
+
<?js } ?>
|
|
9
|
+
|
|
10
|
+
<?js if (data.type && data.type.names) {?>
|
|
11
|
+
<div class="returns-type"><span>Type</span> <?js= this.partial('type.tmpl', data.type.names) ?></div>
|
|
12
|
+
<?js } ?>
|