
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@fluffy-spoon/csharp-to-typescript-generator
Advanced tools
A flexible CSharp to TypeScript generator that is Gulp, Webpack and Grunt friendly, written in TypeScript.
A flexible CSharp to TypeScript generator that is Gulp
, Webpack
and Grunt
friendly, written in TypeScript.
Uses the following library for parsing C# code from TypeScript: https://github.com/ffMathy/FluffySpoon.JavaScript.CSharpParser
To see all available settings, look at the configuration options here.
These recipes help you quickly get started with common scenarios you may need. Feel free to contribute with your own!
The following code shows general usage. The examples below only differ in the EmitOptions
provided.
import { Emitter } from '@fluffy-spoon/csharp-to-typescript-generator';
var csharpCode = "insert the CSharp model code here - you could also read it from a file.";
var emitter = new Emitter(csharpCode);
var options = <EmitOptions>{
defaults: <DefaultEmitOptions>{ },
file: <FileEmitOptions>{ }
};
var typescriptCode = emitter.emitFile(options);
CSharpType
, look here: https://github.com/ffMathy/FluffySpoon.JavaScript.CSharpParser/blob/master/dist/src/Models.tsFileEmitOptions
, look here: https://github.com/ffMathy/FluffySpoon.JavaScript.CSharpToTypeScriptGenerator/blob/master/dist/src/Index.d.tsvar typescriptCode = emitter.emit();
Given the following CSharp model code:
namespace MyNamespace {
public class MyClass {
public bool myField;
public int MyProperty { get; set; }
public string MyOtherProperty { get; set; }
public double? MyNullableProperty { get; set; }
public class MySubclass {
public List<string> MyListProperty { get; set; }
public MyGenericType<SomeType, SomeOtherType> MyGenericProperty { get; set; }
public Task MyFunction(string input1, int input2) {
//some code
}
}
}
}
The following TypeScript code would be generated:
declare namespace MyNamespace {
interface MyClass {
myField: boolean;
myProperty: number;
myOtherProperty: string;
myNullableProperty?: number;
}
namespace MyClass {
interface MySubclass {
myListProperty: string[];
myGenericProperty: MyGenericType<SomeType, SomeOtherType>;
MyFunction(input1: string, input2: number): Promise;
}
}
}
But this framework is flexible! Look at the recipes to get inspiration, or the other configurations available.
To see pre-made examples designed for frameworks like Angular and ASP .NET Core (for instance for auto-generating HTTP clients for each controller action), go see the framework recipes here.
To see all other examples for common use cases, go see the other recipes here.
FAQs
A flexible CSharp to TypeScript generator that is Gulp, Webpack and Grunt friendly, written in TypeScript.
We found that @fluffy-spoon/csharp-to-typescript-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.