microsoft / microsoft/node-api-dotnet
Feature Request: Option to Generate TypeScript as export interface or export type
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 783
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
First of all, thank you for your fantastic work on this library!
I would like to suggest a feature enhancement that would allow users to choose between generating TypeScript definitions as export interface or export type. Currently, the generator produces TypeScript definitions in a specific format (e.g., class), but having the flexibility to toggle between interface and type would make this tool even more versatile and better aligned with different project requirements and coding styles.
Proposed Feature
Introduce an option (eg: [JSExport(AsInterface: true)]) that allows users to specify whether TypeScript definitions should be generated as:
[JSExport(AsInterface: true)]
public class SomeDto
{
public string Name { get; set; }
}
// Typescript
export interface SomeDto
export type SomeType
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by locating the TypeScript definition generator and the JSExport attribute handling, then trace how generated declarations are selected. Done means a documented option can produce either export interface or export type output, with coverage for both forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100