dsherret / ts-morph

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
https://ts-morph.com
MIT License
5.01k stars 195 forks source link

properties from type inference #1492

Open mshkpchv opened 9 months ago

mshkpchv commented 9 months ago

I am creating using 'zod' for validation and type creation.

const accSchema = z.object({
  companyName: z.string(),
  email: z.string().email(),
  demo: z.boolean(),
});

export type IAccountUpdatedPayload = z.infer<typeof accSchema >;

using ts-morph, I want to retrieve the properties for IAccountUpdatedPayload, but it does not return any. I get the TypeAliasDeclaration, but I could not retrieve any valuable information from it

SharkEzz commented 6 months ago

It would be useful, does anyone know something about this ?