Encountered an issue with generic types while working on a user-defined type(interface) structured like this:
IList1: {
prop1: string,
prop2: number,
prop3: string
.
.
.
}
IList2:...
IList3:...
After receiving a server-side response in the form of Array<Array<,IListx>>, attempted to create a function as follows:
function fun<T>(args:T):Array<Array<T>> {
return Array<Array<typeof args>>;
}
Also tried declaring variables like this:
let a:fun<IList1> = ...;
let b:fun<IList2> = ...;
let x:fun<IListx> = ...;
This approach did not yield the desired outcome. Uncertain if this is the correct method for creating a generic type, seeking assistance to rectify the issue. Any guidance would be highly appreciated.