@tsonic/microsoft-extensions
v10.0.45
Published
TypeScript type definitions for Microsoft.Extensions.* (Hosting/DI/Logging/Configuration/Options) for .NET 10
Downloads
529
Maintainers
Readme
@tsonic/microsoft-extensions
TypeScript declarations and CLR binding metadata for the .NET 10
Microsoft.Extensions.* stack.
This generated package covers dependency injection, hosting, logging, configuration, options, file providers, primitives, and related extension assemblies. Tsonic uses it as the type and metadata package for real CLR assemblies supplied by a framework reference or NuGet package.
Install
npm install @tsonic/microsoft-extensions @tsonic/dotnet @tsonic/coreUse with Tsonic
Shared framework
tsonic add framework Microsoft.AspNetCore.App @tsonic/microsoft-extensions
tsonic restoreNuGet packages
Add the specific extension packages you use and bind them to this type package:
tsonic add nuget Microsoft.Extensions.DependencyInjection <version> @tsonic/microsoft-extensions
tsonic add nuget Microsoft.Extensions.Logging <version> @tsonic/microsoft-extensions
tsonic restoreImports
Import namespace facades through explicit ESM subpaths:
import { ServiceCollection } from "@tsonic/microsoft-extensions/Microsoft.Extensions.DependencyInjection.js";Example (DI)
import { ServiceCollection } from "@tsonic/microsoft-extensions/Microsoft.Extensions.DependencyInjection.js";
export function main(): void {
const services = new ServiceCollection();
void services;
}Package shape
The package contains generated namespace facades, ESM stubs, internal
declarations, extension buckets, and bindings.json compiler metadata:
@tsonic/microsoft-extensions/
Microsoft.Extensions.DependencyInjection.d.ts
Microsoft.Extensions.DependencyInjection.js
Microsoft.Extensions.DependencyInjection/
bindings.json
internal/index.d.ts
__internal/extensions/index.d.tsThe bindings.json files preserve CLR identity, overloads, receiver semantics,
extension methods, nullable/reference metadata, and generic constraints.
Broad CLR values
Generated CLR object slots are represented with TypeScript unknown, not a
package-specific catch-all value. Dependency injection, configuration, logging,
and options APIs frequently expose broad CLR values; user code narrows those
values explicitly before member access. Value-type constraints are represented
with NonNullable<unknown>.
Versioning
This repo is versioned by .NET major:
- .NET 10 → npm:
@tsonic/[email protected]
Development
Regenerate from sibling checkouts:
npm install
./__build/scripts/generate.shThe generation script requires .NET 10, ../tsbindgen, and ../dotnet.
License
MIT
