Skip to content

Commit

Permalink
minor jsdocs changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksydan committed Sep 26, 2023
1 parent 2e081ac commit e806515
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions _dev/js/theme/components/http/useHttpController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import getUniqueId from '@js/theme/utils/getUniqueId';
import getUniqueId from '../../utils/getUniqueId';

/**
* @module useHttpController
Expand All @@ -10,7 +10,7 @@ const useHttpController = () => {
/**
* @method
* Adds request to request stack
* @param {int} id - unique id of request
* @param {number} id - unique id of request
* @param {Promise} request - request promise
* @param {AbortController} controller - AbortController object
*/
Expand All @@ -24,7 +24,7 @@ const useHttpController = () => {
/**
* @method
* Removes request from request stack
* @param {int} id - unique id of request
* @param {number} id - unique id of request
*/
const removeRequestFromRequestStack = (id) => {
const { [id]: erasedId, ...newRequestStack } = requestsStack;
Expand Down
10 changes: 5 additions & 5 deletions _dev/js/theme/components/useCustomQuantityInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* @param {string} configuration.spinnerInputClass - class of the input element (default: js-custom-qty-spinner-input)
* @param {string} configuration.spinnerBtnClassUp - class of the up button (default: js-custom-qty-btn-up)
* @param {string} configuration.spinnerBtnClassDown - class of the down button (default: js-custom-qty-btn-down)
* @param {int} configuration.defaultMinQty - default minimum quantity (default: 1)
* @param {int} configuration.defaultMaxQty - default maximum quantity (default: 1000000)
* @param {int} configuration.timeout - timeout in ms to wait before dispatching change event (default: 500)
* @param {number} configuration.defaultMinQty - default minimum quantity (default: 1)
* @param {number} configuration.defaultMaxQty - default maximum quantity (default: 1000000)
* @param {number} configuration.timeout - timeout in ms to wait before dispatching change event (default: 500)
* @param {function} configuration.onQuantityChange - callback function to call when quantity changes
*/
const useCustomQuantityInput = (spinnerElement, {
Expand Down Expand Up @@ -138,7 +138,7 @@ const useCustomQuantityInput = (spinnerElement, {
* Get quantity difference
* @method getQtyDifference
* @private
* @returns {int}
* @returns {number}
*/
const getQtyDifference = () => Math.abs(currentQty - startValue);

Expand Down Expand Up @@ -169,7 +169,7 @@ const useCustomQuantityInput = (spinnerElement, {

/**
* Set quantity
* @param {int} qty - quantity to set
* @param {number} qty - quantity to set
* @method setQty
* @private
* @returns {void}
Expand Down
4 changes: 2 additions & 2 deletions _dev/js/theme/core/address/request/updateAddressRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const { dispatch, abortAll } = useHttpController();
* Update listing facets request
* @param url {string} - new url with from-xhr param
* @param payload {object} - payload for request
* @param payload.id_country {int} - country id
* @param payload.id_address {int} - address id
* @param payload.id_country {number} - country id
* @param payload.id_address {number} - address id
* @example
* const url = 'address-form.com/url'; // url to update address form
* const payload = {
Expand Down
2 changes: 1 addition & 1 deletion _dev/js/theme/core/cart/handler/cart/addToCartHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { danger } = useAlertToast();

/**
* Handle add to cart event on form submit
* @param event {object} - submit event
* @param event {Event} - submit event
* @returns {Promise<void>}
*/
const addToCartHandler = async (event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { danger } = useAlertToast();

/**
* Delete product from cart handler
* @param event
* @param event {Event} - event object
* @returns {Promise<void>}
*/
const deleteFromCartHandler = async (event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { danger } = useAlertToast();

/**
* @param {string} operation - increase|decrease
* @param {int} qtyDifference - quantity difference
* @param {number} qtyDifference - quantity difference
* @param {HTMLElement} input - input element
* @returns {Promise<void>}
*/
Expand Down
20 changes: 10 additions & 10 deletions _dev/js/theme/core/cart/request/cart/addToCartRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import useHttpPayloadDefinition from '../../../../components/http/useHttpPayload
* @typedef ServerResponse
* @type {object}
* @property {string|string[]} errors - the errors returned by the server
* @property {int} id_product - product id
* @property {int} id_product_attribute - product attribute id
* @property {int} id_customization - product customization id
* @property {int} quantity - product quantity
* @property {number} id_product - product id
* @property {number} id_product_attribute - product attribute id
* @property {number} id_customization - product customization id
* @property {number} quantity - product quantity
* @property {boolean} success - success flag
* @property {object} cart - cart front object
*/

/**
* Add voucher to cart request
* @param payload {Object} - payload object to send
* @param payload.id_product {int} - product id - Required
* @param payload.qty {int} - product quantity - Required
* @param payload.id_product_attribute {int} - product id attribute - optional pass 0 if not set
* @param payload.id_customization {int} - customization id - optional pass 0 if not set
* @param payload.add {int} - optional
* @param payload.id_product {number} - product id - Required
* @param payload.qty {number} - product quantity - Required
* @param payload.id_product_attribute {number} - product id attribute - optional pass 0 if not set
* @param payload.id_customization {number} - customization id - optional pass 0 if not set
* @param payload.add {number} - optional
* @param payload.action {string} - optional
* @param payload.token {string} - optional
* @param payload.ajax {int} - optional
* @param payload.ajax {number} - optional
* @example
* const payload = {
* id_product: 1, // Required
Expand Down
18 changes: 9 additions & 9 deletions _dev/js/theme/core/cart/request/cart/deleteFromCartRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import useHttpPayloadDefinition from '../../../../components/http/useHttpPayload
* @typedef ServerResponse
* @type {object}
* @property {string|string[]} errors - the errors returned by the server
* @property {int} id_product - product id
* @property {int} id_product_attribute - product attribute id
* @property {int} id_customization - product customization id
* @property {int} quantity - product quantity
* @property {number} id_product - product id
* @property {number} id_product_attribute - product attribute id
* @property {number} id_customization - product customization id
* @property {number} quantity - product quantity
* @property {boolean} success - success flag
* @property {object} cart - cart front object
*/

/**
* Add voucher to cart request
* @param payload {Object} - payload object to send
* @param payload.id_product {int} - product id - Required
* @param payload.id_product_attribute {int} - product id attribute - optional pass 0 if not set
* @param payload.id_customization {int} - customization id - optional pass 0 if not set
* @param payload.delete {int} - optional
* @param payload.id_product {number} - product id - Required
* @param payload.id_product_attribute {number} - product id attribute - optional pass 0 if not set
* @param payload.id_customization {number} - customization id - optional pass 0 if not set
* @param payload.delete {number} - optional
* @param payload.action {string} - optional
* @param payload.token {string} - optional
* @param payload.ajax {int} - optional
* @param payload.ajax {number} - optional
* @example
* const payload = {
* id_product: 1, // Required
Expand Down
20 changes: 10 additions & 10 deletions _dev/js/theme/core/cart/request/cart/quantityChangeRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import useHttpPayloadDefinition from '../../../../components/http/useHttpPayload
* @typedef ServerResponse
* @type {object}
* @property {string|string[]} errors - the errors returned by the server
* @property {int} id_product - product id
* @property {int} id_product_attribute - product attribute id
* @property {int} id_customization - product customization id
* @property {int} quantity - product quantity
* @property {number} id_product - product id
* @property {number} id_product_attribute - product attribute id
* @property {number} id_customization - product customization id
* @property {number} quantity - product quantity
* @property {boolean} success - success flag
* @property {object} cart - cart front object
*/

/**
* Add voucher to cart request
* @param payload {Object} - payload object to send
* @param payload.id_product {int} - product id - Required
* @param payload.qty {int} - product quantity - Required
* @param payload.id_product_attribute {int} - product id attribute - optional pass 0 if not set
* @param payload.id_customization {int} - customization id - optional pass 0 if not set
* @param payload.add {int} - optional
* @param payload.id_product {number} - product id - Required
* @param payload.qty {number} - product quantity - Required
* @param payload.id_product_attribute {number} - product id attribute - optional pass 0 if not set
* @param payload.id_customization {number} - customization id - optional pass 0 if not set
* @param payload.add {number} - optional
* @param payload.action {string} - optional
* @param payload.token {string} - optional
* @param payload.ajax {int} - optional
* @param payload.ajax {number} - optional
* @example
* const payload = {
* id_product: 1, // Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import useHttpPayloadDefinition from '../../../../components/http/useHttpPayload
* @typedef ServerResponse
* @type {object}
* @property {string|string[]} errors - the errors returned by the server
* @property {int} id_customization - always 0
* @property {int} id_product - always 0
* @property {int} id_product_attribute - always 0
* @property {int} quantity - always 0
* @property {number} id_customization - always 0
* @property {number} id_product - always 0
* @property {number} id_product_attribute - always 0
* @property {number} quantity - always 0
* @property {boolean} success - success flag
* @property {object} cart - cart front object
*/
Expand All @@ -18,10 +18,10 @@ import useHttpPayloadDefinition from '../../../../components/http/useHttpPayload
* Add voucher to cart request
* @param payload {Object} - payload object to send
* @param payload.discount_name {string} - discount code - Required
* @param payload.addDiscount {int} - optional
* @param payload.addDiscount {number} - optional
* @param payload.action {string} - optional
* @param payload.token {string} - optional
* @param payload.ajax {int} - optional
* @param payload.ajax {number} - optional
* @example
* const payload = {
* discount_name: 'voucherName', // Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import useHttpPayloadDefinition from '../../../../components/http/useHttpPayload
* @typedef ServerResponse
* @type {object}
* @property {string|string[]} errors - the errors returned by the server
* @property {int} id_customization - always 0
* @property {int} id_product - always 0
* @property {int} id_product_attribute - always 0
* @property {int} quantity - always 0
* @property {number} id_customization - always 0
* @property {number} id_product - always 0
* @property {number} id_product_attribute - always 0
* @property {number} quantity - always 0
* @property {boolean} success - success flag
* @property {object} cart - cart front object
*/

/**
* Add voucher to cart request
* @param payload {Object} - payload object to send
* @param payload.deleteDiscount {int} - discount code id - Required
* @param payload.deleteDiscount {number} - discount code id - Required
* @param payload.action {string} - optional
* @param payload.token {string} - optional
* @param payload.ajax {int} - optional
* @param payload.ajax {number} - optional
* @example
* const payload = {
* deleteDiscount: 2, // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useDefaultHttpRequest from '../../../components/http/useDefaultHttpReques
* @param url {string} - checkout url to send request
* @param payload {object} - request payload
* @param payload.delivery_option[id] {string} - delivery option id with id_address_delivery
* @param payload.ajax {int} - optional
* @param payload.ajax {number} - optional
* @param payload.action {string} - optional
* @example
* const payload = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { each } from '../../../utils/DOMHelpers';
/**
* Change the color of the edit button for the wrong address
* @param {boolean} enabled - true if button should be dangered or false otherwise
* @param {int} id - address id
* @param {number} id - address id
* @param {string} type - address type (delivery or invoice)
*/
const switchEditAddressButtonColor = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const { dispatch, abortAll } = useHttpController();
* @property {boolean} js_enabled - is js enabled
* @property {string} label - listing label
* @property {object} pagination - pagination object
* @property {int} pagination.current_page - pagination current page
* @property {int} pagination.items_shown_from - pagination items shown from
* @property {int} pagination.items_shown_to - pagination items shown to
* @property {number} pagination.current_page - pagination current page
* @property {number} pagination.items_shown_from - pagination items shown from
* @property {number} pagination.items_shown_to - pagination items shown to
* @property {array} pagination.pages - pagination pages array
* @property {object[]} products - array of front representations of products
* @property {string} rendered_active_filters - active filters html content
Expand Down
2 changes: 1 addition & 1 deletion _dev/js/theme/utils/debounce.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Debounce function
* @param func {function} - function to debounce
* @param timeout {int} - timeout in ms (default: 300)
* @param timeout {number} - timeout in ms (default: 300)
* @returns {(function(...[*]): void)|*}
*/
const debounce = (func, timeout = 300) => {
Expand Down

0 comments on commit e806515

Please sign in to comment.