It seems you want to extend Column instances with a formatValue property that contains the value from the corresponding Stat instance while still retaining then Item's property type.

The example below will do just that, making the value property used in the returned object's formatValue's arguments be the same type of corresponding item with the same key.

interface FormattedColumn<T, V> extends Column {
  formatValue: (params: { value: V; item: T }) => string;
}
type ColumnsWithFormat<T> = { [P in keyof T]: FormattedColumn<T, T[P]> };

function extendColumns<T>(columns: Columns<T>, stats: Stats<T>): ColumnsWithFormat<T> {
  const columnsWithFormat: Partial<ColumnsWithFormat<T>> = {};
  for (const key in stats) {
    columnsWithFormat[key] = { ...columns[key], formatValue: stats[key].formatValue };
  }
  return columnsWithFormat as ColumnsWithFormat<T>;
  // Alternative with Object.entries.
  // return (Object.entries(stats) as [keyof T, Stats<T>[keyof T]][])
  //    .reduce((acc, [key, stat]) => ({ ...acc, [key]: { ...columns[key], formatValue: stat.formatValue }}), 
  //      {} as Partial<ColumnsWithFormat<T>>) as ColumnsWithFormat<T>;
}

const result = extendColumns(columns, items);

// formatValue: (params: { value: Currency; item: Item; }) => string
result.currency.formatValue({ item: { currency: 'USD', earnings: 1, id: 1, product: 'abc' }, value: 'USD' });
Answer from Daniel Gimenez on Stack Overflow
🌐
Bobby Hadz
bobbyhadz.com › blog › typescript-merge-objects
How to merge Objects in TypeScript | bobbyhadz
When merging objects, the order is important because if two objects have the same key, the object whose properties are unpacked later wins.
🌐
Squash
squash.io › tutorial-on-merging-objects-in-typescript
How to Merge Objects in TypeScript - Squash Labs
May 8, 2024 - When merging objects in TypeScript that have the same keys, the resulting object will have the values of the last object with the same key.
Discussions

Combining two TypeScript object with the same keys & different properties? - Stack Overflow
I have two TypeScript objects with the same keys, but different properties. I want to combine/merge the properties from one of the objects onto the other object. interface Stat { name: More on stackoverflow.com
🌐 stackoverflow.com
How to combine object properties in typescript? - Stack Overflow
Use Typescript spread operator it transpile to Javascript Object.assign() If you need deep tree object merging you could use changing function of best-global package More on stackoverflow.com
🌐 stackoverflow.com
How can I merge properties of two JavaScript objects? - Stack Overflow
ES2018/TypeScript: Many answers are OK but I've come up with a more elegant solution to this problem when you need to merge two objects without overwriting overlapping object keys. More on stackoverflow.com
🌐 stackoverflow.com
Merge JavaScript objects in array with same key - Stack Overflow
What is the best way to merge array contents from JavaScript objects sharing a key in common? How can array in the example below be reorganized into output? Here, all value keys (whether an array o... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Omarileon
omarileon.me › blog › typescript-merge-objects
mari. | 3 Simple Ways to Merge Objects in TypeScript
January 26, 2024 - The easiest solution to merge objects in TypeScript or JavaScript is the spread syntax, or spread operator. If you're not familiar with spread, it essentially turns an object, or anything that is iterable into separate elements.
🌐
Webdevtutor
webdevtutor.net › blog › typescript-merge-objects-with-same-key
How to Merge Objects with Same Key in Typescript
Fortunately, Typescript provides us with several ways to achieve this efficiently. One of the simplest ways to merge objects with the same key in Typescript is by using the spread operator.
🌐
SPGuides
spguides.com › merge-two-objects-in-typescript
How to Merge Two Objects in TypeScript?
February 7, 2024 - Using the spread operator (...) simplifies the merging process. ... Ensure the resulting object’s type reflects the possible keys and types from both objects. The type of the merged object will be an intersection of the object types being merged.
🌐
Aaron Bos
aaronbos.dev › posts › merge-objects-typescript-javascript
Merging Objects in TypeScript (and JavaScript)
June 11, 2022 - What makes this method different from previous methods is that it performs a deep merge of objects instead of shallow. This means that the resulting object shares no references with the source object(s). In order to accomplish this functionality the method recursively navigates source object keys and applies the new values to the target object.
Find elsewhere
🌐
DEV Community
dev.to › svehla › typescript-how-to-deep-merge-170c
How to deep merge in Typescript - DEV Community
October 5, 2021 - For the opposite of the previous generic, we will define a new one that picks all keys which are the same in both objects.
🌐
Atomizedobjects
atomizedobjects.com › blog › javascript › how-to-merge-two-objects-in-javascript
How to merge two objects in JavaScript | Atomized Objects
With this recursive function, after all the objects have been found and merged together it will return a single object with all values merged together. When you merge two objects with the same key in JavaScript you need to decide which one will take precedence in the merged array.
🌐
SitePoint
sitepoint.com › blog › javascript › how to merge objects in javascript
How to Merge Objects in JavaScript — SitePoint
November 5, 2024 - The spread operator (...) is a common approach to merge objects in JavaScript. It has the form {...object1, ...object2}. When properties with the same keys exist in the source objects, the spread operator overwrites the values in the target object with the latest source object’s values.
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript merge objects
How to Merge Objects in JavaScript
March 29, 2020 - Both the spread operator ( ...) and Object.assign() method perform a shallow merge. It means that if an object has a property that references to another object, the property of the original object and result target object will reference the same object.
🌐
TypeScript
typescriptlang.org › docs › handbook › declaration-merging.html
TypeScript: Documentation - Declaration Merging
One example that is especially unique to TypeScript is the concept of ‘declaration merging’. Understanding this concept will give you an advantage when working with existing JavaScript. It also opens the door to more advanced abstraction concepts. For the purposes of this article, ...
🌐
Stack Overflow
stackoverflow.com › questions › 62714020 › how-to-merge-two-object-typescript
How to merge two object TypeScript?
let a = [{ id: 1, selected: false, key: 'plan' }]; let b = [ { id: 1, selected: true, key: 'plan', text: 'aaaa' }, { id: 2, selected: true }, ]; const mergeArrays = (array1, array2) => { array2 = array2 || []; array1 = array1 || []; return Object.values([...array1, ...array2].reduce((result, obj) => { result = { ...result, [obj.id]: {...obj} } return result; }, {})) }; //Consider you got the response from server //a -> Original array, b -> Response from serer console.log(mergeArrays(a, b)) //Response from server is null or [] console.log(mergeArrays(a, null)) //original array is empty but there's a response from server console.log(mergeArrays([], b)) //Consider there is completely a different object in the array received from the server than the one defined in the original array let c = [{ id: 2, selected: true, key: 'plan' }]; console.log(mergeArrays(a, c))
🌐
Webdevtutor
webdevtutor.net › blog › typescript-merge-array-of-objects-by-key
How to Merge Arrays of Objects by Key in TypeScript
One way to merge arrays of objects by key in TypeScript is by using the reduce and map functions. Here's a sample code snippet demonstrating this approach: function mergeArraysByKey(arr1: any[], arr2: any[], key: string): any[] { const merged = arr1.reduce((acc, obj) => { const existing = ...
🌐
GitHub
gist.github.com › michalczukm › bc4d7c5e778793c10fe02ee48af45f68
How to type safe merge objects which identical types in TypeScript · GitHub
How to type safe merge objects which identical types in TypeScript · Raw · merge-objects-with-same-shape.ts · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.