Add a nodejs testing function for apply_layout

This will allow making the JS test code more similar to the C++/Rust code,
allowing replacing synthetic mouse clicks.
This commit is contained in:
Simon Hausmann 2021-04-08 16:51:51 +02:00
parent 8fb0c060d6
commit beb5d63d1b
4 changed files with 36 additions and 2 deletions

View file

@ -26,6 +26,16 @@ function load_native_lib() {
*/
let native = !process.env.SIXTYFPS_NODE_NATIVE_LIB ? require('../native/index.node') : load_native_lib();
/**
* @hidden
*/
interface Rect {
x: number,
y: number,
width: number,
height: number
}
/**
* @hidden
*/
@ -55,6 +65,10 @@ class Component {
send_keyboard_string_sequence(s: String) {
this.comp.send_keyboard_string_sequence(s)
}
apply_layout(rect: Rect) {
this.comp.apply_layout(rect)
}
}
/**