/// <summary> /// Formats a type /// </summary> /// <param name="tsType">The type</param> /// <returns>The string representation of the type</returns> public virtual string Format(TsType tsType) { if (tsType is TsGenericType) { return(Format((TsGenericType)tsType)); } var tsInterface = tsType as TsInterface; if (tsInterface != null && tsInterface.IsLiteral) { return(Format(tsInterface)); } return(tsType.Name.FullName); }
/// <summary> /// Constructor /// </summary> /// <param name="name">The interface name</param> public TsProperty(TsName name, TsType type) : base(name) { this.Type = type; this.Optional = this.Type.IsNullable; }
public virtual string FormatReturnType(TsType tsReturnType) { return Format(tsReturnType); }
public virtual string Format(TsType tsType) { if (tsType is TsGenericType) return Format((TsGenericType)tsType); return tsType.ToString(); }
/// <summary> /// Formats a return type /// </summary> /// <param name="tsReturnType">The return type</param> /// <returns>The string representation of the return type</returns> public virtual string FormatReturnType(TsType tsReturnType) { return(Format(tsReturnType)); }
public TsArray(TsType elementType, int dimensions) : base(new TsName(elementType.Name.Name + GenerateArrayNotation(dimensions), elementType.Name.Namespace)) { }
/// <summary> /// Constructor /// </summary> /// <param name="elementType">The element type</param> /// <param name="dimensions">The dimensions</param> public TsArray(TsType elementType, int dimensions) : base(new TsName(elementType.Name.Name + GenerateArrayNotation(dimensions), elementType.Name.Namespace)) { }
/// <summary> /// Constructor /// </summary> /// <param name="name">The parameter name</param> public TsParameter(TsName name, TsType type, bool IsOptional = false) : base(name) { this.Type = type; this.Optional = IsOptional; }
/// <summary> /// Constructor /// </summary> /// <param name="name">The interface name</param> /// <param name="type">The type name</param> /// <param name="optional">Indicates optional property</param> public TsProperty(TsName name, TsType type, bool optional = false) : base(name) { this.Type = type; this.Optional = optional; }
/// <summary> /// Constructor /// </summary> /// <param name="name">The parameter name</param> /// <param name="type">The parameter type</param> public TsParameter(TsName name, TsType type) : base(name) { this.Type = type; this.Optional = false; }