$event Sanitized event payload. */ public function record( array $event ): void; /** * Return recent click events for dashboard/export surfaces. * * @param int $limit Maximum rows. * * @return list> */ public function recentEvents( int $limit = 500 ): array; /** * Count recent click events for a coarse client bucket. * * @param string $userAgentHash User-agent hash. * @param string $refererHost Referer host. * @param DateTimeImmutable $since Lower bound, inclusive. */ public function countRecentMatching( string $userAgentHash, string $refererHost, DateTimeImmutable $since ): int; /** * Delete click events and rollups strictly older than the supplied cutoff. * * @param DateTimeImmutable $cutoff Cutoff instant. */ public function deleteOlderThan( DateTimeImmutable $cutoff ): int; }