/** * PostgresRateLimitStore — durable RateLimitStore adapter backed by PostgreSQL. * * Companion schema: src/manifest/rate-limit/stores/postgres.sql. * * Persistence model: one row per scope key. Sliding-window timestamps are * JSONB; window_start is epoch-ms. `mutate` runs SELECT … FOR UPDATE so * concurrent RateLimiter instances share one coherent bucket. * * DO NOT import this file in browser code — it requires `pg`. */ import type { Pool } from 'pg'; import type { RateLimitBucketState, RateLimitStore } from '../../runtime-rate-limit'; export interface PostgresRateLimitStoreOptions { /** A pg Pool. The store does NOT own the pool's lifecycle. */ pool: Pool; /** Table name override. Default: `manifest_rate_limit_buckets`. */ tableName?: string; } export declare class PostgresRateLimitStore implements RateLimitStore { private pool; private tableName; constructor(opts: PostgresRateLimitStoreOptions); get(scopeKey: string): Promise; set(scopeKey: string, state: RateLimitBucketState): Promise; clear(): Promise; mutate(scopeKey: string, fn: (current: RateLimitBucketState | undefined) => { next: RateLimitBucketState; result: T; }): Promise; private lockGet; private lockSet; } //# sourceMappingURL=postgres.d.ts.map