import type { StoredQuotaDocument, SubscriptionQuota } from "@opengeni/subscriptions"; import type { Database } from "../database.js"; /** The caller must already hold the connection's existing read scope. */ export declare function recordSubscriptionUsageReading(tx: Database, accountId: string, connectionId: string, provider: string, reading: { observedAt: number | null; windows: SubscriptionQuota["windows"]; }): Promise; /** Preserve the fetched observation separately from retained/merged windows. */ export declare function withSubscriptionUsageReading(stored: StoredQuotaDocument, observation: SubscriptionQuota): { windows: readonly import("@opengeni/subscriptions").QuotaWindow[]; modelCooldowns: Readonly>; modelCooldownCauses?: Readonly>; modelCooldownClaims?: Readonly>; exhaustedUntil: number | null; exhaustedKind: "quota" | "rate_limit" | null; exhaustedClaim?: import("@opengeni/subscriptions").QuotaBlockClaim | null; source: import("@opengeni/subscriptions").QuotaSource | null; constrainedUntil?: number | null; providerDetails?: Readonly>; usageReading: { observedAt: number; windows: readonly import("@opengeni/subscriptions").QuotaWindow[]; } | null; };