import type { QuotaUnit } from './services/measures.js'; export interface TelkomselProduct { /** Stable slug used by `telkomsel_get_product`. */ id: string; /** Display name, e.g. "SIMPATI". */ name: string; /** One-line positioning from the site menu, e.g. "Prabayar". */ tagline: string; /** Marketing path on telkomsel.com. */ path: string; /** Machine-readable product family. */ type: string; /** Grouping label, e.g. "Internet Rumah". */ segment: string; /** Absolute URL of the official landing page. */ url: string; pageTitle: string; /** Meta description scraped from the official page. */ summary: string; /** Section headings lifted from the official page. */ headings: string[]; scrapedAt: string; } export interface ApiEnvelope { code: string; message: string; data: T; } export interface CustomerType { msisdn: string; custType: string; product: string; } export interface PackageCategory { categoryName: string; hasRecommendation: boolean; icon: string; isRoaming: boolean; /** Opaque token the API requires when listing packages in this category. */ menuLevel: string; } export interface PackageBonus { class: string; consumptiontime: string; highlight: string; longdesc: string; name: string; quota: string; shortdesc: string; subclass: string; validity: string; viral: string; } export interface PackageProduct { packageName: string; autoRenewal: string; businessPID: string; category: string; fee: number; typeOffer: string; /** Stable package identifier used by `telkomsel_get_package`. */ id: string; longdesc: string; bonus: PackageBonus[]; offerPriority: string; originalPrice: number; otherBonus: string; price: number; purchasePercentage: number; ribbonText?: string; shortdesc: string; subCategory: string; terms: string; totalQuota: string; totalValidity: string; trxPackage: string; validity: string; region: string; } export interface PackageGroup { subCategory: string; isRecommendation: boolean; product: PackageProduct[]; } /** A package as it sits in a fetched catalogue: product plus where it came from. */ export interface CatalogPackage extends PackageProduct { /** * The numeric part of `totalQuota`, parsed. `null` when the package * headlines no allowance at all. */ quotaValue: number | null; /** * Which quantity `quotaValue` counts. Never compare two packages' numbers * without checking this first: the same field holds GB, minutes and SMS. */ quotaUnit: QuotaUnit | null; /** `totalValidity` in days, parsed. `null` if the form is unrecognised. */ validityDays: number | null; /** * The GB of internet that works in any app: the sum of the package's `data allnet` bonuses. * `quotaValue` is the headline and also counts app-bound allowances (a "Nonton" or TikTok * quota) and roaming ones, which are not what a customer asking for internet buys. * `null` when the package has no such bonus. */ internetQuotaGb: number | null; /** Subcategory label the API filed it under. */ group: string; isRecommended: boolean; /** Top-level package category, e.g. "Internet". */ category: string; /** * Durable, cross-call identifier derived from stable fields * (`packageName@quota@price`). The API's own `id` is a per-request token that * changes on every call, so `ref` is what callers should persist. */ ref: string; /** * Corpus identity: `slug(packageName)@quota`, with no price in it. * * `ref` is right for "resolve this offer again", but wrong as an index key, * because a price change would rename the document rather than update it. * Use `offerId` to key an index and `ref` to resolve a specific priced offer. */ offerId: string; } export interface PackageListData { packageList: PackageGroup[]; msisdn?: string; } export interface FilterItem { label: string; value?: string; minPlaceholder?: string; maxValue?: number; minValue?: number; } export interface FilterSection { sectionName: string; title: string; type: string; defaultValue?: string; currency?: string; items: FilterItem[]; } export interface RoamingType { name: string; value: string; } export interface MappedRegion { en: string; original: string; } export interface OfferGroupRef { name: string; type: string; value: string; } export interface OfferBreakItem { name: string; enabled: boolean; menuLevel: string; image: string; background?: { desktop?: string; mobile?: string; }; colors?: { text?: string; }; offerGroup?: OfferGroupRef[]; } export interface OfferBreakData { categories: PackageCategory[]; space: number; limit: { group: number; offer: number; }; list: OfferBreakItem[]; } export interface CreditPulsa { description?: string; [key: string]: unknown; } export interface CreditItem { id: string; bid: string; name: string; ribbonImage?: string | null; ribbonText?: string | null; useStock: boolean; listPulsa?: CreditPulsa; [key: string]: unknown; } export interface FaqAnswer { [key: string]: unknown; } /** Filter payload accepted by POST /package/list. */ export interface PackageFilter { packageOrder: string; lowestPrice: string; highestPrice: string; quota: string; region: string; roamingType: string; } export declare const EMPTY_FILTER: PackageFilter;