fix(server): expose id property on ServerConnection type (#372)

This commit is contained in:
YHH
2025-12-28 13:47:27 +08:00
committed by GitHub
parent 9f3f9a547a
commit 9c41181875
2 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
"@esengine/server": patch
---
fix: expose `id` property on ServerConnection type
TypeScript was not properly resolving the inherited `id` property from the base `Connection` interface in some module resolution scenarios. This fix explicitly declares the `id` property on `ServerConnection` to ensure it's always visible to consumers.

View File

@@ -70,6 +70,12 @@ export interface ServerConfig {
* @en Server connection (extends RPC Connection) * @en Server connection (extends RPC Connection)
*/ */
export interface ServerConnection<TData = Record<string, unknown>> extends Connection<TData> { export interface ServerConnection<TData = Record<string, unknown>> extends Connection<TData> {
/**
* @zh 连接唯一标识(继承自 Connection
* @en Connection unique identifier (inherited from Connection)
*/
readonly id: string
/** /**
* @zh 用户自定义数据 * @zh 用户自定义数据
* @en User-defined data * @en User-defined data