Currently I have this interfaces:
export interface requestPayload {
agentId: string;
}
export interface Agent {
id: string;
name: string;
requestPayload: requestPayload;
}
My problem is requestPayload property of Agent interface is now an object with { agentId: string; }
But requestPayload should be anything, like an array, number, string, and maybe that object that I defined with requestPayload interface.
I got a suggestion to "use a generic", how can I change that to a generic? I'm not sure how to proceed.
requestPayloadinterface in the first place ifrequestPayloaddoesn't have to match the type?requestPayloadwould be always an object, but now it seems that can be anything, so how can define it's type?