Let's say I have a type
type Template = {
a: string;
b: string;
c: string
}
and I want to use it inside a function, but I want to add extra param to it. What would be the best way to implement it?
when I try to extend it, typescript says ? expected
here's how I do it
const test = (template: Template extends { d: string }[]) => {
template.map(t => console.log(t.d));
}
P.S. I don't to uses [key:string]: string for this type