/** * The two EDF numeric grammars. * * Layer 0. Imports one predicate from `latin1.ts` and nothing else. Sole owner of turning an * 8-byte ASCII field into a number. * * The spec says these fields are ASCII, left-justified and space-padded. Real files break * that in every way imaginable, so parsing reports *why* it failed rather than returning NaN * and leaving the caller to guess which diagnostic the bytes deserve: a comma decimal is * fatal, a right-justified field is a warning, and `'20 48'` is neither of those. */ /** * The outcome of parsing one numeric field. * * `ok === false` means `value` is meaningless — it is NaN, so a caller that ignores this flag * fails loudly instead of quietly recording a plausible 0. * * `problem` is single-valued and ordered by how much it matters: a field that is both * right-justified and comma-separated reports `'comma-decimal'`, because that is the one the * caller must refuse. */ export interface EdfNumberParse { readonly ok: boolean; readonly value: number; /** The field exactly as it was read, padding included. */ readonly raw: string; readonly problem: 'none' | 'empty' | 'comma-decimal' | 'not-left-justified' | 'malformed'; } /** * Parse a field that must be a whole number: signal count, samples per record, record count, * digital minimum and maximum. * * Exponent forms are deliberately rejected. Every field parsed by this function sizes the * file geometry, and `'1E3'` in one of them is far likelier to be corruption than a writer's * idea of 1000 — accepting it would turn unreadable bytes into a confidently wrong offset. * `'256.0'` is rejected for the same reason. */ export declare function parseEdfInteger(raw: string): EdfNumberParse; /** * Parse a field that may be fractional: physical minimum and maximum, record duration. * * Accepts a leading sign, a bare leading or trailing point, and an exponent, because writers * in the wild emit `'+22'`, `'.5'`, `'1E3'` and `'-1.23E-4'`. */ export declare function parseEdfNumber(raw: string): EdfNumberParse; //# sourceMappingURL=numbers.d.ts.map