A lib I'm using exports a function with generic types, but not the type itself, something like this,
// some-lib/index.d.ts
export function libFunction<T>(): InternalLibType<T>;
I'd like to declare a variable of type
const foo: InternalLibType<"something">;
I'm trying to construct the desired type for foo using ReturnType<typeof libFunction> as a starting point, but don't really know how to continue from here.
How can I create a concrete type from the generic type? To be clear, the lib does not export InternalLibType.
The library in question is use-debounce. While it does technically export the type from one of its files, the exported type is not in a file declared in the exports field, thus causing errors with some tools that respect the exports field.