Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated d.ts definitions should use export declare class instead of export class #2106

Closed
sxlijin opened this issue May 10, 2024 · 0 comments · Fixed by #2117
Closed

generated d.ts definitions should use export declare class instead of export class #2106

sxlijin opened this issue May 10, 2024 · 0 comments · Fixed by #2117

Comments

@sxlijin
Copy link

sxlijin commented May 10, 2024

current behavior: NAPI currently generates class declarations in the d.ts file that look like this:

export class Foo {
  foo1(): void
  get foo2(): void
}

This is not valid in a class definition.

expected behavior: a class declaration:

export declare class Foo {
  foo1(): void
  get foo2(): void
}

Not totally sure where a PR to fix this would go, I glanced at https://github.com/napi-rs/napi-rs/blob/b2239fd880fa40fa98d206d8f31aec1bb8a0ce12/crates/backend/src/typegen/struct.rs but didn't see an obvious answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant