Tsonic.Runtime
0.0.2
dotnet add package Tsonic.Runtime --version 0.0.2
NuGet\Install-Package Tsonic.Runtime -Version 0.0.2
<PackageReference Include="Tsonic.Runtime" Version="0.0.2" />
<PackageVersion Include="Tsonic.Runtime" Version="0.0.2" />
<PackageReference Include="Tsonic.Runtime" />
paket add Tsonic.Runtime --version 0.0.2
#r "nuget: Tsonic.Runtime, 0.0.2"
#:package Tsonic.Runtime@0.0.2
#addin nuget:?package=Tsonic.Runtime&version=0.0.2
#tool nuget:?package=Tsonic.Runtime&version=0.0.2
Tsonic.Runtime
TypeScript language runtime primitives for the Tsonic compiler - provides Union types, structural typing, and other TypeScript language features in C#.
Overview
Tsonic.Runtime contains mode-independent TypeScript language primitives that are used in all Tsonic compilation modes. This library provides:
- Union Types -
Union<T1, T2, ...>for TypeScript unions likestring | number - Structural Typing -
Structural.Clone<T>()andDictionaryAdapter<T>for duck typing - Dynamic Objects -
DynamicObjectfor TypeScript'skeyofand indexed access patterns - Operators -
typeofandinstanceofoperator support
When to Use
This library is referenced by all Tsonic projects, regardless of mode:
mode = "dotnet"(default) - Uses onlyTsonic.Runtimemode = "js"- Uses bothTsonic.RuntimeandTsonic.JSRuntime
What's NOT Here
JavaScript built-in semantics are in a separate package (Tsonic.JSRuntime):
- Array methods (push, pop, map, filter, etc.)
- String methods (toUpperCase, slice, includes, etc.)
- Math, console, JSON, global functions
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 | Versions 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. |
-
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.