I'm trying to do something like this:
interface BaseParameters {
a: string;
b: number;
}
function functionA(body: {
foo: string;
} extends BaseParameters) {
// do something
}
To accomplish this:
function functionB(body: {
foo: string;
a: string;
b: number;
}) {
// do something
}
I'm getting this error which I can't make sense of: '?' expected.ts(1005)
Is it possible to accomplish what I'm trying to do or do I have to do it like this?
interface BaseParameters {
a: string;
b: number;
}
interface FunctionParameters extends BaseParameters {
foo: string;
}
function functionA(body: FunctionParameters) {
// do something
}