Type Function is not a function constructor type though Typescript version is above 4.7

Viewed 17
1 Answers

The function needs a construct signature for you to extend it:

const addFuelToRocket = (target: { new(...args: any[]): any }) => {
  return class extends target {
    fuel = 100
  }
};

Playground

Related