chore(y-octo): migrate away depracated JsExternal API (#12130)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Refactor**
  - Updated usage of JavaScript interop types to newer API versions for improved compatibility and consistency.
  - Changed method and type signatures to use updated types in several areas.
  - Removed an unused constructor from one component.
  - Adjusted a method to use a different JavaScript array buffer type for update callbacks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Brooooooklyn
2025-05-06 07:24:54 +00:00
parent 245db4e992
commit 83f7093144
4 changed files with 42 additions and 33 deletions
+2 -8
View File
@@ -1,4 +1,4 @@
use napi::{Env, JsObject, ValueType};
use napi::bindgen_prelude::{Env, Object, ValueType};
use y_octo::{Any, Map, Value};
use super::*;
@@ -10,12 +10,6 @@ pub struct YMap {
#[napi]
impl YMap {
#[allow(clippy::new_without_default)]
#[napi(constructor)]
pub fn new() -> Self {
unimplemented!()
}
pub(crate) fn inner_new(map: Map) -> Self {
Self { map }
}
@@ -111,7 +105,7 @@ impl YMap {
}
#[napi]
pub fn to_json(&self, env: Env) -> Result<JsObject> {
pub fn to_json(&self, env: Env) -> Result<Object> {
let mut js_object = env.create_object()?;
for (key, value) in self.map.iter() {
js_object.set(key, get_js_unknown_from_value(env, value))?;