fix(types,client,server): improve type safety and harden client/server message handling

This commit is contained in:
2026-05-01 11:22:06 +00:00
parent 496fd9a81a
commit 3ac4c2e708
22 changed files with 9276 additions and 3895 deletions
+7 -1
View File
@@ -15,6 +15,12 @@ export interface ISocketRequest_ProcessMessage {
method: 'processMessage';
request: interfaces.IUniverseMessage;
response: {
messageStatus: 'ok' | 'channel not found';
messageStatus: 'ok' | 'channel not found' | 'authentication required';
};
}
export interface ISocketRequest_Unsubscribe {
method: 'unsubscribe';
request: interfaces.IServerUnsubscribeActionPayload;
response: {};
}
+3 -3
View File
@@ -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