You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript types are erased before your code is run. You can't access them at runtime without additional tooling.
Know your options for runtime types: using a distinct runtime type system (such as Zod), generating TypeScript types from values (json-schema-to-typescript), and generating values from your TypeScript types (typescript-json-schema).
If you have another specification for your types (e.g., a schema), use that as the source of truth.
If you need to reference external TypeScript types, use typescript-json-schema or an equivalent.
Otherwise, weigh whether you prefer another build step or another system for specifying types.