napi-rs/examples/napi
Louis 43415251b8
feat(napi): allow Reference as a class method param (#1966)
As of before this commit, there was a lock in the codegen preventing Reference
from being used as a function argument outside of a Reference<Self>.

This changes it, allowing Reference of any class to be added as a class method
argument anywhere. It has the same limitations as reference, as in it requires
the class to have been created with a factory or constructor. This change
implements FromNapiValue on Reference, which will unwrap the class and call the
existing from_value_ptr method. It also updated typegen so that we only emit
the reference type if we're in an impl block that doesn't match the Reference
we're getting. This ensures that typegen works as expected with the previous
behaviour.
2024-02-22 22:37:50 +08:00
..
__tests__ feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
browser feat(cli): support generate browser compatible codes (#1891) 2024-01-08 21:02:46 +08:00
electron-renderer chore: upgrade emnapi dependencies (#1817) 2023-11-19 15:13:06 +08:00
src feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
tests fix(napi-derive): more accurate napi expanding error (#1854) 2023-12-13 15:23:00 +08:00
.gitignore feat: integrate with emnapi (#1669) 2023-11-02 12:57:11 +08:00
browser.js fix(cli): add browser entry (#1899) 2024-01-10 11:18:13 +08:00
build.rs Introduce #[napi] procedural macro to automation development boilerplate (#696) 2021-09-23 01:29:09 +08:00
Cargo.toml feat(napi): extends the Map types interoperability (#1950) 2024-02-15 15:43:21 +08:00
electron.cjs feat: integrate with emnapi (#1669) 2023-11-02 12:57:11 +08:00
index.d.ts feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
index.html feat: add wasm runtime package (#1904) 2024-01-16 23:28:40 +08:00
index.js feat(cli): change wasm binding output format to cjs (#1831) 2023-11-30 23:21:49 +08:00
index.wasi-browser.js fix(napi-derive): JsArrayBuffer generated type 2024-01-26 14:32:24 +08:00
index.wasi.cjs fix(napi-derive): JsArrayBuffer generated type 2024-01-26 14:32:24 +08:00
package.json chore: upgrade all dependencies (#1933) 2024-02-01 12:14:56 +08:00
tsconfig.json feat: integrate with emnapi (#1669) 2023-11-02 12:57:11 +08:00
vite-entry.js feat: add wasm runtime package (#1904) 2024-01-16 23:28:40 +08:00
vite.config.js feat: add wasm runtime package (#1904) 2024-01-16 23:28:40 +08:00
wasi-worker-browser.mjs fix(cli,wasm-runtime): dependencies (#1905) 2024-01-17 00:57:29 +08:00
wasi-worker.mjs fix(cli,wasm-runtime): dependencies (#1905) 2024-01-17 00:57:29 +08:00