function useAverage() { var avg = 0; let weight = 0; const append = value => { avg = (weight * avg) + value; weight += 1; avg = avg/weight; } return [() => avg, append]; } function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } function lerp(a, b, alpha) { return ((1-alpha)*a) + (alpha*b); } class Enum { constructor(prefix, name) { this.prefix = prefix; this.name = name; } toString() { return `${this.prefix}.${this.name}`; } } export { useAverage, clamp, lerp, Enum };