From cc937e1dbabcbc05bcb026126f82fe842554891d Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 15 Apr 2024 23:19:02 +0800 Subject: [PATCH] feat(cli): allow control the wasm Memory options via napi config (#2038) --- cli/src/api/build.ts | 9 +- cli/src/api/templates/load-wasi-template.ts | 16 +- .../__tests__/__snapshots__/config.spec.ts.md | 2 + .../__snapshots__/config.spec.ts.snap | Bin 813 -> 800 bytes .../__snapshots__/target.spec.ts.snap | Bin 1314 -> 1254 bytes .../__snapshots__/typegen.spec.ts.snap | Bin 4194 -> 4201 bytes .../__snapshots__/version.spec.ts.snap | Bin 414 -> 411 bytes cli/src/utils/config.ts | 18 +- examples/napi/example.wasi-browser.js | 336 +++++++++--------- examples/napi/example.wasi.cjs | 331 ++++++++--------- examples/napi/package.json | 5 +- 11 files changed, 379 insertions(+), 338 deletions(-) diff --git a/cli/src/api/build.ts b/cli/src/api/build.ts index 5fd46c83..348c5cfc 100644 --- a/cli/src/api/build.ts +++ b/cli/src/api/build.ts @@ -861,6 +861,8 @@ class Builder { name, this.config.packageName, wasiRegisterFunctions, + this.config.wasm.initialMemory, + this.config.wasm.maximumMemory, ) + exportsCode + '\n', @@ -868,7 +870,12 @@ class Builder { ) await writeFileAsync( browserBindingPath, - createWasiBrowserBinding(name, wasiRegisterFunctions) + + createWasiBrowserBinding( + name, + wasiRegisterFunctions, + this.config.wasm.initialMemory, + this.config.wasm.maximumMemory, + ) + idents .map( (ident) => diff --git a/cli/src/api/templates/load-wasi-template.ts b/cli/src/api/templates/load-wasi-template.ts index 209c3a2d..9592def8 100644 --- a/cli/src/api/templates/load-wasi-template.ts +++ b/cli/src/api/templates/load-wasi-template.ts @@ -1,6 +1,8 @@ export const createWasiBrowserBinding = ( wasiFilename: string, wasiRegisterFunctions: string[], + initialMemory = 4000, + maximumMemory = 65536, ) => `import { instantiateNapiModuleSync as __emnapiInstantiateNapiModuleSync, getDefaultContext as __emnapiGetDefaultContext, @@ -24,10 +26,8 @@ const __wasi = new __WASI({ const __emnapiContext = __emnapiGetDefaultContext() const __sharedMemory = new WebAssembly.Memory({ - // 1Gb - initial: 16384, - // 4Gb - maximum: 65536, + initial: ${initialMemory}, + maximum: ${maximumMemory}, shared: true, }) @@ -71,6 +71,8 @@ export const createWasiBinding = ( wasmFileName: string, packageName: string, wasiRegisterFunctions: string[], + initialMemory = 4000, + maximumMemory = 65536, ) => `/* eslint-disable */ /* prettier-ignore */ @@ -97,10 +99,8 @@ const __wasi = new __nodeWASI({ const __emnapiContext = __emnapiGetDefaultContext() const __sharedMemory = new WebAssembly.Memory({ - // 1Gb - initial: 16384, - // 4Gb - maximum: 65536, + initial: ${initialMemory}, + maximum: ${maximumMemory}, shared: true, }) diff --git a/cli/src/utils/__tests__/__snapshots__/config.spec.ts.md b/cli/src/utils/__tests__/__snapshots__/config.spec.ts.md index e3c8cc5c..4eca4920 100644 --- a/cli/src/utils/__tests__/__snapshots__/config.spec.ts.md +++ b/cli/src/utils/__tests__/__snapshots__/config.spec.ts.md @@ -48,6 +48,7 @@ Generated by [AVA](https://avajs.dev). triple: 'x86_64-apple-darwin', }, ], + wasm: {}, } ## should be able to read config from napi.json @@ -94,4 +95,5 @@ Generated by [AVA](https://avajs.dev). triple: 'aarch64-apple-darwin', }, ], + wasm: {}, } diff --git a/cli/src/utils/__tests__/__snapshots__/config.spec.ts.snap b/cli/src/utils/__tests__/__snapshots__/config.spec.ts.snap index d542d762cc92ccd589dff434507cf7e3c945649e..975c7e1da6e9ef5a686de0af98b7c19a94819090 100644 GIT binary patch literal 800 zcmV+*1K<2XRzVmtUdq79dY`@sUfnr&ndaw;ziL00000000B+RZVLXQ51b|CNt@GQd(Cv zB%NmF%`k7$q~NA*i-@?W;Hv(Hx)5*41r{@NhR2I`DOU_UH|H~>%u3eG zitxBCIP;MciuEniWFdQ`zfnn=L?1dp(~J1M2?W3XpRSDI`=}^JuELgk8Tq{{hhn5I!UXqxD+;^`#w#CC_Ma2rCW0W38 z-(+#PA>=l6NEM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/src/utils/__tests__/__snapshots__/target.spec.ts.snap index fcec5bf4ff74d785b91d3159fc1071ea9a7e7297..c96c0ce42843632ef43fefa77278994e5166a79c 100644 GIT binary patch literal 1254 zcmV@PCV%@!yJbAR~oJAqP=`xZyW7~-k-4-TAfC1*3>LppKV))+0bXJ zEz8oY?Zz3yZfYhf+V=8lt){iLp zYv4Ng8$=~S@?bC659Ywb?3$dF!ez_S&PbB06h$FYoJe^hB_!!FiA@f*3?)fSUZOI< zm0>2&Q7JR|4V4il13{XI$wO4em^7)3GkKB91e0r2CYdaTAX7{p zr83RrOH?XMUZyg`mz}iK@o!|&)feR7N77}c0D7gwkQ9|~Cqu^|mvxNoQrzrUx z{0hP`Lhc6D7-y3O+X_nF1|NYR0f`fGAkNt$f~|&<)8JL`F8B_}3C-aPo&z5yIa^$?{f3h3AekcM9`FQsImOu$g6$KOdlwf-nCClI<_zL_E_GdU-TCmko(g3f6_rMPzndNMX zU^|SGM?nR=0^SGLcw0uW?a2{x8z=)Eyav9=aki{r`v)bVJR!G(N5CRDpXY2ju>(+Y z6$A@}+yNd3FBUjkUa(z4$rZ2$q#~LJ94~UV!p*i6+o=@P1PXK~Lth28iotX+#eEaf ztm=aMA*@+Tr8%x5YBscXy=5)A7v!2|^^7K0rnqHg3|KyV#J!#zRI8(gmIvpB`>~+W zn<>qynu)8bJI!|IiD=E5)iP>61ErjDKZ%NNqK47z^wr@+n?<7fRI@XAt}vU_XDY?H zLprc3PS54q?dIw<7n`kK)5*tt9@#=m9lP-#hs&%FH)4J+-7TZj4UC@g>~3`m@$lpy zJm5DTD|X|F^K1hE>6BbUpg_?rr~Fq`~(_n zkib%v9ZsgPR>;T3;VacRos}B2M&Hk-vC9dy4SUAabER+O^4>3Yj|}F$T}<9m zk-DYp72EI8m2k?vn`#FaX*kcMeHAh^p=Bm(EM?GGbX*^uRWM5PrLp@ehNo1==Y{&F zD~26-s!w5lcy6g1-2fMF2DRM>#TIkD9y#Omq5U6%7H$OH@D8}7dq*W*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packageJson: CommonPackageJsonFields @@ -158,6 +173,7 @@ export async function readNapiConfig( targets: [], packageJson: pkgJson, npmClient: 'npm', + wasm: {}, }, omit(userNapiConfig, 'targets'), ) diff --git a/examples/napi/example.wasi-browser.js b/examples/napi/example.wasi-browser.js index 5fd277c0..c988e544 100644 --- a/examples/napi/example.wasi-browser.js +++ b/examples/napi/example.wasi-browser.js @@ -24,8 +24,8 @@ const __wasi = new __WASI({ const __emnapiContext = __emnapiGetDefaultContext() const __sharedMemory = new WebAssembly.Memory({ - initial: 1024, - maximum: 10240, + initial: 16384, + maximum: 65536, shared: true, }) @@ -188,210 +188,213 @@ function __napi_rs_initialize_modules(__napiInstance) { __napiInstance.exports['__napi_register__create_external_string_153']?.() __napiInstance.exports['__napi_register__get_external_154']?.() __napiInstance.exports['__napi_register__mutate_external_155']?.() - __napiInstance.exports['__napi_register__validate_array_156']?.() - __napiInstance.exports['__napi_register__validate_buffer_157']?.() - __napiInstance.exports['__napi_register__validate_typed_array_158']?.() - __napiInstance.exports['__napi_register__validate_typed_array_slice_159']?.() + __napiInstance.exports['__napi_register__create_optional_external_156']?.() + __napiInstance.exports['__napi_register__get_optional_external_157']?.() + __napiInstance.exports['__napi_register__mutate_optional_external_158']?.() + __napiInstance.exports['__napi_register__validate_array_159']?.() + __napiInstance.exports['__napi_register__validate_buffer_160']?.() + __napiInstance.exports['__napi_register__validate_typed_array_161']?.() + __napiInstance.exports['__napi_register__validate_typed_array_slice_162']?.() __napiInstance.exports[ - '__napi_register__validate_uint8_clamped_slice_160' + '__napi_register__validate_uint8_clamped_slice_163' ]?.() - __napiInstance.exports['__napi_register__validate_buffer_slice_161']?.() - __napiInstance.exports['__napi_register__validate_bigint_162']?.() - __napiInstance.exports['__napi_register__validate_boolean_163']?.() - __napiInstance.exports['__napi_register__validate_date_164']?.() - __napiInstance.exports['__napi_register__validate_date_time_165']?.() - __napiInstance.exports['__napi_register__validate_external_166']?.() - __napiInstance.exports['__napi_register__validate_function_167']?.() - __napiInstance.exports['__napi_register__validate_hash_map_168']?.() - __napiInstance.exports['__napi_register__validate_null_169']?.() - __napiInstance.exports['__napi_register__validate_undefined_170']?.() - __napiInstance.exports['__napi_register__validate_number_171']?.() - __napiInstance.exports['__napi_register__validate_promise_172']?.() - __napiInstance.exports['__napi_register__validate_string_173']?.() - __napiInstance.exports['__napi_register__validate_symbol_174']?.() - __napiInstance.exports['__napi_register__validate_optional_175']?.() - __napiInstance.exports['__napi_register__return_undefined_if_invalid_176']?.() + __napiInstance.exports['__napi_register__validate_buffer_slice_164']?.() + __napiInstance.exports['__napi_register__validate_bigint_165']?.() + __napiInstance.exports['__napi_register__validate_boolean_166']?.() + __napiInstance.exports['__napi_register__validate_date_167']?.() + __napiInstance.exports['__napi_register__validate_date_time_168']?.() + __napiInstance.exports['__napi_register__validate_external_169']?.() + __napiInstance.exports['__napi_register__validate_function_170']?.() + __napiInstance.exports['__napi_register__validate_hash_map_171']?.() + __napiInstance.exports['__napi_register__validate_null_172']?.() + __napiInstance.exports['__napi_register__validate_undefined_173']?.() + __napiInstance.exports['__napi_register__validate_number_174']?.() + __napiInstance.exports['__napi_register__validate_promise_175']?.() + __napiInstance.exports['__napi_register__validate_string_176']?.() + __napiInstance.exports['__napi_register__validate_symbol_177']?.() + __napiInstance.exports['__napi_register__validate_optional_178']?.() + __napiInstance.exports['__napi_register__return_undefined_if_invalid_179']?.() __napiInstance.exports[ - '__napi_register__return_undefined_if_invalid_promise_177' + '__napi_register__return_undefined_if_invalid_promise_180' ]?.() - __napiInstance.exports['__napi_register__ts_rename_178']?.() + __napiInstance.exports['__napi_register__ts_rename_181']?.() __napiInstance.exports[ - '__napi_register__override_individual_arg_on_function_179' + '__napi_register__override_individual_arg_on_function_182' ]?.() __napiInstance.exports[ - '__napi_register__override_individual_arg_on_function_with_cb_arg_180' + '__napi_register__override_individual_arg_on_function_with_cb_arg_183' ]?.() - __napiInstance.exports['__napi_register__call0_181']?.() - __napiInstance.exports['__napi_register__call1_182']?.() - __napiInstance.exports['__napi_register__call2_183']?.() - __napiInstance.exports['__napi_register__apply0_184']?.() - __napiInstance.exports['__napi_register__apply1_185']?.() - __napiInstance.exports['__napi_register__call_function_186']?.() - __napiInstance.exports['__napi_register__call_function_with_arg_187']?.() + __napiInstance.exports['__napi_register__call0_184']?.() + __napiInstance.exports['__napi_register__call1_185']?.() + __napiInstance.exports['__napi_register__call2_186']?.() + __napiInstance.exports['__napi_register__apply0_187']?.() + __napiInstance.exports['__napi_register__apply1_188']?.() + __napiInstance.exports['__napi_register__call_function_189']?.() + __napiInstance.exports['__napi_register__call_function_with_arg_190']?.() __napiInstance.exports[ - '__napi_register__create_reference_on_function_188' + '__napi_register__create_reference_on_function_191' ]?.() __napiInstance.exports[ - '__napi_register__call_function_with_arg_and_ctx_189' + '__napi_register__call_function_with_arg_and_ctx_192' ]?.() - __napiInstance.exports['__napi_register__reference_as_callback_190']?.() + __napiInstance.exports['__napi_register__reference_as_callback_193']?.() __napiInstance.exports[ - '__napi_register__build_threadsafe_function_from_function_191' + '__napi_register__build_threadsafe_function_from_function_194' ]?.() - __napiInstance.exports['__napi_register__Fib_struct_192']?.() - __napiInstance.exports['__napi_register__Fib_impl_193']?.() - __napiInstance.exports['__napi_register__Fib_impl_195']?.() - __napiInstance.exports['__napi_register__Fib2_struct_196']?.() - __napiInstance.exports['__napi_register__Fib2_impl_197']?.() - __napiInstance.exports['__napi_register__Fib2_impl_199']?.() - __napiInstance.exports['__napi_register__Fib3_struct_200']?.() - __napiInstance.exports['__napi_register__Fib3_impl_201']?.() - __napiInstance.exports['__napi_register__ALIGNMENT_202']?.() - __napiInstance.exports['__napi_register__xxh64_203']?.() - __napiInstance.exports['__napi_register__xxh128_204']?.() - __napiInstance.exports['__napi_register__Xxh3_struct_205']?.() - __napiInstance.exports['__napi_register__Xxh3_impl_209']?.() - __napiInstance.exports['__napi_register__xxh2_plus_210']?.() - __napiInstance.exports['__napi_register__xxh3_xxh64_alias_211']?.() - __napiInstance.exports['__napi_register__xxh64_alias_212']?.() - __napiInstance.exports['__napi_register__get_mapping_213']?.() - __napiInstance.exports['__napi_register__sum_mapping_214']?.() - __napiInstance.exports['__napi_register__get_btree_mapping_215']?.() - __napiInstance.exports['__napi_register__sum_btree_mapping_216']?.() - __napiInstance.exports['__napi_register__get_index_mapping_217']?.() - __napiInstance.exports['__napi_register__sum_index_mapping_218']?.() - __napiInstance.exports['__napi_register__indexmap_passthrough_219']?.() - __napiInstance.exports['__napi_register__map_option_220']?.() - __napiInstance.exports['__napi_register__return_null_221']?.() - __napiInstance.exports['__napi_register__return_undefined_222']?.() - __napiInstance.exports['__napi_register__UseNullableStruct_struct_223']?.() - __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_224']?.() + __napiInstance.exports['__napi_register__Fib_struct_195']?.() + __napiInstance.exports['__napi_register__Fib_impl_196']?.() + __napiInstance.exports['__napi_register__Fib_impl_198']?.() + __napiInstance.exports['__napi_register__Fib2_struct_199']?.() + __napiInstance.exports['__napi_register__Fib2_impl_200']?.() + __napiInstance.exports['__napi_register__Fib2_impl_202']?.() + __napiInstance.exports['__napi_register__Fib3_struct_203']?.() + __napiInstance.exports['__napi_register__Fib3_impl_204']?.() + __napiInstance.exports['__napi_register__ALIGNMENT_205']?.() + __napiInstance.exports['__napi_register__xxh64_206']?.() + __napiInstance.exports['__napi_register__xxh128_207']?.() + __napiInstance.exports['__napi_register__Xxh3_struct_208']?.() + __napiInstance.exports['__napi_register__Xxh3_impl_212']?.() + __napiInstance.exports['__napi_register__xxh2_plus_213']?.() + __napiInstance.exports['__napi_register__xxh3_xxh64_alias_214']?.() + __napiInstance.exports['__napi_register__xxh64_alias_215']?.() + __napiInstance.exports['__napi_register__get_mapping_216']?.() + __napiInstance.exports['__napi_register__sum_mapping_217']?.() + __napiInstance.exports['__napi_register__get_btree_mapping_218']?.() + __napiInstance.exports['__napi_register__sum_btree_mapping_219']?.() + __napiInstance.exports['__napi_register__get_index_mapping_220']?.() + __napiInstance.exports['__napi_register__sum_index_mapping_221']?.() + __napiInstance.exports['__napi_register__indexmap_passthrough_222']?.() + __napiInstance.exports['__napi_register__map_option_223']?.() + __napiInstance.exports['__napi_register__return_null_224']?.() + __napiInstance.exports['__napi_register__return_undefined_225']?.() + __napiInstance.exports['__napi_register__UseNullableStruct_struct_226']?.() + __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_227']?.() __napiInstance.exports[ - '__napi_register__DefaultUseNullableStruct_struct_225' + '__napi_register__DefaultUseNullableStruct_struct_228' ]?.() - __napiInstance.exports['__napi_register__UseNullableClass_struct_226']?.() - __napiInstance.exports['__napi_register__NotUseNullableClass_struct_227']?.() + __napiInstance.exports['__napi_register__UseNullableClass_struct_229']?.() + __napiInstance.exports['__napi_register__NotUseNullableClass_struct_230']?.() __napiInstance.exports[ - '__napi_register__DefaultUseNullableClass_struct_228' + '__napi_register__DefaultUseNullableClass_struct_231' ]?.() - __napiInstance.exports['__napi_register__add_229']?.() - __napiInstance.exports['__napi_register__fibonacci_230']?.() - __napiInstance.exports['__napi_register__list_obj_keys_231']?.() - __napiInstance.exports['__napi_register__create_obj_232']?.() - __napiInstance.exports['__napi_register__get_global_233']?.() - __napiInstance.exports['__napi_register__get_undefined_234']?.() - __napiInstance.exports['__napi_register__get_null_235']?.() - __napiInstance.exports['__napi_register__AllOptionalObject_struct_236']?.() - __napiInstance.exports['__napi_register__receive_all_optional_object_237']?.() - __napiInstance.exports['__napi_register__AliasedEnum_238']?.() + __napiInstance.exports['__napi_register__add_232']?.() + __napiInstance.exports['__napi_register__fibonacci_233']?.() + __napiInstance.exports['__napi_register__list_obj_keys_234']?.() + __napiInstance.exports['__napi_register__create_obj_235']?.() + __napiInstance.exports['__napi_register__get_global_236']?.() + __napiInstance.exports['__napi_register__get_undefined_237']?.() + __napiInstance.exports['__napi_register__get_null_238']?.() + __napiInstance.exports['__napi_register__AllOptionalObject_struct_239']?.() + __napiInstance.exports['__napi_register__receive_all_optional_object_240']?.() + __napiInstance.exports['__napi_register__AliasedEnum_241']?.() __napiInstance.exports[ - '__napi_register__StructContainsAliasedEnum_struct_239' + '__napi_register__StructContainsAliasedEnum_struct_242' ]?.() - __napiInstance.exports['__napi_register__fn_received_aliased_240']?.() - __napiInstance.exports['__napi_register__StrictObject_struct_241']?.() - __napiInstance.exports['__napi_register__receive_strict_object_242']?.() - __napiInstance.exports['__napi_register__get_str_from_object_243']?.() - __napiInstance.exports['__napi_register__TsTypeChanged_struct_244']?.() - __napiInstance.exports['__napi_register__create_obj_with_property_245']?.() - __napiInstance.exports['__napi_register__getter_from_obj_246']?.() - __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_247']?.() - __napiInstance.exports['__napi_register__receive_object_only_from_js_248']?.() + __napiInstance.exports['__napi_register__fn_received_aliased_243']?.() + __napiInstance.exports['__napi_register__StrictObject_struct_244']?.() + __napiInstance.exports['__napi_register__receive_strict_object_245']?.() + __napiInstance.exports['__napi_register__get_str_from_object_246']?.() + __napiInstance.exports['__napi_register__TsTypeChanged_struct_247']?.() + __napiInstance.exports['__napi_register__create_obj_with_property_248']?.() + __napiInstance.exports['__napi_register__getter_from_obj_249']?.() + __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_250']?.() + __napiInstance.exports['__napi_register__receive_object_only_from_js_251']?.() __napiInstance.exports[ - '__napi_register__object_get_named_property_should_perform_typecheck_249' + '__napi_register__object_get_named_property_should_perform_typecheck_252' ]?.() - __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_250']?.() - __napiInstance.exports['__napi_register__return_object_only_to_js_251']?.() - __napiInstance.exports['__napi_register__async_plus_100_252']?.() - __napiInstance.exports['__napi_register__JsRepo_struct_253']?.() - __napiInstance.exports['__napi_register__JsRepo_impl_256']?.() - __napiInstance.exports['__napi_register__JsRemote_struct_257']?.() - __napiInstance.exports['__napi_register__JsRemote_impl_260']?.() - __napiInstance.exports['__napi_register__CSSRuleList_struct_261']?.() - __napiInstance.exports['__napi_register__CSSRuleList_impl_265']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_struct_266']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_267']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_269']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_impl_273']?.() - __napiInstance.exports['__napi_register__PackageJson_struct_274']?.() - __napiInstance.exports['__napi_register__read_package_json_275']?.() - __napiInstance.exports['__napi_register__get_package_json_name_276']?.() - __napiInstance.exports['__napi_register__test_serde_roundtrip_277']?.() + __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_253']?.() + __napiInstance.exports['__napi_register__return_object_only_to_js_254']?.() + __napiInstance.exports['__napi_register__async_plus_100_255']?.() + __napiInstance.exports['__napi_register__JsRepo_struct_256']?.() + __napiInstance.exports['__napi_register__JsRepo_impl_259']?.() + __napiInstance.exports['__napi_register__JsRemote_struct_260']?.() + __napiInstance.exports['__napi_register__JsRemote_impl_263']?.() + __napiInstance.exports['__napi_register__CSSRuleList_struct_264']?.() + __napiInstance.exports['__napi_register__CSSRuleList_impl_268']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_struct_269']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_270']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_272']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_impl_276']?.() + __napiInstance.exports['__napi_register__PackageJson_struct_277']?.() + __napiInstance.exports['__napi_register__read_package_json_278']?.() + __napiInstance.exports['__napi_register__get_package_json_name_279']?.() + __napiInstance.exports['__napi_register__test_serde_roundtrip_280']?.() __napiInstance.exports[ - '__napi_register__test_serde_big_number_precision_278' + '__napi_register__test_serde_big_number_precision_281' ]?.() - __napiInstance.exports['__napi_register__return_from_shared_crate_279']?.() - __napiInstance.exports['__napi_register__contains_280']?.() - __napiInstance.exports['__napi_register__concat_str_281']?.() - __napiInstance.exports['__napi_register__concat_utf16_282']?.() - __napiInstance.exports['__napi_register__concat_latin1_283']?.() - __napiInstance.exports['__napi_register__roundtrip_str_284']?.() - __napiInstance.exports['__napi_register__set_symbol_in_obj_285']?.() - __napiInstance.exports['__napi_register__create_symbol_286']?.() - __napiInstance.exports['__napi_register__create_symbol_for_287']?.() - __napiInstance.exports['__napi_register__DelaySum_impl_288']?.() - __napiInstance.exports['__napi_register__without_abort_controller_289']?.() - __napiInstance.exports['__napi_register__with_abort_controller_290']?.() - __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_291']?.() - __napiInstance.exports['__napi_register__async_task_void_return_292']?.() + __napiInstance.exports['__napi_register__return_from_shared_crate_282']?.() + __napiInstance.exports['__napi_register__contains_283']?.() + __napiInstance.exports['__napi_register__concat_str_284']?.() + __napiInstance.exports['__napi_register__concat_utf16_285']?.() + __napiInstance.exports['__napi_register__concat_latin1_286']?.() + __napiInstance.exports['__napi_register__roundtrip_str_287']?.() + __napiInstance.exports['__napi_register__set_symbol_in_obj_288']?.() + __napiInstance.exports['__napi_register__create_symbol_289']?.() + __napiInstance.exports['__napi_register__create_symbol_for_290']?.() + __napiInstance.exports['__napi_register__DelaySum_impl_291']?.() + __napiInstance.exports['__napi_register__without_abort_controller_292']?.() + __napiInstance.exports['__napi_register__with_abort_controller_293']?.() + __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_294']?.() + __napiInstance.exports['__napi_register__async_task_void_return_295']?.() __napiInstance.exports[ - '__napi_register__AsyncTaskOptionalReturn_impl_293' + '__napi_register__AsyncTaskOptionalReturn_impl_296' ]?.() - __napiInstance.exports['__napi_register__async_task_optional_return_294']?.() - __napiInstance.exports['__napi_register__call_threadsafe_function_295']?.() + __napiInstance.exports['__napi_register__async_task_optional_return_297']?.() + __napiInstance.exports['__napi_register__call_threadsafe_function_298']?.() __napiInstance.exports[ - '__napi_register__call_long_threadsafe_function_296' + '__napi_register__call_long_threadsafe_function_299' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_throw_error_297' + '__napi_register__threadsafe_function_throw_error_300' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_fatal_mode_298' + '__napi_register__threadsafe_function_fatal_mode_301' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_fatal_mode_error_299' + '__napi_register__threadsafe_function_fatal_mode_error_302' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_closure_capture_300' + '__napi_register__threadsafe_function_closure_capture_303' ]?.() - __napiInstance.exports['__napi_register__tsfn_call_with_callback_301']?.() - __napiInstance.exports['__napi_register__tsfn_async_call_302']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_303']?.() + __napiInstance.exports['__napi_register__tsfn_call_with_callback_304']?.() + __napiInstance.exports['__napi_register__tsfn_async_call_305']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_306']?.() __napiInstance.exports[ - '__napi_register__accept_threadsafe_function_fatal_304' + '__napi_register__accept_threadsafe_function_fatal_307' ]?.() __napiInstance.exports[ - '__napi_register__accept_threadsafe_function_tuple_args_305' + '__napi_register__accept_threadsafe_function_tuple_args_308' ]?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_306']?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_307']?.() - __napiInstance.exports['__napi_register__tsfn_throw_from_js_308']?.() - __napiInstance.exports['__napi_register__get_buffer_309']?.() - __napiInstance.exports['__napi_register__append_buffer_310']?.() - __napiInstance.exports['__napi_register__get_empty_buffer_311']?.() - __napiInstance.exports['__napi_register__convert_u32_array_312']?.() - __napiInstance.exports['__napi_register__create_external_typed_array_313']?.() - __napiInstance.exports['__napi_register__mutate_typed_array_314']?.() - __napiInstance.exports['__napi_register__deref_uint8_array_315']?.() - __napiInstance.exports['__napi_register__buffer_pass_through_316']?.() - __napiInstance.exports['__napi_register__array_buffer_pass_through_317']?.() - __napiInstance.exports['__napi_register__accept_slice_318']?.() - __napiInstance.exports['__napi_register__u8_array_to_array_319']?.() - __napiInstance.exports['__napi_register__i8_array_to_array_320']?.() - __napiInstance.exports['__napi_register__u16_array_to_array_321']?.() - __napiInstance.exports['__napi_register__i16_array_to_array_322']?.() - __napiInstance.exports['__napi_register__u32_array_to_array_323']?.() - __napiInstance.exports['__napi_register__i32_array_to_array_324']?.() - __napiInstance.exports['__napi_register__f32_array_to_array_325']?.() - __napiInstance.exports['__napi_register__f64_array_to_array_326']?.() - __napiInstance.exports['__napi_register__u64_array_to_array_327']?.() - __napiInstance.exports['__napi_register__i64_array_to_array_328']?.() - __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_329']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_309']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_310']?.() + __napiInstance.exports['__napi_register__tsfn_throw_from_js_311']?.() + __napiInstance.exports['__napi_register__get_buffer_312']?.() + __napiInstance.exports['__napi_register__append_buffer_313']?.() + __napiInstance.exports['__napi_register__get_empty_buffer_314']?.() + __napiInstance.exports['__napi_register__convert_u32_array_315']?.() + __napiInstance.exports['__napi_register__create_external_typed_array_316']?.() + __napiInstance.exports['__napi_register__mutate_typed_array_317']?.() + __napiInstance.exports['__napi_register__deref_uint8_array_318']?.() + __napiInstance.exports['__napi_register__buffer_pass_through_319']?.() + __napiInstance.exports['__napi_register__array_buffer_pass_through_320']?.() + __napiInstance.exports['__napi_register__accept_slice_321']?.() + __napiInstance.exports['__napi_register__u8_array_to_array_322']?.() + __napiInstance.exports['__napi_register__i8_array_to_array_323']?.() + __napiInstance.exports['__napi_register__u16_array_to_array_324']?.() + __napiInstance.exports['__napi_register__i16_array_to_array_325']?.() + __napiInstance.exports['__napi_register__u32_array_to_array_326']?.() + __napiInstance.exports['__napi_register__i32_array_to_array_327']?.() + __napiInstance.exports['__napi_register__f32_array_to_array_328']?.() + __napiInstance.exports['__napi_register__f64_array_to_array_329']?.() + __napiInstance.exports['__napi_register__u64_array_to_array_330']?.() + __napiInstance.exports['__napi_register__i64_array_to_array_331']?.() + __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_332']?.() __napiInstance.exports[ - '__napi_register__accept_uint8_clamped_slice_and_buffer_slice_330' + '__napi_register__accept_uint8_clamped_slice_and_buffer_slice_333' ]?.() - __napiInstance.exports['__napi_register__AsyncBuffer_impl_331']?.() - __napiInstance.exports['__napi_register__async_reduce_buffer_332']?.() - __napiInstance.exports['__napi_register__async_buffer_to_array_333']?.() + __napiInstance.exports['__napi_register__AsyncBuffer_impl_334']?.() + __napiInstance.exports['__napi_register__async_reduce_buffer_335']?.() + __napiInstance.exports['__napi_register__async_buffer_to_array_336']?.() } export const Animal = __napiModule.exports.Animal export const AnimalWithDefaultConstructor = @@ -504,6 +507,8 @@ export const createObj = __napiModule.exports.createObj export const createObjectWithClassField = __napiModule.exports.createObjectWithClassField export const createObjWithProperty = __napiModule.exports.createObjWithProperty +export const createOptionalExternal = + __napiModule.exports.createOptionalExternal export const createReferenceOnFunction = __napiModule.exports.createReferenceOnFunction export const createSymbol = __napiModule.exports.createSymbol @@ -539,6 +544,7 @@ export const getNestedNumArr = __napiModule.exports.getNestedNumArr export const getNull = __napiModule.exports.getNull export const getNumArr = __napiModule.exports.getNumArr export const getNums = __napiModule.exports.getNums +export const getOptionalExternal = __napiModule.exports.getOptionalExternal export const getPackageJsonName = __napiModule.exports.getPackageJsonName export const getStrFromObject = __napiModule.exports.getStrFromObject export const getterFromObj = __napiModule.exports.getterFromObj @@ -553,6 +559,8 @@ export const Kind = __napiModule.exports.Kind export const listObjKeys = __napiModule.exports.listObjKeys export const mapOption = __napiModule.exports.mapOption export const mutateExternal = __napiModule.exports.mutateExternal +export const mutateOptionalExternal = + __napiModule.exports.mutateOptionalExternal export const mutateTypedArray = __napiModule.exports.mutateTypedArray export const objectGetNamedPropertyShouldPerformTypecheck = __napiModule.exports.objectGetNamedPropertyShouldPerformTypecheck diff --git a/examples/napi/example.wasi.cjs b/examples/napi/example.wasi.cjs index cdea31a5..e1dbf30a 100644 --- a/examples/napi/example.wasi.cjs +++ b/examples/napi/example.wasi.cjs @@ -25,7 +25,6 @@ const __emnapiContext = __emnapiGetDefaultContext() const __sharedMemory = new WebAssembly.Memory({ initial: 16384, - // 4Gb maximum: 65536, shared: true, }) @@ -184,168 +183,171 @@ function __napi_rs_initialize_modules(__napiInstance) { __napiInstance.exports['__napi_register__create_external_string_153']?.() __napiInstance.exports['__napi_register__get_external_154']?.() __napiInstance.exports['__napi_register__mutate_external_155']?.() - __napiInstance.exports['__napi_register__validate_array_156']?.() - __napiInstance.exports['__napi_register__validate_buffer_157']?.() - __napiInstance.exports['__napi_register__validate_typed_array_158']?.() - __napiInstance.exports['__napi_register__validate_typed_array_slice_159']?.() - __napiInstance.exports['__napi_register__validate_uint8_clamped_slice_160']?.() - __napiInstance.exports['__napi_register__validate_buffer_slice_161']?.() - __napiInstance.exports['__napi_register__validate_bigint_162']?.() - __napiInstance.exports['__napi_register__validate_boolean_163']?.() - __napiInstance.exports['__napi_register__validate_date_164']?.() - __napiInstance.exports['__napi_register__validate_date_time_165']?.() - __napiInstance.exports['__napi_register__validate_external_166']?.() - __napiInstance.exports['__napi_register__validate_function_167']?.() - __napiInstance.exports['__napi_register__validate_hash_map_168']?.() - __napiInstance.exports['__napi_register__validate_null_169']?.() - __napiInstance.exports['__napi_register__validate_undefined_170']?.() - __napiInstance.exports['__napi_register__validate_number_171']?.() - __napiInstance.exports['__napi_register__validate_promise_172']?.() - __napiInstance.exports['__napi_register__validate_string_173']?.() - __napiInstance.exports['__napi_register__validate_symbol_174']?.() - __napiInstance.exports['__napi_register__validate_optional_175']?.() - __napiInstance.exports['__napi_register__return_undefined_if_invalid_176']?.() - __napiInstance.exports['__napi_register__return_undefined_if_invalid_promise_177']?.() - __napiInstance.exports['__napi_register__ts_rename_178']?.() - __napiInstance.exports['__napi_register__override_individual_arg_on_function_179']?.() - __napiInstance.exports['__napi_register__override_individual_arg_on_function_with_cb_arg_180']?.() - __napiInstance.exports['__napi_register__call0_181']?.() - __napiInstance.exports['__napi_register__call1_182']?.() - __napiInstance.exports['__napi_register__call2_183']?.() - __napiInstance.exports['__napi_register__apply0_184']?.() - __napiInstance.exports['__napi_register__apply1_185']?.() - __napiInstance.exports['__napi_register__call_function_186']?.() - __napiInstance.exports['__napi_register__call_function_with_arg_187']?.() - __napiInstance.exports['__napi_register__create_reference_on_function_188']?.() - __napiInstance.exports['__napi_register__call_function_with_arg_and_ctx_189']?.() - __napiInstance.exports['__napi_register__reference_as_callback_190']?.() - __napiInstance.exports['__napi_register__build_threadsafe_function_from_function_191']?.() - __napiInstance.exports['__napi_register__Fib_struct_192']?.() - __napiInstance.exports['__napi_register__Fib_impl_193']?.() - __napiInstance.exports['__napi_register__Fib_impl_195']?.() - __napiInstance.exports['__napi_register__Fib2_struct_196']?.() - __napiInstance.exports['__napi_register__Fib2_impl_197']?.() - __napiInstance.exports['__napi_register__Fib2_impl_199']?.() - __napiInstance.exports['__napi_register__Fib3_struct_200']?.() - __napiInstance.exports['__napi_register__Fib3_impl_201']?.() - __napiInstance.exports['__napi_register__ALIGNMENT_202']?.() - __napiInstance.exports['__napi_register__xxh64_203']?.() - __napiInstance.exports['__napi_register__xxh128_204']?.() - __napiInstance.exports['__napi_register__Xxh3_struct_205']?.() - __napiInstance.exports['__napi_register__Xxh3_impl_209']?.() - __napiInstance.exports['__napi_register__xxh2_plus_210']?.() - __napiInstance.exports['__napi_register__xxh3_xxh64_alias_211']?.() - __napiInstance.exports['__napi_register__xxh64_alias_212']?.() - __napiInstance.exports['__napi_register__get_mapping_213']?.() - __napiInstance.exports['__napi_register__sum_mapping_214']?.() - __napiInstance.exports['__napi_register__get_btree_mapping_215']?.() - __napiInstance.exports['__napi_register__sum_btree_mapping_216']?.() - __napiInstance.exports['__napi_register__get_index_mapping_217']?.() - __napiInstance.exports['__napi_register__sum_index_mapping_218']?.() - __napiInstance.exports['__napi_register__indexmap_passthrough_219']?.() - __napiInstance.exports['__napi_register__map_option_220']?.() - __napiInstance.exports['__napi_register__return_null_221']?.() - __napiInstance.exports['__napi_register__return_undefined_222']?.() - __napiInstance.exports['__napi_register__UseNullableStruct_struct_223']?.() - __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_224']?.() - __napiInstance.exports['__napi_register__DefaultUseNullableStruct_struct_225']?.() - __napiInstance.exports['__napi_register__UseNullableClass_struct_226']?.() - __napiInstance.exports['__napi_register__NotUseNullableClass_struct_227']?.() - __napiInstance.exports['__napi_register__DefaultUseNullableClass_struct_228']?.() - __napiInstance.exports['__napi_register__add_229']?.() - __napiInstance.exports['__napi_register__fibonacci_230']?.() - __napiInstance.exports['__napi_register__list_obj_keys_231']?.() - __napiInstance.exports['__napi_register__create_obj_232']?.() - __napiInstance.exports['__napi_register__get_global_233']?.() - __napiInstance.exports['__napi_register__get_undefined_234']?.() - __napiInstance.exports['__napi_register__get_null_235']?.() - __napiInstance.exports['__napi_register__AllOptionalObject_struct_236']?.() - __napiInstance.exports['__napi_register__receive_all_optional_object_237']?.() - __napiInstance.exports['__napi_register__AliasedEnum_238']?.() - __napiInstance.exports['__napi_register__StructContainsAliasedEnum_struct_239']?.() - __napiInstance.exports['__napi_register__fn_received_aliased_240']?.() - __napiInstance.exports['__napi_register__StrictObject_struct_241']?.() - __napiInstance.exports['__napi_register__receive_strict_object_242']?.() - __napiInstance.exports['__napi_register__get_str_from_object_243']?.() - __napiInstance.exports['__napi_register__TsTypeChanged_struct_244']?.() - __napiInstance.exports['__napi_register__create_obj_with_property_245']?.() - __napiInstance.exports['__napi_register__getter_from_obj_246']?.() - __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_247']?.() - __napiInstance.exports['__napi_register__receive_object_only_from_js_248']?.() - __napiInstance.exports['__napi_register__object_get_named_property_should_perform_typecheck_249']?.() - __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_250']?.() - __napiInstance.exports['__napi_register__return_object_only_to_js_251']?.() - __napiInstance.exports['__napi_register__async_plus_100_252']?.() - __napiInstance.exports['__napi_register__JsRepo_struct_253']?.() - __napiInstance.exports['__napi_register__JsRepo_impl_256']?.() - __napiInstance.exports['__napi_register__JsRemote_struct_257']?.() - __napiInstance.exports['__napi_register__JsRemote_impl_260']?.() - __napiInstance.exports['__napi_register__CSSRuleList_struct_261']?.() - __napiInstance.exports['__napi_register__CSSRuleList_impl_265']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_struct_266']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_267']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_269']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_impl_273']?.() - __napiInstance.exports['__napi_register__PackageJson_struct_274']?.() - __napiInstance.exports['__napi_register__read_package_json_275']?.() - __napiInstance.exports['__napi_register__get_package_json_name_276']?.() - __napiInstance.exports['__napi_register__test_serde_roundtrip_277']?.() - __napiInstance.exports['__napi_register__test_serde_big_number_precision_278']?.() - __napiInstance.exports['__napi_register__return_from_shared_crate_279']?.() - __napiInstance.exports['__napi_register__contains_280']?.() - __napiInstance.exports['__napi_register__concat_str_281']?.() - __napiInstance.exports['__napi_register__concat_utf16_282']?.() - __napiInstance.exports['__napi_register__concat_latin1_283']?.() - __napiInstance.exports['__napi_register__roundtrip_str_284']?.() - __napiInstance.exports['__napi_register__set_symbol_in_obj_285']?.() - __napiInstance.exports['__napi_register__create_symbol_286']?.() - __napiInstance.exports['__napi_register__create_symbol_for_287']?.() - __napiInstance.exports['__napi_register__DelaySum_impl_288']?.() - __napiInstance.exports['__napi_register__without_abort_controller_289']?.() - __napiInstance.exports['__napi_register__with_abort_controller_290']?.() - __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_291']?.() - __napiInstance.exports['__napi_register__async_task_void_return_292']?.() - __napiInstance.exports['__napi_register__AsyncTaskOptionalReturn_impl_293']?.() - __napiInstance.exports['__napi_register__async_task_optional_return_294']?.() - __napiInstance.exports['__napi_register__call_threadsafe_function_295']?.() - __napiInstance.exports['__napi_register__call_long_threadsafe_function_296']?.() - __napiInstance.exports['__napi_register__threadsafe_function_throw_error_297']?.() - __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_298']?.() - __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_error_299']?.() - __napiInstance.exports['__napi_register__threadsafe_function_closure_capture_300']?.() - __napiInstance.exports['__napi_register__tsfn_call_with_callback_301']?.() - __napiInstance.exports['__napi_register__tsfn_async_call_302']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_303']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_fatal_304']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_tuple_args_305']?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_306']?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_307']?.() - __napiInstance.exports['__napi_register__tsfn_throw_from_js_308']?.() - __napiInstance.exports['__napi_register__get_buffer_309']?.() - __napiInstance.exports['__napi_register__append_buffer_310']?.() - __napiInstance.exports['__napi_register__get_empty_buffer_311']?.() - __napiInstance.exports['__napi_register__convert_u32_array_312']?.() - __napiInstance.exports['__napi_register__create_external_typed_array_313']?.() - __napiInstance.exports['__napi_register__mutate_typed_array_314']?.() - __napiInstance.exports['__napi_register__deref_uint8_array_315']?.() - __napiInstance.exports['__napi_register__buffer_pass_through_316']?.() - __napiInstance.exports['__napi_register__array_buffer_pass_through_317']?.() - __napiInstance.exports['__napi_register__accept_slice_318']?.() - __napiInstance.exports['__napi_register__u8_array_to_array_319']?.() - __napiInstance.exports['__napi_register__i8_array_to_array_320']?.() - __napiInstance.exports['__napi_register__u16_array_to_array_321']?.() - __napiInstance.exports['__napi_register__i16_array_to_array_322']?.() - __napiInstance.exports['__napi_register__u32_array_to_array_323']?.() - __napiInstance.exports['__napi_register__i32_array_to_array_324']?.() - __napiInstance.exports['__napi_register__f32_array_to_array_325']?.() - __napiInstance.exports['__napi_register__f64_array_to_array_326']?.() - __napiInstance.exports['__napi_register__u64_array_to_array_327']?.() - __napiInstance.exports['__napi_register__i64_array_to_array_328']?.() - __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_329']?.() - __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_and_buffer_slice_330']?.() - __napiInstance.exports['__napi_register__AsyncBuffer_impl_331']?.() - __napiInstance.exports['__napi_register__async_reduce_buffer_332']?.() - __napiInstance.exports['__napi_register__async_buffer_to_array_333']?.() + __napiInstance.exports['__napi_register__create_optional_external_156']?.() + __napiInstance.exports['__napi_register__get_optional_external_157']?.() + __napiInstance.exports['__napi_register__mutate_optional_external_158']?.() + __napiInstance.exports['__napi_register__validate_array_159']?.() + __napiInstance.exports['__napi_register__validate_buffer_160']?.() + __napiInstance.exports['__napi_register__validate_typed_array_161']?.() + __napiInstance.exports['__napi_register__validate_typed_array_slice_162']?.() + __napiInstance.exports['__napi_register__validate_uint8_clamped_slice_163']?.() + __napiInstance.exports['__napi_register__validate_buffer_slice_164']?.() + __napiInstance.exports['__napi_register__validate_bigint_165']?.() + __napiInstance.exports['__napi_register__validate_boolean_166']?.() + __napiInstance.exports['__napi_register__validate_date_167']?.() + __napiInstance.exports['__napi_register__validate_date_time_168']?.() + __napiInstance.exports['__napi_register__validate_external_169']?.() + __napiInstance.exports['__napi_register__validate_function_170']?.() + __napiInstance.exports['__napi_register__validate_hash_map_171']?.() + __napiInstance.exports['__napi_register__validate_null_172']?.() + __napiInstance.exports['__napi_register__validate_undefined_173']?.() + __napiInstance.exports['__napi_register__validate_number_174']?.() + __napiInstance.exports['__napi_register__validate_promise_175']?.() + __napiInstance.exports['__napi_register__validate_string_176']?.() + __napiInstance.exports['__napi_register__validate_symbol_177']?.() + __napiInstance.exports['__napi_register__validate_optional_178']?.() + __napiInstance.exports['__napi_register__return_undefined_if_invalid_179']?.() + __napiInstance.exports['__napi_register__return_undefined_if_invalid_promise_180']?.() + __napiInstance.exports['__napi_register__ts_rename_181']?.() + __napiInstance.exports['__napi_register__override_individual_arg_on_function_182']?.() + __napiInstance.exports['__napi_register__override_individual_arg_on_function_with_cb_arg_183']?.() + __napiInstance.exports['__napi_register__call0_184']?.() + __napiInstance.exports['__napi_register__call1_185']?.() + __napiInstance.exports['__napi_register__call2_186']?.() + __napiInstance.exports['__napi_register__apply0_187']?.() + __napiInstance.exports['__napi_register__apply1_188']?.() + __napiInstance.exports['__napi_register__call_function_189']?.() + __napiInstance.exports['__napi_register__call_function_with_arg_190']?.() + __napiInstance.exports['__napi_register__create_reference_on_function_191']?.() + __napiInstance.exports['__napi_register__call_function_with_arg_and_ctx_192']?.() + __napiInstance.exports['__napi_register__reference_as_callback_193']?.() + __napiInstance.exports['__napi_register__build_threadsafe_function_from_function_194']?.() + __napiInstance.exports['__napi_register__Fib_struct_195']?.() + __napiInstance.exports['__napi_register__Fib_impl_196']?.() + __napiInstance.exports['__napi_register__Fib_impl_198']?.() + __napiInstance.exports['__napi_register__Fib2_struct_199']?.() + __napiInstance.exports['__napi_register__Fib2_impl_200']?.() + __napiInstance.exports['__napi_register__Fib2_impl_202']?.() + __napiInstance.exports['__napi_register__Fib3_struct_203']?.() + __napiInstance.exports['__napi_register__Fib3_impl_204']?.() + __napiInstance.exports['__napi_register__ALIGNMENT_205']?.() + __napiInstance.exports['__napi_register__xxh64_206']?.() + __napiInstance.exports['__napi_register__xxh128_207']?.() + __napiInstance.exports['__napi_register__Xxh3_struct_208']?.() + __napiInstance.exports['__napi_register__Xxh3_impl_212']?.() + __napiInstance.exports['__napi_register__xxh2_plus_213']?.() + __napiInstance.exports['__napi_register__xxh3_xxh64_alias_214']?.() + __napiInstance.exports['__napi_register__xxh64_alias_215']?.() + __napiInstance.exports['__napi_register__get_mapping_216']?.() + __napiInstance.exports['__napi_register__sum_mapping_217']?.() + __napiInstance.exports['__napi_register__get_btree_mapping_218']?.() + __napiInstance.exports['__napi_register__sum_btree_mapping_219']?.() + __napiInstance.exports['__napi_register__get_index_mapping_220']?.() + __napiInstance.exports['__napi_register__sum_index_mapping_221']?.() + __napiInstance.exports['__napi_register__indexmap_passthrough_222']?.() + __napiInstance.exports['__napi_register__map_option_223']?.() + __napiInstance.exports['__napi_register__return_null_224']?.() + __napiInstance.exports['__napi_register__return_undefined_225']?.() + __napiInstance.exports['__napi_register__UseNullableStruct_struct_226']?.() + __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_227']?.() + __napiInstance.exports['__napi_register__DefaultUseNullableStruct_struct_228']?.() + __napiInstance.exports['__napi_register__UseNullableClass_struct_229']?.() + __napiInstance.exports['__napi_register__NotUseNullableClass_struct_230']?.() + __napiInstance.exports['__napi_register__DefaultUseNullableClass_struct_231']?.() + __napiInstance.exports['__napi_register__add_232']?.() + __napiInstance.exports['__napi_register__fibonacci_233']?.() + __napiInstance.exports['__napi_register__list_obj_keys_234']?.() + __napiInstance.exports['__napi_register__create_obj_235']?.() + __napiInstance.exports['__napi_register__get_global_236']?.() + __napiInstance.exports['__napi_register__get_undefined_237']?.() + __napiInstance.exports['__napi_register__get_null_238']?.() + __napiInstance.exports['__napi_register__AllOptionalObject_struct_239']?.() + __napiInstance.exports['__napi_register__receive_all_optional_object_240']?.() + __napiInstance.exports['__napi_register__AliasedEnum_241']?.() + __napiInstance.exports['__napi_register__StructContainsAliasedEnum_struct_242']?.() + __napiInstance.exports['__napi_register__fn_received_aliased_243']?.() + __napiInstance.exports['__napi_register__StrictObject_struct_244']?.() + __napiInstance.exports['__napi_register__receive_strict_object_245']?.() + __napiInstance.exports['__napi_register__get_str_from_object_246']?.() + __napiInstance.exports['__napi_register__TsTypeChanged_struct_247']?.() + __napiInstance.exports['__napi_register__create_obj_with_property_248']?.() + __napiInstance.exports['__napi_register__getter_from_obj_249']?.() + __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_250']?.() + __napiInstance.exports['__napi_register__receive_object_only_from_js_251']?.() + __napiInstance.exports['__napi_register__object_get_named_property_should_perform_typecheck_252']?.() + __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_253']?.() + __napiInstance.exports['__napi_register__return_object_only_to_js_254']?.() + __napiInstance.exports['__napi_register__async_plus_100_255']?.() + __napiInstance.exports['__napi_register__JsRepo_struct_256']?.() + __napiInstance.exports['__napi_register__JsRepo_impl_259']?.() + __napiInstance.exports['__napi_register__JsRemote_struct_260']?.() + __napiInstance.exports['__napi_register__JsRemote_impl_263']?.() + __napiInstance.exports['__napi_register__CSSRuleList_struct_264']?.() + __napiInstance.exports['__napi_register__CSSRuleList_impl_268']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_struct_269']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_270']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_272']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_impl_276']?.() + __napiInstance.exports['__napi_register__PackageJson_struct_277']?.() + __napiInstance.exports['__napi_register__read_package_json_278']?.() + __napiInstance.exports['__napi_register__get_package_json_name_279']?.() + __napiInstance.exports['__napi_register__test_serde_roundtrip_280']?.() + __napiInstance.exports['__napi_register__test_serde_big_number_precision_281']?.() + __napiInstance.exports['__napi_register__return_from_shared_crate_282']?.() + __napiInstance.exports['__napi_register__contains_283']?.() + __napiInstance.exports['__napi_register__concat_str_284']?.() + __napiInstance.exports['__napi_register__concat_utf16_285']?.() + __napiInstance.exports['__napi_register__concat_latin1_286']?.() + __napiInstance.exports['__napi_register__roundtrip_str_287']?.() + __napiInstance.exports['__napi_register__set_symbol_in_obj_288']?.() + __napiInstance.exports['__napi_register__create_symbol_289']?.() + __napiInstance.exports['__napi_register__create_symbol_for_290']?.() + __napiInstance.exports['__napi_register__DelaySum_impl_291']?.() + __napiInstance.exports['__napi_register__without_abort_controller_292']?.() + __napiInstance.exports['__napi_register__with_abort_controller_293']?.() + __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_294']?.() + __napiInstance.exports['__napi_register__async_task_void_return_295']?.() + __napiInstance.exports['__napi_register__AsyncTaskOptionalReturn_impl_296']?.() + __napiInstance.exports['__napi_register__async_task_optional_return_297']?.() + __napiInstance.exports['__napi_register__call_threadsafe_function_298']?.() + __napiInstance.exports['__napi_register__call_long_threadsafe_function_299']?.() + __napiInstance.exports['__napi_register__threadsafe_function_throw_error_300']?.() + __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_301']?.() + __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_error_302']?.() + __napiInstance.exports['__napi_register__threadsafe_function_closure_capture_303']?.() + __napiInstance.exports['__napi_register__tsfn_call_with_callback_304']?.() + __napiInstance.exports['__napi_register__tsfn_async_call_305']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_306']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_fatal_307']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_tuple_args_308']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_309']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_310']?.() + __napiInstance.exports['__napi_register__tsfn_throw_from_js_311']?.() + __napiInstance.exports['__napi_register__get_buffer_312']?.() + __napiInstance.exports['__napi_register__append_buffer_313']?.() + __napiInstance.exports['__napi_register__get_empty_buffer_314']?.() + __napiInstance.exports['__napi_register__convert_u32_array_315']?.() + __napiInstance.exports['__napi_register__create_external_typed_array_316']?.() + __napiInstance.exports['__napi_register__mutate_typed_array_317']?.() + __napiInstance.exports['__napi_register__deref_uint8_array_318']?.() + __napiInstance.exports['__napi_register__buffer_pass_through_319']?.() + __napiInstance.exports['__napi_register__array_buffer_pass_through_320']?.() + __napiInstance.exports['__napi_register__accept_slice_321']?.() + __napiInstance.exports['__napi_register__u8_array_to_array_322']?.() + __napiInstance.exports['__napi_register__i8_array_to_array_323']?.() + __napiInstance.exports['__napi_register__u16_array_to_array_324']?.() + __napiInstance.exports['__napi_register__i16_array_to_array_325']?.() + __napiInstance.exports['__napi_register__u32_array_to_array_326']?.() + __napiInstance.exports['__napi_register__i32_array_to_array_327']?.() + __napiInstance.exports['__napi_register__f32_array_to_array_328']?.() + __napiInstance.exports['__napi_register__f64_array_to_array_329']?.() + __napiInstance.exports['__napi_register__u64_array_to_array_330']?.() + __napiInstance.exports['__napi_register__i64_array_to_array_331']?.() + __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_332']?.() + __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_and_buffer_slice_333']?.() + __napiInstance.exports['__napi_register__AsyncBuffer_impl_334']?.() + __napiInstance.exports['__napi_register__async_reduce_buffer_335']?.() + __napiInstance.exports['__napi_register__async_buffer_to_array_336']?.() } module.exports.Animal = __napiModule.exports.Animal module.exports.AnimalWithDefaultConstructor = __napiModule.exports.AnimalWithDefaultConstructor @@ -439,6 +441,7 @@ module.exports.createExternalTypedArray = __napiModule.exports.createExternalTyp module.exports.createObj = __napiModule.exports.createObj module.exports.createObjectWithClassField = __napiModule.exports.createObjectWithClassField module.exports.createObjWithProperty = __napiModule.exports.createObjWithProperty +module.exports.createOptionalExternal = __napiModule.exports.createOptionalExternal module.exports.createReferenceOnFunction = __napiModule.exports.createReferenceOnFunction module.exports.createSymbol = __napiModule.exports.createSymbol module.exports.createSymbolFor = __napiModule.exports.createSymbolFor @@ -473,6 +476,7 @@ module.exports.getNestedNumArr = __napiModule.exports.getNestedNumArr module.exports.getNull = __napiModule.exports.getNull module.exports.getNumArr = __napiModule.exports.getNumArr module.exports.getNums = __napiModule.exports.getNums +module.exports.getOptionalExternal = __napiModule.exports.getOptionalExternal module.exports.getPackageJsonName = __napiModule.exports.getPackageJsonName module.exports.getStrFromObject = __napiModule.exports.getStrFromObject module.exports.getterFromObj = __napiModule.exports.getterFromObj @@ -487,6 +491,7 @@ module.exports.Kind = __napiModule.exports.Kind module.exports.listObjKeys = __napiModule.exports.listObjKeys module.exports.mapOption = __napiModule.exports.mapOption module.exports.mutateExternal = __napiModule.exports.mutateExternal +module.exports.mutateOptionalExternal = __napiModule.exports.mutateOptionalExternal module.exports.mutateTypedArray = __napiModule.exports.mutateTypedArray module.exports.objectGetNamedPropertyShouldPerformTypecheck = __napiModule.exports.objectGetNamedPropertyShouldPerformTypecheck module.exports.optionEnd = __napiModule.exports.optionEnd diff --git a/examples/napi/package.json b/examples/napi/package.json index 46c94324..7c84ac45 100644 --- a/examples/napi/package.json +++ b/examples/napi/package.json @@ -11,7 +11,10 @@ "test": "cross-env TS_NODE_PROJECT=./tsconfig.json node --es-module-specifier-resolution=node --loader ts-node/esm/transpile-only --experimental-wasi-unstable-preview1 ../../node_modules/ava/entrypoints/cli.mjs" }, "napi": { - "binaryName": "example" + "binaryName": "example", + "wasm": { + "initialMemory": 16384 + } }, "devDependencies": { "@napi-rs/cli": "workspace:*",