This might just be wishful thinking:
I have a module foo that uses the Parameters<> from a different mod bar, and passes it out of the current mod (foo). So now if some new mod baz requires foo, it has to Also install the @types for the mod that foo is using: bar in order to figure out the Parameters<> Type. This feels like a common situation, and I was hoping there was a way to handle it that didn't involve forcing baz to need all the declarations from bar, like a way that the extracted types compiled into foo's declaration maybe. Greatly appreciate any guidance!
module bar index.ts:
export function doSomething(param: any) { }
module foo index.ts:
import { doSomething } from "bar"
export function DoAnotherThing(param: Parameters<typeof doSomething>[0]) {
doSomething(param)
}
module baz index.ts
import { doAnotherThing } from "foo"
// if @types/bar isn't also installed:
// Type 'unknown' has no matching index signature for type 'number'
doAnotherThing(123)