If I have a specified type like this:
type Template = {
a: string;
b: string;
c: string
}
I want to utilize it within a function, but with an additional parameter. How can I achieve this efficiently?
When attempting to extend the type, TypeScript indicates ? expected
This is how I attempted it:
const test = (template: Template extends { d: string }[]) => {
template.map(t => console.log(t.d));
}
Note: I prefer not to use [key:string]: string for defining this type.