fix(types,client,server): improve type safety and harden client/server message handling
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
export interface IMessageCreator {
|
||||
export interface IMessageCreator<T = any> {
|
||||
messageText: string;
|
||||
payload?: string | number | any;
|
||||
payload?: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* A universe
|
||||
*/
|
||||
export interface IUniverseMessage extends IMessageCreator {
|
||||
export interface IUniverseMessage<T = any> extends IMessageCreator<T> {
|
||||
id: string;
|
||||
/**
|
||||
* time of creation
|
||||
|
||||
Reference in New Issue
Block a user