When I hover my cursor over a Typescript type in Playground, its type info is displayed correctly. How to get the same type info in .D.TS?
e.g.
type SecondArg<F> = F extends (a: any, b: infer B) => any ? B : never
// Get the type of Array.slice
type F = typeof Array['prototype']['slice']
type A = SecondArg<F> // number | undefined
.D.TS show:
declare type A = SecondArg<F>;
My desired output is:
declare type A = number | undefined;
I tried this, but it does not get the full expanded Typescript type info in .D.TS.
//https://stackoverflow.com/questions/57683303/how-can-i-see-the-full-expanded-contract-of-a-typescript-type
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
type ExpandedA = Expand<A>;