// docs / type-mappings

Type Mappings

How TypeSharp maps C# primitives, collections, and special types to their TypeScript equivalents.

Primitives & common types

C#TypeScript
boolboolean
byte / decimal / double / float / int / longnumber
string / Guidstring
DateTime / DateTimeOffset / DateOnly / TimeOnlystring
object / dynamicany
voidvoid
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 / FormFileFile
IFormFileCollectionFile[]
FileStream / MemoryStream / StreamBlob

Notes

  • DateTime maps to string — serialized as ISO 8601 by ASP.NET Core.
  • Property names are camelCased by default. Configure via typesharp.config.ts.