import { ComponentFunction } from 'canvasengine'; import { RpgProvider, RpgRoomDescriptor, RpgWritableSignal } from '@rpgjs/common'; import { RpgClientPlayer } from '../Game/Player'; /** Client representation of a synchronized non-map gameplay room. */ export declare class RpgClientRoom> { private readonly synchronizedPlayers; /** Descriptor supplied by the authoritative server transfer. */ descriptor: import('canvasengine').WritableSignal; /** RPGJS players synchronized in this room. */ players: RpgWritableSignal>; /** Server-authoritative custom room state. */ state: RpgWritableSignal; reset(descriptor?: RpgRoomDescriptor | null): void; } /** Props passed to a custom gameplay-room CanvasEngine component. */ export interface RpgClientRoomSceneProps { room: RpgClientRoom; descriptor: RpgRoomDescriptor; } /** Lifecycle and CanvasEngine renderer for one registered server room kind. */ export interface RpgClientSceneDefinition { /** Server room kind handled by this scene. */ kind: string; /** Root CanvasEngine component mounted directly below the RPGJS Canvas. */ component: ComponentFunction>; /** Called while the previous scene is still mounted, before entering this room. */ onBeforeEnter?: (room: RpgClientRoom, descriptor: RpgRoomDescriptor) => void | Promise; /** Called after the target connection has opened. */ onEnter?: (room: RpgClientRoom, descriptor: RpgRoomDescriptor) => void | Promise; /** Called before this scene is replaced by another room. */ onLeave?: (room: RpgClientRoom, next: RpgRoomDescriptor) => void | Promise; /** Called whenever synchronized room state changes. */ onChanges?: (room: RpgClientRoom, partial: unknown) => void | Promise; } /** * Register CanvasEngine scene adapters for custom gameplay-room kinds. * * The client owns rendering and input while synchronized room data remains * server-authoritative. The provider works in standalone and MMORPG clients. * * @param scenes - Scene definitions keyed by the server-registered room kind. * @returns An RPGJS provider installed in the client configuration. * * @example * ```ts * provideClientScenes([{ * kind: "battle", * component: BattleScene, * }]) * ``` */ export declare function provideClientScenes(scenes: RpgClientSceneDefinition[]): RpgProvider;