import type { Color, ScreenMode, PlayerConfig, Rect } from '../core/types';
import { EventBus } from '../core/EventBus';
export interface Player {
    index: number;
    name: string;
    color: Color;
    inputDevice: 'keyboard' | 'gamepad';
    gamepadIndex: number;
    score: number;
    lives: number;
    active: boolean;
    /** Entity ID of the player character in the world. */
    entityId: number | null;
}
export declare class PlayerManager {
    readonly events: EventBus;
    readonly maxPlayers: number;
    private players;
    constructor(maxPlayers?: number);
    get activeCount(): number;
    getPlayer(index: number): Player | undefined;
    get allPlayers(): Player[];
    get activePlayers(): Player[];
    join(config: PlayerConfig): Player | null;
    leave(index: number): void;
    /** Quick setup for single player (keyboard). */
    setupSingle(): Player;
    /** Quick setup for local multiplayer. */
    setupLocal(count: number): Player[];
    clear(): void;
}
export interface Viewport {
    playerIndex: number;
    rect: Rect;
    pixelRect: Rect;
}
export declare class SplitScreenManager {
    private _mode;
    private _canvasWidth;
    private _canvasHeight;
    private viewports;
    get mode(): ScreenMode;
    /** Set screen dimensions (usually from canvas). */
    setCanvasSize(w: number, h: number): void;
    /** Configure split mode for N active players. */
    configure(players: Player[], preferredMode?: ScreenMode): void;
    private buildGrid;
    private rebuildViewports;
    getViewports(): Readonly<Viewport>[];
    getViewportForPlayer(playerIndex: number): Viewport | undefined;
    /** Apply viewport clip/transform to Canvas 2D context before rendering a player's view. */
    applyViewport(ctx: CanvasRenderingContext2D, viewport: Viewport): void;
    /** Restore context after rendering a viewport. */
    restoreViewport(ctx: CanvasRenderingContext2D): void;
    /** Render divider lines between viewports. */
    renderDividers(ctx: CanvasRenderingContext2D, lineColor?: string, lineWidth?: number): void;
    /** Get cols/rows for grid-based layouts. */
    private getGridSpec;
}
declare const PLAYER_COLORS: Color[];
export { PLAYER_COLORS };
