microsoft / microsoft/node-api-dotnet

Feature Request: Option to Generate TypeScript as export interface or export type

Open
#408 2 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.