Fix documentation

Fix missing module declarations, broken lings, broken formating and
incorrect scopes in the documentation.  For modules split over several
files it appears the only viable option is to use the memberof directive
on each documented member and only declare the index file as a module.
This commit is contained in:
Hornwitser committed 2020-05-08 17:28:06 +02:00
1 parent 7a9b6592e6
commit b151dd8469
22 files changed
+318 -56

No files matched your search

+21 -6
View File
@@ -1,7 +1,4 @@
/**
* @file Configuration classes
* @author Hornwitser
*/
// Configuration classes
"use strict";
const { basicType } = require("lib/helpers");
@@ -12,6 +9,9 @@ const { basicType } = require("lib/helpers");
*
* Exception class for when invalid values are attempted to be set on a
* field.
*
* @extends Error
* @memberof module:lib/config
*/
class InvalidValue extends Error { };
@@ -20,18 +20,26 @@ class InvalidValue extends Error { };
*
* Exception class for when a group or field that does not exist is
* attempted to be accessed.
*
* @extends Error
* @memberof module:lib/config
*/
class InvalidField extends Error { };
/**
* Split the given string on the first instance of separator
*
* Splits @p string on the first instance of @p separator and returns an
* Splits `string` on the first instance of `separator` and returns an
* array consisting of the string up to the separator and the string
* after the separator. Returns an array with the string and an empty
* string if the separator is not present.
*
* @param {string} separator - Separator to split string by.
* @param {string} string - String to split
* @returns {Array} string split on separator.
* @memberof module:lib/config
* @private
* @inner
*/
function splitOn(separator, string) {
let index = string.indexOf(separator);
@@ -46,6 +54,8 @@ function splitOn(separator, string) {
*
* Represents a collection of ConfigGroup instances that can be
* managed as one.
*
* @memberof module:lib/config
*/
class Config {
constructor() {
@@ -215,6 +225,8 @@ class Config {
/**
* Collection of related config entries
*
* @memberof module:lib/config
*/
class ConfigGroup {
/**
@@ -285,7 +297,7 @@ class ConfigGroup {
* The field must be defined for the config group and the value is
* type checked against the field definition.
*
* @throws {InvalidValue} if value is not allowed for the field.
* @throws {module:lib/config.InvalidValue} if value is not allowed for the field.
*/
set(name, value) {
let def = this.constructor._definitions.get(name);
@@ -553,6 +565,9 @@ class ConfigGroup {
* Grouping that includes per plugin fields clusterio uses to manage
* plugins. This is currently only the enabled field. It is otherwise
* identical to the ConfigGroup class.
*
* @extends module:lib/config.ConfigGroup
* @memberof module:lib/config
*/
class PluginConfigGroup extends ConfigGroup {
static _initSubclass() {