/** * How narrow a hidden cell's interval may be. * - `rate`: the numerator lies in [0, records]. The interval must span at * least half that range and, for whole numbers, at least two values. * - `scaled`: values are non-negative with no upper bound. The interval * must reach down to half its own top or below (and not be a point). * - `free`: values have no bounds. The cell must not be pinned. */ export type ProtectionMode = 'rate' | 'scaled' | 'free'; /** A hidden cell: an arc from its row node to its column-side node. */ export interface AuditCell { from: number; to: number; /** Bounds of its unknown, in audit units. */ lo: number; hi: number; /** The records behind it (its count). */ records: number; } /** A total: an arc of the tree above or below the cells. */ export interface AuditTotal { from: number; to: number; /** The hidden part of the total, in audit units, when it is shown. */ value: number; /** Shown before the audit: drawn, with a value, and not withheld. */ shown: boolean; /** The records behind the total: what withholding it loses. */ records: number; } export interface AuditProblem { nodeCount: number; /** The sink and source the closing arc joins (sink to source). */ sink: number; source: number; cells: readonly AuditCell[]; totals: readonly AuditTotal[]; /** For each cell, the totals whose scope holds it. */ cellTotals: readonly (readonly number[])[]; mode: ProtectionMode; /** Whole-number data: numerators and shown totals are integers. */ integral: boolean; minCount: number; } /** * A cap on the audit's work, in edges looked at, so a very large grid * cannot stall the page: past it, every total that holds a hidden cell is * withheld, which is always safe. Counted, not timed, so the same data * always gives the same result on every device. A 60 x 24 grid with 6 * groups and 10% of cells hidden uses 2.5 million for rates and 3.15 * million for plain sums, about half the cap (measured at about 12 ms in * Chromium on a desktop, not a guarantee); with 20% hidden, or 100 rows, * it runs out. Tests hold the count, not the time. Running out while offering totals back keeps the safe set already * found; running out before that takes the safe rule. When rates are * audited twice (printed and exact), the two passes share the cap. */ export declare const AUDIT_WORK_LIMIT = 5000000; /** * Which totals may be shown: true at index i when total i may be shown. * Starts from `total.shown` and only ever withholds more. `spentBefore` * carries the work of an earlier pass over the same data, so that passes * share one budget (see auditWorkSpent). */ export declare function secureTotals(problem: AuditProblem, spentBefore?: number): boolean[]; /** The work the last secureTotals call ended on, for a following pass. */ export declare function auditWorkSpent(): number; //# sourceMappingURL=heatmap-disclosure.d.ts.map