import type { Channel } from './types.js'; export interface BucketLimit { cap: number; windowMs: number; } export interface PublicSpawnLimits { /** Per-(senderId, channel) bucket. Required: every channel has a cap. */ perChannel: Record; /** Cross-channel bucket keyed on senderId alone. */ global: BucketLimit; } export type AdmitDecision = { admitted: true; } | { admitted: false; scope: 'channel' | 'global'; cap: number; windowMs: number; }; export interface RateLimiter { /** Try to admit one spawn. Mutates state on `admitted: true`. */ admit(senderId: string, channel: Channel, now?: number): AdmitDecision; /** Test-only: clear all buckets. */ reset(): void; } export declare function createSpawnRateLimiter(limits: PublicSpawnLimits): RateLimiter; export declare const DEFAULT_PUBLIC_SPAWN_LIMITS: PublicSpawnLimits; //# sourceMappingURL=spawn-rate-limiter.d.ts.map