import { type KitBlueprint, type KitOwnerIdKind, type KitTrustedAuthority } from './core.js'; /** Options for {@link matchesBlueprint}. */ export interface MatchesBlueprintOptions { /** Prefix for the type/function names. Defaults to none. */ typePrefix?: string; /** * Who may submit points to a `Score` row. Defaults to `'host'` (the * elected host referees); use `'server'` or `'automation'` for * server-refereed modes. Never plain players. */ scoreAuthority?: KitTrustedAuthority; /** * When set, gives each turn a real wall-clock deadline. `begin_turn` bumps * `turn_seq` and arms a one-shot timer — deduped per match, so arming the * next turn replaces the previous deadline — that invokes `expire_turn` * after `delayMs`. `expire_turn` records `turn_expired_seq` and pings the * match channel, so the current turn is out of time exactly when * `turn_expired_seq >= turn_seq`. * * That comparison is also the stale-fire guard: a timer already claimed * when the player beat the clock fires against an older `turn_seq`, writes * a lower `turn_expired_seq`, and can never satisfy it. * * Prefer this to {@link turnTick} — one timer per active match beats * re-scanning every match on an interval, and the deadline is exact rather * than rounded to the tick. */ turnTimer?: { delayMs: number; }; /** * Adds a `turn_tick` interval automation that increments each active * match's `tick_count`, so turn logic can compare * `tick_count - turn_started_tick >= N`. * * @deprecated Counters were a workaround for expressions having no * `now()`; one-shot timers made that unnecessary. Use {@link turnTimer}, * which gives an exact deadline and arms work per match instead of * scanning all of them every interval. Still honoured, and slated for * removal in the next major. */ turnTick?: { intervalMs: number; }; /** Owner-mirror typing (see the kit convention). Defaults to `'int'`. */ ownerIdKind?: KitOwnerIdKind; } /** Names derived by {@link matchesBlueprint} for a given prefix. */ export interface MatchesNames { metaType: string; scoreType: string; startFn: string; advanceRoundFn: string; scoreFn: string; endFn: string; beginTurnFn: string; expireTurnFn: string; turnTickFn: string; turnTickAutomation: string; } /** Compute the type/function names a matches blueprint (and its runtime helper) uses. */ export declare function matchesNames(typePrefix?: string): MatchesNames; /** * Blueprint for **matches** (lobbies, rounds, turns, scoring) — the * session-layer wrapper every session game needs. Sessions ARE the match * primitive (participants + current turn); this adds a session-scoped * `MatchMeta` (lobby state, round, winner, notification channel) and * per-player `Score` rows. * * Lifecycle functions (`start_match` / `advance_round` / `end_match`) are * creator-or-host gated and declare a **channel notification** — Buddy pings * every channel member post-commit with `"match_changed"`, and clients * re-pull the meta (the notify-to-pull pattern; `kit.matches.onMatchChanged` * wraps the subscription). Turn order itself uses the platform's * `gameModelSetSessionTurn` (the runtime helper calls it — turn authority is * enforced by the service, not an expression). * * End-of-match hooks: attach an event automation to `end_match` * (`function_invoked`) to submit leaderboard scores or adjust ratings. * * Runtime counterpart: `client.kit(appId).matches`. */ export declare function matchesBlueprint(options?: MatchesBlueprintOptions): KitBlueprint; //# sourceMappingURL=matches.d.ts.map