Tsonic.Runtime 0.0.6

dotnet add package Tsonic.Runtime --version 0.0.6
                    
NuGet\Install-Package Tsonic.Runtime -Version 0.0.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tsonic.Runtime" Version="0.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tsonic.Runtime" Version="0.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Tsonic.Runtime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tsonic.Runtime --version 0.0.6
                    
#r "nuget: Tsonic.Runtime, 0.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tsonic.Runtime@0.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tsonic.Runtime&version=0.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Tsonic.Runtime&version=0.0.6
                    
Install as a Cake Tool

Tsonic.Runtime

TypeScript language runtime primitives for the Tsonic compiler.

Overview

Tsonic.Runtime contains mode-independent primitives used by Tsonic-generated C# in CLR, JavaScript-surface, Node-style, and ASP.NET Core projects.

The runtime provides:

  • Union carriers - Union<T1, T2, ...> for TypeScript unions like string | number
  • Structural carriers - Structural.Clone<T>(), Structural.CloneFromDictionary<T>(), and DictionaryAdapter<T> for closed generated structural conversion
  • Dynamic object carrier - DynamicObject for compiler-owned indexed access and dictionary-shaped projections
  • Operator helpers - deterministic typeof and instanceof support
  • JSON helpers - JSON.parse<T>() and JSON.stringify(...) for generated code paths that use closed structural metadata

When to Use

This library is referenced by all Tsonic projects.

  • CLR/default-surface projects use Tsonic.Runtime
  • First-party source surfaces such as @tsonic/js, @tsonic/nodejs, and @tsonic/express also use Tsonic.Runtime

What's NOT Here

JavaScript and Node surface behavior is authored in first-party TypeScript source packages, not in separate CLR runtime packages:

  • Array methods (push, pop, map, filter, etc.)
  • String methods (toUpperCase, slice, includes, etc.)
  • Math, console, JS-surface JSON, and other global functions

Tsonic.Runtime owns the compiler runtime carriers. It does not define the user-facing @tsonic/js or @tsonic/nodejs API surface. The public JS and Node APIs live in their first-party source packages and compile down to deterministic runtime calls where needed.

Building

dotnet build

Testing

dotnet test

NativeAOT Compatibility

This library is fully compatible with .NET NativeAOT, enabling TypeScript code to be compiled to native executables.

Package

Published as Tsonic.Runtime on NuGet.

License

MIT License - see LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Tsonic.Runtime:

Package Downloads
Tsonic.JSRuntime

JavaScript/TypeScript runtime implementation for Tsonic compiler - provides exact JavaScript semantics in C#

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.6 48 6/1/2026
0.0.5 95 5/15/2026
0.0.4 100 4/27/2026
0.0.3 189 3/13/2026
0.0.2 193 2/15/2026
0.0.1 127 2/13/2026