I have a function
function getExtendedObject<T extends object>( currentObject: T ) {
return {
...currentObject,
newProp: "value1",
anotherProp: () => "something"
}
}
i need to get the return type of this function for a specific input.
type example = ReturnType<typeof getExtendedObject>
the above will give me
type example = object & {
newProp: string;
anotherProp: number;
}
but instead of object, i want a specific value. something like,
type example = { name: "john", marks: 91 } & {
newProp: string;
anotherProp: number;
}
how can i achieve this