Skip to content

fix(backend): fix type when function as object field#2359

Merged
Brooooooklyn merged 1 commit into
napi-rs:mainfrom
richerfu:fix-function-codegen
Nov 18, 2024
Merged

fix(backend): fix type when function as object field#2359
Brooooooklyn merged 1 commit into
napi-rs:mainfrom
richerfu:fix-function-codegen

Conversation

@richerfu

Copy link
Copy Markdown
Contributor

When we use Function as object field and the type that's currently being generated is incorrect.

Source code

#[napi(object)]
struct MyStruct<'a> {
    pub handle: Function<'a, (), ()>,
}

index.d.ts

export interface MyStruct {
  handle: (void) =>
}

@Brooooooklyn Brooooooklyn merged commit c1b07a8 into napi-rs:main Nov 18, 2024
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 this pull request may close these issues.

2 participants