/** * Two fields in this catalogue look numeric and are not. * * `totalQuota` and `totalValidity` are display strings. `totalValidity` is * well-behaved — every one of the 307 packages returns " Days" and nothing * else. `totalQuota` is not: it carries whichever allowance headlines the * package, and across the live catalogue that is **three different quantities**: * * 60 forms like "5 GB", "1.50 GB", "400 GB" data * 26 forms like "335 Min", "43200 Min" voice minutes * 4 forms like "1500 SMS", "20 SMS" SMS * 30 packages with "" no headline allowance * * So `"10"` is not a comparable quantity across packages. A filter or sort that * treats it as one silently compares 10 gigabytes against 10 minutes against * 10 SMS — which is what this server used to do. Everything here exists to make * that mistake impossible to repeat. */ export type QuotaUnit = 'GB' | 'Min' | 'SMS'; export declare const QUOTA_UNITS: readonly QuotaUnit[]; export interface QuotaMeasure { value: number; unit: QuotaUnit; } /** * Parse a quota display string, keeping the unit. * * Verified against all 91 distinct forms the live catalogue returns: everything * except the empty string parses, and nothing parses to a wrong unit. Decimals * survive (`"1.50 GB"` is 1.5, not 1 or 150). */ export declare function parseQuota(raw: unknown): QuotaMeasure | null; /** * The GB of general internet a package carries, from its bonuses. * * Measured 2026-10-19: SERU Nonton Rp40.000 headlines "38 GB" and its price per GB came out * at Rp1.052, the cheapest internet in the catalogue, while the internet in it is 2 GB: * the rest is a Movie quota and app quotas that only work in video apps. The upstream marks * which is which in the bonus subclass: `data allnet` (and `data allnet5g`) work anywhere, * `data dpi` and `data video` only in the named apps, `data roaming` only abroad. * Null when there is no general-internet bonus, so a package is never priced on a figure * it does not have. */ export declare function internetQuotaGb(bonus: readonly { class?: string; subclass?: string; quota?: string; }[] | undefined): number | null; /** * Parse a validity display string into days. * * Handles the upstream's own grammar slip: the live catalogue returns "1 Days" * for 47 packages, so the plural is accepted without requiring it. */ export declare function parseValidityDays(raw: unknown): number | null; /** Human-readable form of a parsed quota, for a filter summary. */ export declare function formatQuota(measure: QuotaMeasure | null): string;