Within an interface, I have a list of props that I would like to modify by extending the interface type in the following manner:
Modification of Prop types
Addition of new fields
interface Request { Id: NullProp<number>, Name: NullProp<string>, Code: NullProp<string>, Type: NullProp<string>, ValueType: NullProp<string> ..... ... }
/* aiming for below structure */
interface DataRequest extends Request { Id: number, Name: string, Code: string, Type: string, ValueType: string, ..... ..., DataRequestId: number, DataRequestType: string DataValueType: NullProp<string> }
I have noticed that I can use 'Omit' on a derived interface, but this becomes cumbersome with a long list of props as I have many interfaces similar to this one that require extension. I am seeking advice on whether to create a separate new interface and duplicate the props, or if there is a way to extend the same interface in a simpler manner?
NullProp is a type for Q | null | undefined