// docs / type-mappings
Type Mappings
How TypeSharp maps C# primitives, collections, and special types to their TypeScript equivalents.
Primitives & common types
| C# | TypeScript |
|---|
| bool | boolean |
| byte / decimal / double / float / int / long | number |
| string / Guid | string |
| DateTime / DateTimeOffset / DateOnly / TimeOnly | string |
| object / dynamic | any |
| void | void |
| T? | T | null |
Collections
| C# | TypeScript |
|---|
| T[] / List<T> / IList<T> / IEnumerable<T> / ICollection<T> / HashSet<T> / ISet<T> | T[] |
| IReadOnlyList<T> | readonly T[] |
| Dictionary<K,V> / IDictionary<K,V> / IReadOnlyDictionary<K,V> | Record<K, V> |
| Tuple<T1, T2> | [T1, T2] |
ASP.NET / file types
| C# | TypeScript |
|---|
| IFormFile / FormFile | File |
| IFormFileCollection | File[] |
| FileStream / MemoryStream / Stream | Blob |
Notes
DateTime maps to string — serialized as ISO 8601 by ASP.NET Core. - Property names are camelCased by default. Configure via
typesharp.config.ts.