TypeScript types
Generate declarations for page props, shared props and flash data from your .NET contracts.
Inertia.Net can write TypeScript declarations for typed page props, shared props and flash data. They follow the app's JSON contracts (the HTTP JSON options and their source-generated contexts), so names, nullability and enum values match the page JSON.
Configure generation
The file is written when the app starts in Development, and only when its content changed. Commit it so tsc passes in CI without running the app.
Shared props
Shared props are inferred from the values passed to o.Share(...); dot keys nest. Factories and per-request shares are typed as unknown. o.TypeScript.SharedProps<T>() replaces the inference with an explicit type. The InertiaConfig augmentation types usePage().props and flash.
Prop members
An InertiaProp member is optional (it can be deferred, optional or rescued) and unknown, unless [InertiaPropType(typeof(T))] names its value type.
Mapping
Types missing from the JSON metadata (under Native AOT, register them in your context) are unknown, with a warning in the log.
Number handling follows member settings, then type settings, then the global JSON options. Custom converter output is typed as unknown with a warning when its shape cannot be inferred.
Validation and JSON names
Props and MVC validation error keys use the HTTP JsonOptions. FastEndpoints error keys use its binding serializer policy. Keep client field names aligned with the applicable policy; custom resolvers without member metadata may require client JSON names for aliases.