import type { StatusResponse, ValidateReceiptRequest, ValidateReceiptResponse, ValidatePurchaseRequest, ValidatePurchaseResponse, PurchaseStatusResponse, EntitlementResponse, EntitlementsResponse } from '@onesub/shared'; /** * Upper bound for one round-trip to the onesub server, body included. Without * it a stalled connection hangs validation until the 180 s purchase timer * fires and reports PURCHASE_TIMEOUT — for a purchase that may well succeed. * * It must exceed the server's own worst case, or the client gives up on a * validation the server then completes: a Google validation makes two * sequential store calls of up to 10 s each, plus the store write, and a host * may make its own store calls before it (a pre-check) — so allow for double. */ export declare const REQUEST_TIMEOUT_MS = 60000; /** * Checks the subscription status for a given user from the onesub server. */ export declare function checkStatus(serverUrl: string, userId: string): Promise; /** * Validates a subscription receipt with the onesub server. * The server handles Apple/Google verification and stores the subscription. */ export declare function validateReceipt(serverUrl: string, receipt: ValidateReceiptRequest): Promise; /** * Validates a consumable or non-consumable product purchase with the onesub server. * The server verifies the Apple/Google receipt and records the purchase. */ export declare function validatePurchase(serverUrl: string, request: ValidatePurchaseRequest): Promise; /** * Checks the purchase status for a given user from the onesub server. * Optionally filter by productId. */ export declare function checkPurchaseStatus(serverUrl: string, userId: string, productId?: string): Promise; /** * Check a single entitlement for a user. Returns `{ active: false, source: null }` * when the user has no matching record, or throws on transport / server error. * * Returns 404 errorCode `ENTITLEMENT_NOT_FOUND` when the id is unknown to the * server (config mismatch). The throw differentiates this from "user not entitled". */ export declare function checkEntitlement(serverUrl: string, userId: string, id: string): Promise; /** * Check all entitlements configured on the server in one round-trip. * Use on app launch / login to populate the entitlements map. * * Returns `{ entitlements: {} }` when the server has no entitlements * configured (the route is not mounted, returning 404 — surfaced here as an * empty map rather than a throw, since "no entitlements configured" is a * valid runtime state, not an error). */ export declare function checkEntitlements(serverUrl: string, userId: string): Promise; //# sourceMappingURL=api.d.ts.map