All Projects → DogusTeknoloji → cs-to-ts

DogusTeknoloji / cs-to-ts

Licence: MIT License
🏭 From C# to TypeScript.

Programming Languages

C#
18002 projects
Handlebars
879 projects

Labels

Projects that are alternatives of or similar to cs-to-ts

spring-boot-project-builder
快速构建Spring Boot项目
Stars: ✭ 20 (-56.52%)
Mutual labels:  generator
prisma-tgql-types-gen
◭ Prisma generator for generating TypeGraphQL class types and enums with allowing to edit the generated output without being overwritten 💪
Stars: ✭ 32 (-30.43%)
Mutual labels:  generator
nest-js-boilerplate
Nest.js boilerplate
Stars: ✭ 79 (+71.74%)
Mutual labels:  generator
nomnoml-cli
Generates images from nomnoml diagram sources in a NodeJS module or on the command line
Stars: ✭ 20 (-56.52%)
Mutual labels:  generator
FigmaConvertXib
FigmaConvertXib is a tool for exporting design elements from figma.com and generating files to a projects iOS .xib / Android .xml
Stars: ✭ 111 (+141.3%)
Mutual labels:  generator
wsdl-tsclient
📄 Generate typescript client from wsdl
Stars: ✭ 30 (-34.78%)
Mutual labels:  generator
gen
Gen: Friendly & Safer GORM powered by Code Generation
Stars: ✭ 677 (+1371.74%)
Mutual labels:  generator
built bloc
Generate the BLoC pattern boilerplate.
Stars: ✭ 51 (+10.87%)
Mutual labels:  generator
DataAnalyzer.app
✨🚀 DataAnalyzer.app - Convert JSON/CSV to Typed Data Interfaces - Automatically!
Stars: ✭ 23 (-50%)
Mutual labels:  generator
ffmpeg-commander
🛠️ FFmpeg Command Generator Web UI
Stars: ✭ 136 (+195.65%)
Mutual labels:  generator
avro-schema-generator
Library for generating avro schema files (.avsc) based on DB tables structure
Stars: ✭ 38 (-17.39%)
Mutual labels:  generator
email-template-builder
let this service generate your custom html/text emails
Stars: ✭ 25 (-45.65%)
Mutual labels:  generator
humans-generator
Humans.txt generator for Node.js
Stars: ✭ 20 (-56.52%)
Mutual labels:  generator
iteration utilities
Utilities based on Pythons iterators and generators.
Stars: ✭ 65 (+41.3%)
Mutual labels:  generator
docgen
The docs.json generator for discord.js and its related projects
Stars: ✭ 59 (+28.26%)
Mutual labels:  generator
maze-generator
A real-time JavaScript maze generator using the depth-first search algorithm
Stars: ✭ 13 (-71.74%)
Mutual labels:  generator
NFT Art Generator
No description or website provided.
Stars: ✭ 58 (+26.09%)
Mutual labels:  generator
kumiko
A kumiko pattern generator, based on any image
Stars: ✭ 42 (-8.7%)
Mutual labels:  generator
lowcode
React Lowcode - prototype, develop and maintain internal apps easier
Stars: ✭ 32 (-30.43%)
Mutual labels:  generator
IntuneDriveMapping
Generate PowerShell scripts to map network drives on Intune managed Windows 10 devices
Stars: ✭ 51 (+10.87%)
Mutual labels:  generator

cs-to-ts

Build status Coverage Status NuGet Badge GitHub issues GitHub license

GitHub stars GitHub forks

From C# to TypeScript.

public class Company<TAddress>: BaseEntity<int> where TAddress: Address, new() {
    public string Name { get; set; }
    public int EmployeeCount { get; set; }
    public decimal Income;
    public IList<TAddress> Address { get; set; }
}

var typeScript = CsToTs.Generator.GenerateTypeScript(typeof(Company<>));

Generates below TypeScript;

export interface IBase<T> {
    Id: T;
}
    
export abstract class BaseEntity<TKey> implements IBase<TKey> {
    UpdateUser: string;
    Type: TypeEnum;
    Id: TKey;
    CreateUser: string;
    CreateDate: string;
    UpdateDate: string;
    IsActive: boolean;
    InternalType: any;
}
    
export class Address extends BaseEntity<number> implements IBase<number> {
    PostalCode: number;
    CompanyId: number;
    City: string;
    Detail: string;
}
    
export class Company<TAddress extends Address> extends BaseEntity<number> {
    Income: number;
    Name: string;
    EmployeeCount: number;
    Address: Array<TAddress>;
}

export enum TypeEnum {
    Type1 = 2,
    Type2 = 5,
}

You can generate interfaces for classes.

var options = new TypeScriptOptions {
    UseInterfaceForClasses = true,
};

var typeScript = Generator.GenerateTypeScript(typeof(Company<>), options);

Generates below TypeScript;

export interface IBase<T> {
    Id: T;
}
    
export interface BaseEntity<TKey> extends IBase<TKey> {
    UpdateUser: string;
    Type: TypeEnum;
    Id: TKey;
    CreateUser: string;
    CreateDate: string;
    UpdateDate: string;
    IsActive: boolean;
    InternalType: any;
}
    
export interface Address extends BaseEntity<number> {
    PostalCode: number;
    CompanyId: number;
    City: string;
    Detail: string;
}
    
export interface Company<TAddress extends Address> extends BaseEntity<number> {
    Income: number;
    Name: string;
    EmployeeCount: number;
    Address: Array<TAddress>;
}

export enum TypeEnum {
    Type1 = 2,
    Type2 = 5,
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].