Skip to content

Commit

Permalink
Adding the 1.0 build version
Browse files Browse the repository at this point in the history
  • Loading branch information
cskeppstedt committed Nov 16, 2012
1 parent 40a8a9e commit 3d3af4f
Show file tree
Hide file tree
Showing 3 changed files with 593 additions and 211 deletions.
51 changes: 45 additions & 6 deletions build/T4TS.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
namespace T4TS

namespace T4TS
{
using System;
using System.CodeDom;
using System.CodeDom.Compiler;

[GeneratedCode("T4TS", "0.1")]
public class TypeScriptInterfaceAttribute : Attribute
/// <summary>
/// Add this attribute to a class to generate a corresponding TypeScript interface.
/// </summary>
[GeneratedCode("T4TS", "1.0")]
[AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class TypeScriptInterfaceAttribute: Attribute
{
public TypeScriptInterfaceAttribute()
{
}
/// <summary>
/// Specifies which module the interface should be placed.
/// The default module will be used if not specified.
/// </summary>
public string Module { get; set; }

/// <summary>
/// The name of the interface.
/// If not specified, the name of the class will be used.
/// </summary>
public string Name { get; set; }
}

/// <summary>
/// Add this attribute to a property to customize the generated interface member
/// </summary>
[GeneratedCode("T4TS", "1.0")]
[AttributeUsage(AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class TypeScriptMemberAttribute: Attribute
{
/// <summary>
/// The member name in the interface.
/// If not specified, the property name will be used.
/// </summary>
public string Name { get; set; }

/// <summary>
/// Specify if the member should be optional, ie. "name?: type".
/// If not specified, the default value will be used.
/// </summary>
public bool Optional { get; set; }

/// <summary>
/// Specify which type the interface member will have.
/// If not specified, a suitable type will be determined.
/// </summary>
public string Type { get; set; }
}
}
Loading

0 comments on commit 3d3af4f

Please sign in to comment.