@tsonic/aspnetcore
v10.0.40
Published
TypeScript type definitions for Microsoft.AspNetCore.App shared framework for .NET 10
Maintainers
Readme
@tsonic/aspnetcore
TypeScript type definitions for the Microsoft.AspNetCore.App shared framework for .NET 10.
Generated by tsbindgen from the installed .NET shared framework and intended for use with the Tsonic compiler (TypeScript → .NET).
What this package is (and isn’t)
- ✅ TypeScript bindings (
.d.ts) for ASP.NET Core APIs (Minimal APIs, Http abstractions, hosting, etc.). - ❌ Not a JavaScript runtime implementation (the
.jsfiles are module stubs for type-only use). - ✅ The real assemblies come from your installed .NET shared framework (
Microsoft.AspNetCore.App).
Install (types)
npm install @tsonic/aspnetcore @tsonic/dotnet @tsonic/coreUse with Tsonic (recommended)
Add the framework reference in your workspace and (optionally) use this package as the published bindings:
tsonic add framework Microsoft.AspNetCore.App @tsonic/aspnetcoreIf you omit the @tsonic/aspnetcore argument, Tsonic will generate bindings locally instead.
Imports
Import namespaces via explicit module paths:
import { WebApplication } from "@tsonic/aspnetcore/Microsoft.AspNetCore.Builder.js";
import { HttpContext } from "@tsonic/aspnetcore/Microsoft.AspNetCore.Http.js";Example (Minimal API)
import { WebApplication } from "@tsonic/aspnetcore/Microsoft.AspNetCore.Builder.js";
import type { ExtensionMethods } from "@tsonic/aspnetcore/Microsoft.AspNetCore.Builder.js";
export function main(): void {
const builder = WebApplication.CreateBuilder();
const app = builder.Build() as ExtensionMethods<WebApplication>;
app.MapGet("/", () => "hello");
app.Run("http://localhost:8080");
}Versioning
This repo is versioned by .NET major:
- .NET 10 → npm:
@tsonic/[email protected]
License
MIT
