websocket-game-lobby icon indicating copy to clipboard operation
websocket-game-lobby copied to clipboard

Provide types for the custom property

Open vincentharrius opened this issue 2 years ago • 0 comments

On many of the core types, the custom property has the type any. It would be helpful when developing in typescript to determine the type by using generics.

Current:

export interface Player {
    // ...
    custom: any;
}

Proposal:

export interface Player<T = any> {
    // ...
    custom: T;
}

This would be done for the following interfaces:

  • Game
  • Player
  • Spectator
  • Turn

vincentharrius avatar Nov 22 '22 15:11 vincentharrius