Relative Content

Tag Archive for typescripttypescript-genericstypescript-types

How to extend narrow type inference to every property of an object?

Suppose a “dependent function” (type DepFunc) is a simple object with property deps whose value is an arbitrary simple object (the keys of which are the “dependencies”), and a property build whose value is a function that takes an object with the same keys as deps and returns a function from number to number; OR a dependent function could be just a function from number to number in the trivial case of no dependencies. This type seems well captured by