/**
 * UserState — Cloudflare Durable Object.
 *
 * Single source of truth for per-user auth + billing + usage state.
 *
 * Stored fields:
 *   userId               — API key (used as the DO name) or assigned UUID
 *   apiKey               — the issued API key string (mirror of userId for issued keys);
 *                          null if this DO has never been claimed via checkout
 *   apiKeyIssuedAt       — Unix ms timestamp when the key was issued; null if unissued
 *   email                — user's email address (set on first Stripe interaction)
 *   tier                 — "free" | "paid"
 *   stripeCustomerId     — Stripe customer ID
 *   stripeSubscriptionId — active Stripe subscription ID
 *   callCount            — total calls today
 *   callCountResetAt     — Unix timestamp (ms) when callCount resets (midnight UTC)
 *   minuteCallCount      — calls in the current 60-second window
 *   minuteResetAt        — Unix timestamp (ms) when minuteCallCount resets
 *   invalidated          — if true, the API key has been revoked
 *
 * Internal HTTP routes (called by middleware via DO stub.fetch):
 *   GET  /get               → returns full UserStateData
 *   GET  /validate-key      → 200 { valid: bool, tier, email } (valid only if apiKey set + not invalidated)
 *   POST /increment         → atomically increments counters, checks limits, returns IncrementResponse
 *   POST /set-key           → claims this DO with an apiKey + Stripe identity + tier (called from /checkout/success)
 *   POST /update-tier       → sets tier + stripeSubscriptionId
 *   POST /update-stripe-ids → sets stripeCustomerId + stripeSubscriptionId
 *   POST /invalidate        → marks key as revoked
 *
 * Daily counter reset is scheduled via the DO alarm API (setAlarm at midnight UTC).
 */
import { DurableObject } from "cloudflare:workers";
import type { Env } from "../server.js";
export declare class UserState extends DurableObject<Env> {
    private data;
    fetch(request: Request): Promise<Response>;
    alarm(): Promise<void>;
    private handleGet;
    private handleValidateKey;
    private handleSetKey;
    private handleIncrement;
    private handleUpdateTier;
    private handleUpdateStripeIds;
    private handleInvalidate;
    private getState;
    private saveState;
}
//# sourceMappingURL=user-state.d.ts.map