Commit graph

9 commits

Author SHA1 Message Date
LongYinan
8f5d7e5274
fix(napi): handle panic in async block (#2050)
- Close https://github.com/napi-rs/napi-rs/issues/2047
2024-04-17 23:34:47 +08:00
LongYinan
b3dd94649a
feat(cli): allow to define dtsHeader in napi config (#2045) 2024-04-16 17:40:41 +08:00
翠 / green
923b82aee9
feat(napi): allow &External to be created from napi value (#2037) 2024-04-15 17:54:10 +08:00
LongYinan
4719caa643
feat(napi): support Return generic of ThreadsafeFunction (#1997)
* feat(napi): support to use tuple with either (#1993)

`Either` uses `ValidateNapiValue` + `TypeName` to validate and report error on value not being matched. So there's no way to remove these super traits from it. So I implemented these types to `Tuple` types.

* feat(napi): support `Return` generic of ThreadsafeFunction

* depracate JsFunction

* CalleeHandled tsfn should handle Result in callback

* Pass env to call_with_return_value callback

* Fix compile

* clippy fix

* Fix electron test

* Function args

---------

Co-authored-by: Hana <andywangsy@gmail.com>
2024-03-20 21:37:08 +08:00
Hana
97746b79a9
feat(napi): support to use tuple with either (#1993)
`Either` uses `ValidateNapiValue` + `TypeName` to validate and report error on value not being matched. So there's no way to remove these super traits from it. So I implemented these types to `Tuple` types.
2024-03-13 13:29:06 +08:00
Andrew Toth
6b1058a268
feat(napi-derive): add optional enum_string case conversion (#1995) 2024-03-11 20:10:00 +08:00
LongYinan
d962e34d3a
fix(napi): remove useless FromNapiValue bound check for ValidateNapiValue (#1999) 2024-03-10 21:22:46 +08:00
LongYinan
aeb0b4766d
fix(napi): add back the typecheck logic that was accidentally removed in Object::get_named_property (#1982)
- Close https://github.com/napi-rs/napi-rs/issues/1641
2024-02-28 14:29:02 +08:00
Caleb Everett
95dd6ef485
refactor(cli): refactor js-binding to support easier bundling. (#1957)
* Refactor js-binding to support bundling single-package artifacts

The existsSync check breaks the bundlers I've tested (esbuild, webpack,
ncc), so you cannot bundle napi-rs packages that have all binarys in a
single package.

I've tested this change with both single package and multi package
libraries.

* Update snapshots

* Update CI

* Fix electron test

---------

Co-authored-by: Caleb ツ Everett <calebev@amazon.com>
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-02-26 15:46:07 +08:00
Renamed from examples/napi/index.d.ts (Browse further)