diff --git a/.changeset/fix-server-connection-id-type.md b/.changeset/fix-server-connection-id-type.md new file mode 100644 index 00000000..8964bb6d --- /dev/null +++ b/.changeset/fix-server-connection-id-type.md @@ -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. diff --git a/packages/framework/server/src/types/index.ts b/packages/framework/server/src/types/index.ts index 34ecfcd0..b6937f02 100644 --- a/packages/framework/server/src/types/index.ts +++ b/packages/framework/server/src/types/index.ts @@ -70,6 +70,12 @@ export interface ServerConfig { * @en Server connection (extends RPC Connection) */ export interface ServerConnection> extends Connection { + /** + * @zh 连接唯一标识(继承自 Connection) + * @en Connection unique identifier (inherited from Connection) + */ + readonly id: string + /** * @zh 用户自定义数据 * @en User-defined data