Open
Description
Generic types can cause a lot of complex TypeScript errors that are difficult to resolve, so I recommend we avoid them unless they are necessary. This seems equivalent & easier to maintain:
interface IBaseChatMessage { type: 'msg'; body: string; id: string; time: number; sender: unknown; attachments?: unknown[]; } /** * The interface of a chat message in the chat model. */ export interface IChatMessage extends IBaseChatMessage { sender: IUser; attachments?: IAttachment[]; } /** * The interface of a chat message in the YChat shared document. */ export interface IYMessage extends IBaseChatMessage { sender: string; attachments?: string[]; }
Originally posted by @dlqqq in #148 (comment)
For the context, this would be in replacement of the IChatMessage
interface and the IYMessage
interface.
Metadata
Metadata
Assignees
Labels
No labels