-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
TL;DR
- If
[ExportTs*]targets aclass- imports are specified correctly - If
[ExportTs*]targets aninterface- imports are omitted
Problem
I have something like this
# ISomeInterface.cs
[ExportTsInterface]
public interface ISomeInterface {
IList<IOtherInterface> Others { get; set; }
}
# IOtherInterface.cs
[ExportTsInterface]
public interface IOtherInterface {
}
Generated files:
# i-some-interface.ts
# there's no "import { IOtherInterface } from './i-other-interface.ts';" here
export interface ISomeInterface {
others: IOtherInterface[];
}
Typescript compiler now gives me an error
ERROR in src/i-some-interface.ts(12,17): error TS2304: Cannot find name 'IOtherInterface'
If I use [ExportTsInterface] on a class instead, *.ts files now correctly have import { IOtherInterface } from ... in them.
Environment
Nuget:
<PackageReference Include="TypeGen" Version="2.4.7" />
Tool:
"dotnet-typegen": {
"version": "2.4.7",
"commands": [
"dotnet-typegen"
]
}
tgconfig:
{
"assemblies": [
"src/web/bin/Release/netcoreapp3.0/web.dll",
"src/web/bin/Release/netcoreapp3.0/core.dll",
"src/web/bin/Release/netcoreapp3.0/infrastructure.dll"
],
"clearOutputDirectory": true,
"outputPath": "src/front-end/src/models",
"createIndexFile": true,
"enumStringInitializersConverters": [],
"customTypeMappings": {
"NodaTime.Instant": "Date"
}
}
Metadata
Metadata
Assignees
Labels
No labels