BlazorInteropGenerator.SourceGenerator 1.0.0-alpha.8

This is a prerelease version of BlazorInteropGenerator.SourceGenerator.
dotnet add package BlazorInteropGenerator.SourceGenerator --version 1.0.0-alpha.8
                    
NuGet\Install-Package BlazorInteropGenerator.SourceGenerator -Version 1.0.0-alpha.8
                    
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="BlazorInteropGenerator.SourceGenerator" Version="1.0.0-alpha.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorInteropGenerator.SourceGenerator" Version="1.0.0-alpha.8" />
                    
Directory.Packages.props
<PackageReference Include="BlazorInteropGenerator.SourceGenerator" />
                    
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 BlazorInteropGenerator.SourceGenerator --version 1.0.0-alpha.8
                    
#r "nuget: BlazorInteropGenerator.SourceGenerator, 1.0.0-alpha.8"
                    
#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.
#addin nuget:?package=BlazorInteropGenerator.SourceGenerator&version=1.0.0-alpha.8&prerelease
                    
Install BlazorInteropGenerator.SourceGenerator as a Cake Addin
#tool nuget:?package=BlazorInteropGenerator.SourceGenerator&version=1.0.0-alpha.8&prerelease
                    
Install BlazorInteropGenerator.SourceGenerator as a Cake Tool

BlazorInteropGenerator

Nuget Nuget) codecov

What is this?

This project contains code and a Source Generator which can convert a TypeScript Definition to C# Interfaces.

How to use the Source Generator

Create a C# Class Library Project. Add the *.d.ts files that you want converted, also download all the dependencies. File names should be the {PackageName}.d.ts without the Organization/. Update the .csproj with the following settings.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="BlazorInteropGenerator.SourceGenerator" Version="1.0.0-*" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
    <AdditionalFiles Include="*.d.ts" />
  </ItemGroup>

</Project>

Create a .cs file with this format, in this case, the TypeScript Definition must contain an interface called "InterfaceName" The Source Generator will generate the interface and all its dependencies.


using BlazorInteropGenerator;

namespace BlazorInteropGenerator.Sample;

[BlazorInteropGenerator("TSD1.d.ts")]
public partial interface InterfaceName
{

}
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.