public override void WriteTypescript(TsOutputer outputter)
 {
     base.GetTypescriptComment(outputter);
     outputter.AppendLine("declare namespace " + DisplayText + " {");
     outputter.IncreaseIndent();
     base.WriteTypescript(outputter);
     outputter.DecreaseIndent();
     outputter.AppendLine("}");
     outputter.OutputBuilder.AppendLine();
 }
        public override void WriteTypescript(TsOutputer outputter)
        {
            if (Children.Count > 0 || IsReferenced)
            {
                base.GetTypescriptComment(outputter);

                outputter.AppendLine("interface " + DisplayText + GetInterfaceExtensionString() + " {");
                outputter.IncreaseIndent();
                base.WriteTypescript(outputter);
                outputter.DecreaseIndent();
                outputter.AppendLine("}");
                outputter.OutputBuilder.AppendLine();
            }
        }
Beispiel #3
0
        public override void WriteTypescript(TsOutputer outputter)
        {
            base.GetTypescriptComment(outputter);
            // TODO: const?
            outputter.AppendLine("enum " + DisplayText + " {");
            outputter.IncreaseIndent();
            base.WriteTypescript(outputter);
            // remove last comma
            int index = outputter.OutputBuilder.Length - 1;

            while (char.IsWhiteSpace(outputter.OutputBuilder[index]))
            {
                index--;
            }
            if (outputter.OutputBuilder[index] == ',')
            {
                outputter.OutputBuilder.Remove(index, 1);
            }

            outputter.DecreaseIndent();
            outputter.AppendLine("}");
        }