History

ScriptDiscoveryService API JSDoc

David Rowe committed 7 years ago

Commit e1e74a21 parent ccfd3e22 files · +143 −45Browse files

Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngines.cpp+28−0
@@ -209,6 +209,18 @@ void ScriptEngines::shutdownScripting() { · 208 unmodified lines
209209 qCDebug(scriptengine) << "DONE Stopping all scripts....";
210210 }
211211
212+/**jsdoc
213+ * Information on a public script, i.e., a script that's included in the Interface installation.
214+ * @typedef {object} ScriptDiscoveryService.PublicScript
215+ * @property {string} name - The script's file name.
216+ * @property {string} type - <code>"script"</code> or <code>"folder"</code>.
217+ * <p class="important">Deprecated: This property is deprecated and will be removed. It currently always has the value,
218+ * <code>"script"</code>.</p>
219+ * @property {ScriptDiscoveryService.PublicScript[]} [children] - Only present if <code>type</code> is <code>"folder"</code>.
220+ * <p class="important">Deprecated: This property is deprecated and will be removed. It currently is never present.
221+ * @property {string} [url] - The full URL of the script &mdash; including the <code>"file:///"</code> scheme at the start.
222+ * <p>Only present if <code>type</code> is <code>"script"</code>.</p>
223+ */
212224 QVariantList getPublicChildNodes(TreeNodeFolder* parent) {
213225 QVariantList result;
214226 QList<TreeNodeBase*> treeNodes = getScriptsModel().getFolderNodes(parent);
@@ -240,6 +252,13 @@ QVariantList ScriptEngines::getPublic() { · 25 unmodified lines
240252 return getPublicChildNodes(NULL);
241253 }
242254
255+/**jsdoc
256+ * Information on a local script.
257+ * @typedef {object} ScriptDiscoveryService.LocalScript
258+ * @property {string} name - The script's file name.
259+ * @property {string} path - The script's path.
260+ * @deprecated This type is deprecated and will be removed.
261+ */
243262 QVariantList ScriptEngines::getLocal() {
244263 QVariantList result;
245264 QList<TreeNodeBase*> treeNodes = getScriptsModel().getFolderNodes(NULL);
@@ -260,6 +279,15 @@ QVariantList ScriptEngines::getLocal() { · 14 unmodified lines
260279 return result;
261280 }
262281
282+/**jsdoc
283+ * Information on a running script.
284+ * @typedef {object} ScriptDiscoveryService.RunningScript
285+ * @property {boolean} local - <code>true</code> if the script is a local file (i.e., the scheme is "file"), <code>false</code>
286+ * if it isn't (e.g., the scheme is "http").
287+ * @property {string} name - The script's file name.
288+ * @property {string} path - The script's path and file name &mdash; excluding the scheme if a local file.
289+ * @property {string} url - The full URL of the script &mdash; including the scheme if a local file.
290+ */
263291 QVariantList ScriptEngines::getRunning() {
264292 QVariantList result;
265293 auto runningScripts = getRunningScripts();