diff --git a/renderer/src/modules/api/addonapi.js b/renderer/src/modules/api/addonapi.js index 295551ab..756ab6d5 100644 --- a/renderer/src/modules/api/addonapi.js +++ b/renderer/src/modules/api/addonapi.js @@ -14,39 +14,39 @@ get folder() {return this.#manager.addonFolder;} /** - * Determines if a particular adon is enabled. - * @param {string} idOrFile Addon id or filename. + * Determines if a particular addon is enabled. + * @param {string} idOrFile Addon ID or filename * @returns {boolean} */ isEnabled(idOrFile) {return this.#manager.isEnabled(idOrFile);} /** * Enables the given addon. - * @param {string} idOrFile Addon id or filename. + * @param {string} idOrFile Addon ID or filename */ enable(idOrAddon) {return this.#manager.enableAddon(idOrAddon);} /** * Disables the given addon. - * @param {string} idOrFile Addon id or filename. + * @param {string} idOrFile Addon ID or filename */ disable(idOrAddon) {return this.#manager.disableAddon(idOrAddon);} /** * Toggles if a particular addon is enabled. - * @param {string} idOrFile Addon id or filename. + * @param {string} idOrFile Addon ID or filename */ toggle(idOrAddon) {return this.#manager.toggleAddon(idOrAddon);} /** * Reloads if a particular addon is enabled. - * @param {string} idOrFile Addon id or filename. + * @param {string} idOrFile Addon ID or filename */ reload(idOrFileOrAddon) {return this.#manager.reloadAddon(idOrFileOrAddon);} /** * Gets a particular addon. - * @param {string} idOrFile Addon id or filename. + * @param {string} idOrFile Addon ID or filename * @returns {object} Addon instance */ get(idOrFile) {return this.#manager.getAddon(idOrFile);} diff --git a/renderer/src/modules/api/contextmenu.js b/renderer/src/modules/api/contextmenu.js index 76859d55..33a9c288 100644 --- a/renderer/src/modules/api/contextmenu.js +++ b/renderer/src/modules/api/contextmenu.js @@ -153,9 +153,9 @@ class ContextMenu { /** * Allows you to patch a given context menu. Acts as a wrapper around the `Patcher`. * - * @param {string} navId Discord's internal navId used to identify context menus - * @param {function} callback callback function that accepts the react render tree - * @returns {function} a function that automatically unpatches + * @param {string} navId Discord's internal `navId` used to identify context menus + * @param {function} callback Callback function that accepts the React render tree + * @returns {function} A function that automatically unpatches */ patch(navId, callback) { MenuPatcher.patch(navId, callback); @@ -166,8 +166,8 @@ class ContextMenu { /** * Allows you to remove the patch added to a given context menu. * - * @param {string} navId the original navId from patching - * @param {function} callback the original callback from patching + * @param {string} navId The original `navId` from patching + * @param {function} callback The original callback from patching */ unpatch(navId, callback) { MenuPatcher.unpatch(navId, callback); @@ -178,9 +178,9 @@ class ContextMenu { * match the actual component being built. View those to see what options exist * for each, they often have less in common than you might think. * - * @param {object} props - props used to build the item - * @param {string} [props.type="text"] - type of the item, options: text, submenu, toggle, radio, custom, separator - * @returns {object} the created component + * @param {object} props Props used to build the item + * @param {string} [props.type="text"] Type of the item, options: text, submenu, toggle, radio, custom, separator + * @returns {object} The created component * * @example * // Creates a single menu item that prints "MENU ITEM" on click @@ -237,8 +237,9 @@ class ContextMenu { * Creates the all the items **and groups** of a context menu recursively. * There is no hard limit to the number of groups within groups or number * of items in a menu. - * @param {Array} setup - array of item props used to build items. See {@link ContextMenu.buildItem} - * @returns {Array} array of the created component + * + * @param {Array} setup Array of item props used to build items. See {@link ContextMenu.buildItem}. + * @returns {Array} Array of the created component * * @example * // Creates a single item group item with a toggle item @@ -292,8 +293,9 @@ class ContextMenu { * Creates the menu *component* including the wrapping `ContextMenu`. * Calls {@link ContextMenu.buildMenuChildren} under the covers. * Used to call in combination with {@link ContextMenu.open}. - * @param {Array} setup - array of item props used to build items. See {@link ContextMenu.buildMenuChildren} - * @returns {function} the unique context menu component + * + * @param {Array} setup Array of item props used to build items. See {@link ContextMenu.buildMenuChildren}. + * @returns {function} The unique context menu component */ buildMenu(setup) { return (props) => {return React.createElement(MenuComponents.Menu, props, this.buildMenuChildren(setup));}; @@ -302,13 +304,12 @@ class ContextMenu { /** * Function that allows you to open an entire context menu. Recommended to build the menu with this module. * - * @param {MouseEvent} event - The context menu event. This can be emulated, requires target, and all X, Y locations. - * @param {function} menuComponent - Component to render. This can be any react component or output of {@link ContextMenu.buildMenu} - * @param {object} config - configuration/props for the context menu - * @param {string} [config.position="right"] - default position for the menu, options: "left", "right" - * @param {string} [config.align="top"] - default alignment for the menu, options: "bottom", "top" - * @param {function} [config.onClose] - function to run when the menu is closed - * @param {boolean} [config.noBlurEvent=false] - No clue + * @param {MouseEvent} event The context menu event. This can be emulated, requires target, and all X, Y locations. + * @param {function} menuComponent Component to render. This can be any React component or output of {@link ContextMenu.buildMenu}. + * @param {object} config Configuration/props for the context menu + * @param {string} [config.position="right"] Default position for the menu, options: "left", "right" + * @param {string} [config.align="top"] Default alignment for the menu, options: "bottom", "top" + * @param {function} [config.onClose] Function to run when the menu is closed */ open(event, menuComponent, config) { return ContextMenuActions.openContextMenu(event, function(e) { diff --git a/renderer/src/modules/api/data.js b/renderer/src/modules/api/data.js index 1a048d20..7bed623e 100644 --- a/renderer/src/modules/api/data.js +++ b/renderer/src/modules/api/data.js @@ -47,10 +47,10 @@ class Data { } /** - * Deletes a piece of stored data, this is different than saving as null or undefined. + * Deletes a piece of stored data. This is different than saving `null` or `undefined`. * * @param {string} pluginName Name of the plugin deleting data - * @param {string} key Which piece of data to delete + * @param {string} key Which piece of data to delete. */ delete(pluginName, key) { if (this.#callerName) { diff --git a/renderer/src/modules/api/dom.js b/renderer/src/modules/api/dom.js index e7114740..e08cdefa 100644 --- a/renderer/src/modules/api/dom.js +++ b/renderer/src/modules/api/dom.js @@ -49,7 +49,7 @@ class DOM { /** * Removes a `