import type { Plugin, PlayerID } from '../types'; interface PlayerData { players: Record; } export interface PlayerAPI { state: Record; get(): PlayerState; set(value: PlayerState): PlayerState; opponent?: { get(): PlayerState; set(value: PlayerState): PlayerState; }; } interface PluginPlayerOpts { setup?: (playerID: string) => PlayerState; playerView?: (players: Record, playerID?: string | null) => any; } export interface PlayerPlugin { player: PlayerAPI; } /** * Plugin that maintains state for each player in G.players. * During a turn, G.player will contain the object for the current player. * In two player games, G.opponent will contain the object for the other player. * * @param {function} initPlayerState - Function of type (playerID) => playerState. */ declare const PlayerPlugin: ({ setup, playerView, }?: PluginPlayerOpts) => Plugin, PlayerData, any>; export default PlayerPlugin;