fix(C191): tipos JSDoc do delta (parseInput/classifyRelation) para o typecheck

This commit is contained in:
Francisco Solla 2026-09-19 01:04:16 -03:00
parent b226ebb88a
commit 386e333916

View file

@ -344,6 +344,11 @@ const parseFreeText = (text, { delta = false } = {}) => {
return matrixToDataset(matrix, 'txt')
}
/**
* @typedef {{ label: string, value?: number, initial?: number, final?: number }} DatasetRow
* @typedef {{ name: string, rows: { label: string, value: number }[] }} DatasetSeries
*/
/**
* Parse the raw input into `{ rows, format, issues }`. `buffer` is required for
* xlsx/xls; `text` for csv/md/txt. `format` overrides the extension inference.
@ -351,6 +356,7 @@ const parseFreeText = (text, { delta = false } = {}) => {
* final, header naming the two periods) instead of the single-measure path.
*
* @param {{ text?: string | null, buffer?: Buffer | null, format?: string | null, delta?: boolean }} [options]
* @returns {{ rows: DatasetRow[], series?: DatasetSeries[], startLabel?: string, endLabel?: string, format: string, issues: string[] }}
*/
export const parseInput = ({ text = null, buffer = null, format = null, delta = false } = {}) => {
if (format === 'xlsx' || format === 'xls') {
@ -379,7 +385,7 @@ export const parseInput = ({ text = null, buffer = null, format = null, delta =
* series (few periods as columns, many as a line); anything else is a
* ranking/comparison in horizontal bars.
*
* @param {{ label: string, value: number }[]} rows
* @param {DatasetRow[]} rows
* @param {string | null} [forcedType]
*/
export const classifyRelation = (rows, forcedType = null) => {