Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

ffMathy/grunt-typescript-cs-poco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED!

This library has been deprecated in favor of the new, much more stable and flexible: https://github.com/ffMathy/FluffySpoon.JavaScript.CSharpToTypeScriptGenerator.Grunt/

grunt-typescript-cs-poco

Overview

See https://github.com/ffMathy/typescript-cs-poco for actual implementation. This is just a wrapper.

Grunt-typescript-cs-poco is a Grunt plugin that translates basic C# POCO classes like this:

public class MyPoco
{
	public string Name { get; set; }
	public int Id { get; set; }
	public long Value { get; set; }
	public bool IsValid { get; set; }
	public SomeOtherPoco RelatedObject { get; set; }
}

Into this TypeScript file:

interface MyPoco {
	Name: string;
	Id: number;
	Value: number;
	IsValid: boolean;
	RelatedObject: SomeOtherPoco;
}

Installation

Install with NPM:

npm install --save-dev grunt-typescript-cs-poco

Use

module.exports = function(grunt) {

  grunt.initConfig({
    // Generate TypeScript interfaces from C# files in samples/source and put them into samples/result as one .d.ts file for every .cs file.
    typescript_cs_poco: {
      'samples/result': ['samples/source/*.cs'],
      options: {
        //options go here. see https://github.com/ffMathy/typescript-cs-poco for a total list of options.
      }
    }

  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  // By default, lint and run all tests.
  grunt.registerTask('default', ['typescript_cs_poco']);

};

This will create a single .d.ts file for every .cs file it finds.

About

No description, website, or topics provided.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published