Beispiel #1
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 #2
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();
            }
        }