type CellValue = string | number | Date | null; type Measure = "nominal" | "ordinal" | "scale" | "unknown"; type MissingSpec = { kind: "none"; } | { kind: "discrete"; values: number[]; } | { hi: number; kind: "range"; lo: number; } | { hi: number; kind: "range+discrete"; lo: number; value: number; } | { kind: "strings"; values: string[]; }; type SpssFormat = { decimals: number; isDate: boolean; type: number; width: number; }; type Variable = { format: SpssFormat; label?: string; measure: Measure; missing: MissingSpec; name: string; type: "numeric" | "string"; valueLabels?: Array<{ label: string; value: CellValue; }>; width?: number; }; type Format = "csv" | "tsv" | "txt" | "xlsx" | "sav"; type Sheet = { name: string; rows: CellValue[][]; variables: Variable[]; }; type ParsedFile = { encoding?: string; format: Format; sheets: Sheet[]; }; /** Thrown for any malformed or hostile `.sav` input that a resource bound rejects — a bad file, not * a reader bug. Distinct from the plain `Error`s raised for unsupported-but-valid constructs so a * caller can `catch` an attack (OOM/hang avoidance) separately if it wants to. */ declare class SavError extends Error { } /** Resource ceilings that keep a hostile `.sav` from exhausting memory or looping unboundedly. The * defaults are generous, so no well-formed file is affected; pass a stricter `readSav(buf, opts)` in * memory-constrained environments. */ type SavLimits = { /** Maximum `ncases × nvars` data cells the reader will materialize (~500k rows × 100 vars). */ maxCells: number; /** Cumulative inflate output ceiling: total bytes a ZSAV may inflate to before the reader aborts (512 MiB). */ maxInflatedBytes: number; }; declare const DEFAULT_LIMITS: SavLimits; /** * Return a new {@link Sheet} in which every cell matching its variable's * declared {@link MissingSpec} is replaced by `null` (user-missing → system-missing). * Non-mutating: fresh `rows` and fresh inner arrays; the input is left untouched. */ declare function applyUserMissing(sheet: Sheet): Sheet; /** Read an SPSS `.sav`/`.zsav` system file end-to-end: header → dictionary → extensions → variables * → (inflate if ZSAV) → data cases. Matches R `haven` on the committed golden fixtures. `opts` * tightens the resource ceilings (see `SavLimits`); a hostile file is rejected with a `SavError`. */ declare function readSav(buf: ArrayBuffer, opts?: Partial): Promise; export { type CellValue, DEFAULT_LIMITS, type Format, type Measure, type MissingSpec, type ParsedFile, SavError, type SavLimits, type Sheet, type SpssFormat, type Variable, applyUserMissing, readSav };