@humanspeak/svelte-headless-table
Version:
A powerful, headless table library for Svelte that provides complete control over table UI while handling complex data operations like sorting, filtering, pagination, grouping, and row expansion. Build custom, accessible data tables with zero styling opin
25 lines (24 loc) • 674 B
TypeScript
/**
* Calculates the sum of an array of numbers.
*
* @param nums - The array of numbers to sum.
* @returns The sum of all numbers in the array, or 0 for an empty array.
* @example
* ```typescript
* sum([1, 2, 3, 4, 5]) // Returns 15
* sum([]) // Returns 0
* ```
*/
export declare const sum: (nums: number[]) => number;
/**
* Calculates the arithmetic mean (average) of an array of numbers.
*
* @param nums - The array of numbers to average.
* @returns The mean of all numbers, or 0 for an empty array.
* @example
* ```typescript
* mean([1, 2, 3, 4, 5]) // Returns 3
* mean([]) // Returns 0
* ```
*/
export declare const mean: (nums: number[]) => number;