Fix JSDoc issues

Fix missing documentation for parameters and return types, incorect
config and errors in type definitions.
This commit is contained in:
Hornwitser committed 2020-06-17 20:53:18 +02:00
1 parent 3dba92a03d
commit 703fda43ad
20 files changed
+193 -52

No files matched your search

+7 -3
View File
@@ -106,8 +106,11 @@ async function loadFile(server, modVersions, modPath) {
*
* @param {module:lib/factorio.FactorioServer} server -
* The server to generate the export mod for.
* @param {Map<string, string>} modVersions -
* Mapping of mod name to versions to get icons from.
* @param {Array<Object>} items - Array of item prototypes.
* @return {itemSheet: Jimp, itemData: Map<string, Object>} Item spritesheet and metadata.
* @return {{itemSheet: Jimp, itemData: Map<string,Object>}}
* Item spritesheet and metadata.
* @memberof module:lib/factorio
* @private
* @inner
@@ -259,9 +262,10 @@ async function exportItems(server, modVersions, items) {
*
* @param {module:lib/factorio.FactorioServer} server -
* The server to export the locale from.
* @param modVersions {Map<string, string>} modVersions -
* @param {Map<string, string>} modVersions -
* Mapping of mod name to version to export locale from.
* @param modOrder {Array<string>} modOrder - Load order of the mods.
* @param {Array<string>} modOrder - Load order of the mods.
* @param {string} languageCode - Language to export locale for.
* @returns {Map<string, string>} merged locale information
* @memberof module:lib/factorio
* @private
+2
View File
@@ -27,6 +27,7 @@ const knownScenarios = {
* Returns the name of the folder that all files in the zip file is
* contained in. Throws an error if there are multiple such folders.
*
* @param {module:jszip.JSZip} zip - Zip to search through.
* @returns {string} name of the root folder.
* @memberof module:lib/factorio
* @private
@@ -60,6 +61,7 @@ function findRoot(zip) {
* Generates control.lua code for loading the Clusterio modules
*
* @param {Object} patchInfo - The patch info files's json content
* @returns {string} Generated control.lua code.
* @memberof module:lib/factorio
* @private
* @inner
+15
View File
@@ -16,6 +16,7 @@ const errors = require("lib/errors");
* Determines the version of Factorio the datadir is pointing to by
* reading the changelog.txt in it.
*
* @param {string} changelogPath - Path to changelog.txt.
* @memberof module:lib/factorio
* @private
* @inner
@@ -47,6 +48,9 @@ async function getVersion(changelogPath) {
/**
* Comparison function for sorting Factorio version strings
*
* @param {string} a - Version to compare.
* @param {string} b - Version to compare.
* @returns {number} 1 if a < b, 0 if a = b and -1 if a > b.
* @memberof module:lib/factorio
* @private
* @inner
@@ -74,6 +78,11 @@ function versionOrder(a, b) {
* Searches the given factorio dir for an installation of Factorio of
* the target version.
*
* @param {string} factorioDir - Path to Factorio installation dir(s).
* @param {string} targetVersion -
* Version to look for, supports the special value "latest" for the
* latest version available.
* @returns {Array} Array with path to data dir and version found.
* @memberof module:lib/factorio
* @private
* @inner
@@ -1001,6 +1010,9 @@ class FactorioServer extends events.EventEmitter {
* Creates a path using path.join with the given parts that's relative to
* the data directory of the Factorio server. Not valid before init has
* been called.
*
* @param {...string} parts - Extra parts to add to the data path.
* @returns {string} Data directory path.
*/
dataPath(...parts) {
return path.join(this._dataDir, ...parts);
@@ -1011,6 +1023,9 @@ class FactorioServer extends events.EventEmitter {
*
* Creates a path using path.join with the given parts that's relative to
* the write directory of the Factorio server.
*
* @param {...string} parts - Extra parts to add to the write path.
* @returns {string} Write directory path.
*/
writePath(...parts) {
return path.join(this._writeDir, ...parts);