Add OBS overlays (goal, timer, counter, alerts) with ETag polling

Align timer state key with rules engine (timer_ends_at).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-15 08:45:22 -08:00
1 parent 7155396312
commit 65082fb2f5
10 files changed
+815

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
<?php
declare( strict_types=1 );
namespace StreamGoals\Overlay;
/**
* Read-only data the overlay widgets need. Rows are raw associative arrays shaped like the
* sg_* tables; the payload builders do all privacy filtering, so implementations need not.
*/
interface OverlayDataSource {
/** The goal currently shown on stream (status active, newest first), or null. */
public function activeGoal(): ?array;
/** Sum of completed donations for the goal, in minor units (base or total per counts_fees). */
public function raisedMinor( array $goal ): int;
/** Raw sg_state value for a goal key, or null. */
public function stateValue( int $goalId, string $key ): ?string;
/** @return array{label:string,value:int} */
public function counter( int $goalId ): array;
/**
* Donations newer than $sinceId (ascending id, at most $limit rows). With null, return the single
* newest row so the caller can establish a baseline.
*
* @return array<int,array<string,mixed>>
*/
public function donations( ?int $sinceId, int $limit ): array;
}