tengo una funcion
function getExtendedObject<T extends object>( currentObject: T ) { return { ...currentObject, newProp: "value1", anotherProp: () => "something" } }necesito obtener el tipo de retorno de esta función para una entrada específica.
type example = ReturnType<typeof getExtendedObject>lo anterior me dará
type example = object & { newProp: string; anotherProp: number; }pero en lugar de objeto, quiero un valor específico. algo como,
type example = { name: "john", marks: 91 } & { newProp: string; anotherProp: number; }Cómo puedo conseguir esto