/** * `weight="column"` — take the proportions from the FILE instead of the config. * * Without it a list is drawn uniformly, so `Smith` and `Zabrowski` appear * equally often. Real distributions are never flat: the top US surnames cover a * large share of the population while the tail is vanishingly rare, and a * dataset that flattens that is the first thing an analyst notices. * * The proportions are honoured EXACTLY, not on average — the same Hamilton * machinery `percent=` uses. Weights `20000` and `10000` over 30 000 rows give * precisely 20 000 and 10 000, not "about twice as many". * * A weight is a raw COUNT, not a percentage: census and SSA files publish * occurrence counts, and asking a user to normalise them by hand would be a * pointless invitation to arithmetic errors. * Spec: docs/specs/2026-07-19-en-us-pack-structure.md */ import type { FileSourceOptions } from './file.js'; export declare class WeightedFileError extends Error { readonly name = "WeightedFileError"; } export interface WeightedValues { readonly values: string[]; /** Share of the total, in percent — what the Hamilton path expects. */ readonly percents: number[]; } /** The `weight` attribute, or undefined when the column is not weighted. */ export declare function weightColumnOf(attrs: Record): string | undefined; /** * Read value and weight columns side by side and turn the counts into percents. * * Rows whose weight is zero are DROPPED rather than kept at zero probability: * a value that can never appear only costs the distribution machinery memory, * and census files carry plenty of them. */ export declare function loadWeightedValues(path: string, options: FileSourceOptions, weightColumn: string): WeightedValues; /** * A weighted data-list pack as {values, percents}, or undefined when the pack * is absent or unweighted. * * Shared by BOTH engines so a weighted pack is drawn identically to a weighted * `text` or `file=` — the in-memory builder hands it to `distributeByPercent`, * the streaming builder into its slot machinery. Kept here, next to the other * weighted sources, so neither engine grows its own copy of the shape. */ export declare function weightedPackValues(entry: { values?: readonly string[] | undefined; percents?: readonly number[] | undefined; } | undefined): { values: string[]; percents: number[]; } | undefined; //# sourceMappingURL=weighted.d.ts.map