{"id":27268758,"url":"https://github.com/dogusteknoloji/cs-to-ts","last_synced_at":"2025-08-10T21:03:41.204Z","repository":{"id":47843386,"uuid":"120874122","full_name":"DogusTeknoloji/cs-to-ts","owner":"DogusTeknoloji","description":":factory: From C# to TypeScript.","archived":false,"fork":false,"pushed_at":"2023-01-20T21:44:27.000Z","size":119,"stargazers_count":62,"open_issues_count":2,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-31T19:32:37.608Z","etag":null,"topics":["csharp","generator","typescript"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DogusTeknoloji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-09T07:44:52.000Z","updated_at":"2025-06-14T02:18:28.000Z","dependencies_parsed_at":"2023-02-12T05:30:41.926Z","dependency_job_id":null,"html_url":"https://github.com/DogusTeknoloji/cs-to-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DogusTeknoloji/cs-to-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2Fcs-to-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2Fcs-to-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2Fcs-to-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2Fcs-to-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DogusTeknoloji","download_url":"https://codeload.github.com/DogusTeknoloji/cs-to-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2Fcs-to-ts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269787312,"owners_count":24475714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","generator","typescript"],"created_at":"2025-04-11T11:32:00.088Z","updated_at":"2025-08-10T21:03:41.171Z","avatar_url":"https://github.com/DogusTeknoloji.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cs-to-ts\n\n[![Build status](https://ci.appveyor.com/api/projects/status/mt39lws6eo92tys6?svg=true)](https://ci.appveyor.com/project/DogusTeknoloji/cs-to-ts)\n[![Coverage Status](https://coveralls.io/repos/github/DogusTeknoloji/cs-to-ts/badge.svg?branch=master)](https://coveralls.io/github/DogusTeknoloji/cs-to-ts?branch=master)\n[![NuGet Badge](https://buildstats.info/nuget/CsToTs)](https://www.nuget.org/packages/CsToTs/)\n[![GitHub issues](https://img.shields.io/github/issues/DogusTeknoloji/cs-to-ts.svg)](https://github.com/DogusTeknoloji/cs-to-ts/issues)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DogusTeknoloji/cs-to-ts/master/LICENSE)\n\n[![GitHub stars](https://img.shields.io/github/stars/DogusTeknoloji/cs-to-ts.svg?style=social\u0026label=Star)](https://github.com/DogusTeknoloji/cs-to-ts)\n[![GitHub forks](https://img.shields.io/github/forks/DogusTeknoloji/cs-to-ts.svg?style=social\u0026label=Fork)](https://github.com/DogusTeknoloji/cs-to-ts)\n\nFrom C# to TypeScript.\n\n```CSharp\npublic class Company\u003cTAddress\u003e: BaseEntity\u003cint\u003e where TAddress: Address, new() {\n    public string Name { get; set; }\n    public int EmployeeCount { get; set; }\n    public decimal Income;\n    public IList\u003cTAddress\u003e Address { get; set; }\n}\n\nvar typeScript = CsToTs.Generator.GenerateTypeScript(typeof(Company\u003c\u003e));\n\n```\n\nGenerates below TypeScript;\n\n```TypeScript\nexport interface IBase\u003cT\u003e {\n    Id: T;\n}\n    \nexport abstract class BaseEntity\u003cTKey\u003e implements IBase\u003cTKey\u003e {\n    UpdateUser: string;\n    Type: TypeEnum;\n    Id: TKey;\n    CreateUser: string;\n    CreateDate: string;\n    UpdateDate: string;\n    IsActive: boolean;\n    InternalType: any;\n}\n    \nexport class Address extends BaseEntity\u003cnumber\u003e implements IBase\u003cnumber\u003e {\n    PostalCode: number;\n    CompanyId: number;\n    City: string;\n    Detail: string;\n}\n    \nexport class Company\u003cTAddress extends Address\u003e extends BaseEntity\u003cnumber\u003e {\n    Income: number;\n    Name: string;\n    EmployeeCount: number;\n    Address: Array\u003cTAddress\u003e;\n}\n\nexport enum TypeEnum {\n    Type1 = 2,\n    Type2 = 5,\n}\n```\n\nYou can generate interfaces for classes.\n\n```CSharp\nvar options = new TypeScriptOptions {\n    UseInterfaceForClasses = true,\n};\n\nvar typeScript = Generator.GenerateTypeScript(typeof(Company\u003c\u003e), options);\n```\n\nGenerates below TypeScript;\n\n```TypeScript\nexport interface IBase\u003cT\u003e {\n    Id: T;\n}\n    \nexport interface BaseEntity\u003cTKey\u003e extends IBase\u003cTKey\u003e {\n    UpdateUser: string;\n    Type: TypeEnum;\n    Id: TKey;\n    CreateUser: string;\n    CreateDate: string;\n    UpdateDate: string;\n    IsActive: boolean;\n    InternalType: any;\n}\n    \nexport interface Address extends BaseEntity\u003cnumber\u003e {\n    PostalCode: number;\n    CompanyId: number;\n    City: string;\n    Detail: string;\n}\n    \nexport interface Company\u003cTAddress extends Address\u003e extends BaseEntity\u003cnumber\u003e {\n    Income: number;\n    Name: string;\n    EmployeeCount: number;\n    Address: Array\u003cTAddress\u003e;\n}\n\nexport enum TypeEnum {\n    Type1 = 2,\n    Type2 = 5,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogusteknoloji%2Fcs-to-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogusteknoloji%2Fcs-to-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogusteknoloji%2Fcs-to-ts/lists"}