Can't create a typescript interface from a .Net interface

Issue #50 resolved
Jan Christenson
created an issue

If I configure TypeLite as :

<# var ts = TypeScript.Definitions() .For<Model.Item>() .For<IServer>() .For<IClient>();


then I receive the error Error 1 Running transformation: System.ArgumentException: Type 'IServer' isn't class or struct. Only classes and structures can be added to the model at TypeLite.TsModelBuilder.Add(Type clrType, Boolean includeReferences) in c:_PROJECTS\TypeLITE\TypeLite\TsModelBuilder.cs:line 66 at TypeLite.TypeScriptFluent.For(Type type) in c:___PROJECTS\TypeLITE\TypeLite\TypeScript.cs:line 71 at TypeLite.TypeScriptFluent.ForT in c:_PROJECTS___\TypeLITE\TypeLite\TypeScript.cs:line 62 at Microsoft.VisualStudio.TextTemplating8C538146B906E1EEAD7ABE7F00AE9CD7C372A22A2B2AA5C9361491DBE54A9B9CEEE9303ADB34C5AD2B0AE30DA0FF724C3C9DCC6C0E6445026E6320646361D402.GeneratedTextTransformation.TransformText()

It would sometimes be very useful to be able to use interfaces as the base for constructing typescript interfaces.

Comments (4)

  1. Martin From

    I was about to report the same as it is the reason why I just installed it in my current project.

    Should this issue report be understood as if it is not currently possible to do this?

    I was thinking it is the main functionality of this project to create interfaces - so it is somewhat surprising if that is not the case.

  2. Log in to comment