Align timer state key with rules engine (timer_ends_at). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?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;
|
|
}
|