I have two interfaces:
Interface 1:
interface ILineItemProps {
state: 'OPENED' | 'COMPLETED' | 'CANCELLED' | 'PENDING';
}
Interface 2:
interface IProps {
steps: [
{
key: string;
title: string;
}
];
}
Interface 1 must add its object, in this case the state, inside the object of interface 2, thus:
[{
key: string;
title: string;
state: interface1
}]
I've tried it in several ways:
[{
key: string;
title: string;
} & Interface1]
Array<{
key: string;
title: string;
} & Interface1>
But I could not.
&?