Table of Contents

Class TypeScriptHelper

Namespace
SunamoDevCode.Helpers
Assembly
SunamoDevCode.dll

Helper class for TypeScript code generation and type handling

public class TypeScriptHelper
Inheritance
TypeScriptHelper
Inherited Members
Extension Methods

Methods

DefaultValueForType(string, string, string)

Gets default value for TypeScript type

public static string DefaultValueForType(string typeName, string prefixIfString = "", string nameArgMethod = "")

Parameters

typeName string

TypeScript type name

prefixIfString string

Prefix to add for string ___types

nameArgMethod string

Argument method name to append

Returns

string

Default value as string

GetNamesAndTypes(List<string>)

Splits property declarations into names and ___types Do not use for interfaces unless explicitly allowed to have optional (?) modifiers

public static Tuple<List<string>, List<string>> GetNamesAndTypes(List<string> list)

Parameters

list List<string>

List of property declarations

Returns

Tuple<List<string>, List<string>>

Tuple of (names list, ___types list)

Type(string)

Gets mapped type name or returns original if not mapped

public static string Type(string typeName)

Parameters

typeName string

Type name to lookup

Returns

string

Mapped type name or original