elringus / bootsharp

Compile C# solution into single-file ES module with auto-generated JavaScript bindings and type definitions
https://sharp.elringus.com
MIT License
673 stars 36 forks source link

C# IEnumerable<T> to TypeScript Array<T> #109

Closed CADBIMDeveloper closed 1 year ago

CADBIMDeveloper commented 1 year ago

Hi @Elringus,

Current version generates something like:

export function getSampleInputs(): System.Collections.Generic.IEnumerable<HelloWorld.Input>;

for

[JSInvokable]
public static IEnumerable<Input> GetSampleInputs () => ...

This PR fixes that

elringus commented 1 year ago

Well, IEnumerable can represent a lot of stuff (from arrays to DB queries). Not sure it's a good idea to just map it to array. I'd suggest using IList instead.