Skip to content

Commit

Permalink
docs: update class member doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ciatph committed Sep 12, 2024
1 parent d37c797 commit 93b97e1
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 19 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ Pre-compiled windows binaries are available for download in the latest [Releases

## Class Documentation

- Class documentation and methods are available at https://ciatph.github.io/ph-municipalities.
- Class and methods documentation are available at https://ciatph.github.io/ph-municipalities.
- The documentation website's HTML files are available in the [`gh-pages`](https://github.com/ciatph/ph-municipalities/tree/gh-pages) branch of this repository.
- Class source codes are available at https://github.com/ciatph/ph-municipalities.
- Refer to the [Building the Class Documentation](#building-the-class-documentation) section for more information about updating and building the class documentation.

## Requirements
Expand Down
38 changes: 34 additions & 4 deletions app/src/classes/colorlog/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
/**
* Prints colored console.log messages
* @class
*/
class ColorLog {
/**
* Text styles for logging.
* @static
* @type {Object.<string, string>}
* @property {string} BOLD - Bold text style.
* @property {string} NORMAL - Normal text style.
*/
static TEXT = {
BOLD: '\x1b[1m',
NORMAL: '\x1b[0m'
}

/**
* ANSI colors for coloring the logging text.
* @static
* @type {Object.<string, object>}
* @property {Object} TEXT - Object containing color properties.
* @property {string} TEXT.WHITE - White color.
* @property {string} TEXT.GRAY - Gray color.
* @property {string} TEXT.GREEN - Green color.
* @property {string} TEXT.RED - Red color.
* @property {string} TEXT.YELLOW - Yellow color.
* @property {string} TEXT.BLUE - Blue color.
* @property {string} TEXT.CYAN - Cyan color.
* @property {string} TEXT.RESET - Reset color.
* @property {string} TEXT.MAGENTA - Magenta color.
*/
static COLORS = {
TEXT: {
WHITE: '\x1b[37m',
Expand All @@ -22,13 +43,22 @@ class ColorLog {
}
}

/** Message log */
/**
* Message log text.
* @type {string | null}
*/
#log = null

/** Text color */
/**
* Text color
* @type {string}
*/
#color = ColorLog.COLORS.TEXT.GREEN

/** Text weight (bold, normal) */
/**
* Text weight (bold, normal)
* @type {string}
*/
#weight = false

/**
Expand Down
61 changes: 48 additions & 13 deletions app/src/classes/excel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,40 @@ const { capitalizeText } = require('../../lib/utils')
* "municipalityName (ProvinceName)"
*/
class ExcelFile {
/** Remote download URL of an excel file */
/**
* Remote download URL of an excel file
* @type {string | null}
*/
#url = null

/** Full file path to excel file on local storage */
/**
* Full file path to excel file on local storage
* @type {string | null}
*/
#pathToFile = null

/** Region information from the /app/config/regions.json or other config file */
/**
* Region information from the `/app/config/regions.json` or other JSON config file.
* @type {Object | null}
*/
#settings = null

/** 10-day Excel file information */
/**
* 10-day Excel file information
* @type {Object.<string, string | null>}
*/
#metadata = {
// Weather forecast date
/**
* Weather forecast date
* @type {string | null}
*/
forecastDate: null
}

/** Other app settings and configurations */
/**
* Other app settings and configurations
* @type {Object.<string, string | number>}
*/
#options = {
/**
* SheetJS array index number translated from the Excel headers row count
Expand All @@ -49,26 +67,43 @@ class ExcelFile {
SHEETJS_COL: process.env.SHEETJS_COLUMN || '__EMPTY'
}

/** Excel workbook object parsed by sheetjs */
/**
* Excel workbook object parsed by sheetjs
* @type {Object[] | null}
*/
#workbook = null

/** Excel sheet names parsed by sheetjs */
/**
* Excel sheet names parsed by sheetjs.
* @type {string[] | null}
*/
#sheets = null

/** Objects[] Array corresponding to excel rows extracted from the excel sheet by sheetjs */
/**
* Objects[] Array corresponding to excel rows extracted from the excel sheet by sheetjs.
* @type {Object[] | null}
*/
#data = null

/** Object[] Array of processed string corresponding to the column in the excel file
* that contains the list of municipalities following the pattern:
/**
* Object[] Array of processed string corresponding to the column in the excel file
* that contains the list of municipalities following the pattern:
* "municipalityName (provinceName)"
* Content: [{ municipality, province }, ... ]
* @type {Object[] | null}
*/
#datalist = []

/** Event emitter for listening to custom events */
/**
* Node event emitter for listening to custom events.
* @type {Function}
*/
events = new EventEmitter()

/** List of EventEmitter events */
/**
* List of EventEmitter events.
* @type {Object.<string, string>}
*/
EVENTS = {
LOADED: 'loaded'
}
Expand Down
5 changes: 4 additions & 1 deletion app/src/classes/schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
* Validates Objects with [zod](https://github.com/colinhacks/zod) schemas and formats validation error(s) for log output.
*/
class Schema {
/** Settings object */
/**
* Settings object.
* @type {Object | null}
*/
#data = null

/**
Expand Down

0 comments on commit 93b97e1

Please sign in to comment.