Looking for a solution:
type WithRequiredProperty<Type, Key extends keyof Type> = Omit<Type, Key> & {
[Property in Key]-?: Type[Property];
};
export type MessageWithMdEnforced = WithRequiredProperty<IMessage, 'md'>;
export interface IMessage extends IClass {
rid: RoomID;
msg: string;
tmid?: string;
tshow?: boolean;
ts: Date;
}
Encountering an issue where IMessage
is imported from node_modules and cannot be modified directly.
Desiring to include errorReason: string
in the IMessage interface.
Seeking advice on how to proceed and achieve the desired outcome. Any suggestions?