-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
for the class
public foo {
public (int, string) easy {get;set}
public IEnumerable<(int, string)> hard {get;set}
}
which will emit for types using ToTypeScriptType
easy: <number, string>;
hard: <number, string>[];
I know this is kind of a weird case because I don't know that there is a type for ValueTuple to map to, and we got around this by supplying our own type(s)
export interface ValueTuple<TOne, TTwo> {
item1: TOne,
item2: TTwo
}
The easy case is solved easy enough with custom script
public static string ToTypeScriptType(IType type, IClass c)
{
var prefix = type.Name.StartsWith("(") ? "ValueTuple" : "";
return prefix + TypeFunctions.ToTypeScriptType(type);
}
But trying to solve it generically for any instance of a value tuple seems to require custom rewrite of ToTypeScriptType
to make use of this.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed