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
typeNamestringTypeScript type name
prefixIfStringstringPrefix to add for string ___types
nameArgMethodstringArgument 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
Returns
Type(string)
Gets mapped type name or returns original if not mapped
public static string Type(string typeName)
Parameters
typeNamestringType name to lookup
Returns
- string
Mapped type name or original