More flexible TsMemberTypeFormatter

Issue #58 resolved
Christian Eldam
created an issue

Currently it only receives the memberTypeName (string) and isMemberCollection (bool).

Right now I format every single type as KnockoutObservable or -Collection with a custom MemberTypeFormatter. I would like the possibility to check the property for a custom attribute, so for instance, that I can disable the knockout-formatting based on an attribute.

Comments (2)

  1. Stanley Goldman


    Check this

    With a custom script generator and my changes I was able to turn this enum

        [TsEnum(Module = "Enums")]
        public enum ExanpleEnum
            [Description("Choice One")]
            [Description("Choice Two")]

    Into this AMD Enum implementation.

    module Enums {
        export module ExanpleEnum {
            export enum Enum {
                ChoiceOne = 0,
                ChoiceTwo = 2
            export function describe (enumValue: Enum) {
                switch (enumValue) {
                    case Enum.ChoiceOne:
                        return "Choice One";
                    case Enum.ChoiceTwo:
                        return "Choice Two";
                        throw Error("Unknown Enum Value");
    export = Enums;
  2. Log in to comment