Skip to content

Commit 264527c

Browse files
committed
Fix api/node
1 parent 3184132 commit 264527c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

api/node/rust/interpreter/value.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub enum JsValueType {
2525
Struct,
2626
Brush,
2727
Image,
28+
StyledText,
2829
}
2930

3031
impl From<slint_interpreter::ValueType> for JsValueType {
@@ -37,6 +38,7 @@ impl From<slint_interpreter::ValueType> for JsValueType {
3738
slint_interpreter::ValueType::Struct => JsValueType::Struct,
3839
slint_interpreter::ValueType::Brush => JsValueType::Brush,
3940
slint_interpreter::ValueType::Image => JsValueType::Image,
41+
slint_interpreter::ValueType::StyledText => JsValueType::StyledText,
4042
_ => JsValueType::Void,
4143
}
4244
}
@@ -290,7 +292,8 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
290292
| Type::Easing
291293
| Type::PathData
292294
| Type::LayoutCache
293-
| Type::ElementReference => Err(napi::Error::from_reason("reason")),
295+
| Type::ElementReference
296+
| Type::StyledText => Err(napi::Error::from_reason("reason")),
294297
}
295298
}
296299

internal/interpreter/api.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ use std::rc::Rc;
1818

1919
#[doc(inline)]
2020
pub use i_slint_compiler::diagnostics::{Diagnostic, DiagnosticLevel};
21-
pub use i_slint_core::api::{
22-
ComponentHandle, EventLoopError, Global, JoinHandle, PlatformError, SharedString, Weak, Window,
23-
};
21+
pub use i_slint_core::api::*;
2422
// keep in sync with api/rs/slint/lib.rs
2523
pub use i_slint_backend_selector::api::*;
2624
use i_slint_core::api;
2725
pub use i_slint_core::graphics::{
2826
Brush, Color, Image, LoadImageError, Rgb8Pixel, Rgba8Pixel, RgbaColor, SharedPixelBuffer,
2927
};
30-
use i_slint_core::items::*;
28+
use i_slint_core::items::{MenuEntry, ItemTreeVTable, FontMetrics,StateInfo,TableColumn,StandardListViewItem,DropEvent,KeyEvent,PointerEvent,PointerScrollEvent,KeyboardModifiers};
3129

3230
use crate::dynamic_item_tree::{ErasedItemTreeBox, WindowOptions};
3331

0 commit comments

Comments
 (0)