Beispiel #1
0
 public void WriteLine(WriteCursor writeCursor)
 {
     writeCursor.WriteLine(
         (IsStatic ? "static " : "") +
         Name +
         "(" +
         string.Join(", ", Parameters.Select(x => x.Name + ": " + x.Type.FullName)) + ")" +
         (Return == null ? "" : ": " + Return.FullName)
         +";");
 }
Beispiel #2
0
        public override void Write(WriteCursor writeCursor)
        {
            var export = Parent.Name == string.Empty ? "export declare " : "";

            writeCursor.StartBlock(export + "enum " + Name);

            foreach (var value in Values)
            {
                writeCursor.WriteLine(value.Name + " = " + value.Value + ",");
            }

            writeCursor.EndBlock();
        }
Beispiel #3
0
 public override void Write(WriteCursor writeCursor)
 {
     ArrayType.Write(writeCursor);
     writeCursor.Write("[]");
 }
Beispiel #4
0
        public override void Write(WriteCursor writeCursor)
        {
            if (ReferenceOnly)
                return;

            if (Name != string.Empty)
            {
                writeCursor.StartBlock("export" +
                    (writeCursor.IsTopLevel ? " declare" : "") +
                    " module " +
                    Name);
            }

            foreach (var module in Modules)
            {
                module.Write(writeCursor);
            }

            foreach (var tsType in Types)
            {
                tsType.Write(writeCursor);
            }

            if (Name != string.Empty)
            {
                writeCursor.EndBlock();
            }
        }
Beispiel #5
0
 public abstract void Write(WriteCursor writeCursor);
Beispiel #6
0
 public override void Write(WriteCursor writeCursor)
 {
     writeCursor.Write(Name);
 }
Beispiel #7
0
 public static void Write(StreamWriter streamWriter, TypeScript.Module module)
 {
     var writeCursor = new WriteCursor(streamWriter);
     module.Write(writeCursor);
 }
Beispiel #8
0
 public void WriteLine(WriteCursor writeCursor)
 {
     writeCursor.WriteLine(Name + ": " + TsType.FullName + ";");
 }
Beispiel #9
0
 public new void WriteLine(WriteCursor writeCursor)
 {
     writeCursor.WriteLine("constructor (" + string.Join(", ", Parameters.Select(x => x.Name + ": " + x.Type.FullName)) + ");");
 }
Beispiel #10
0
 public override void Write(WriteCursor writeCursor)
 {
     writeCursor.WriteLine("undefined");
 }