slint-ui 0.2.2 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +24 -2
- package/dist/index.js +22 -1
- package/native/Cargo.toml +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,13 +15,29 @@ declare class Component {
|
|
|
15
15
|
run(): void;
|
|
16
16
|
show(): void;
|
|
17
17
|
hide(): void;
|
|
18
|
-
get window():
|
|
18
|
+
get window(): SlintWindow;
|
|
19
19
|
send_mouse_click(x: number, y: number): void;
|
|
20
20
|
send_keyboard_string_sequence(s: String): void;
|
|
21
21
|
}
|
|
22
|
-
interface
|
|
22
|
+
interface Point {
|
|
23
|
+
x: Number;
|
|
24
|
+
y: Number;
|
|
25
|
+
}
|
|
26
|
+
interface SlintWindow {
|
|
23
27
|
show(): void;
|
|
24
28
|
hide(): void;
|
|
29
|
+
position: Point;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
declare class WindowAPI implements SlintWindow {
|
|
35
|
+
protected impl: any;
|
|
36
|
+
constructor(impl: any);
|
|
37
|
+
show(): void;
|
|
38
|
+
hide(): void;
|
|
39
|
+
get position(): Point;
|
|
40
|
+
set position(pos: Point);
|
|
25
41
|
}
|
|
26
42
|
/**
|
|
27
43
|
* @hidden
|
|
@@ -56,6 +72,11 @@ interface ModelPeer {
|
|
|
56
72
|
* @param count
|
|
57
73
|
*/
|
|
58
74
|
rowRemoved(row: number, count: number): void;
|
|
75
|
+
/**
|
|
76
|
+
* Call this function from your own model to notify that the model has been
|
|
77
|
+
* changed and everything must be reloaded
|
|
78
|
+
*/
|
|
79
|
+
reset(): void;
|
|
59
80
|
}
|
|
60
81
|
/**
|
|
61
82
|
* Model<T> is the interface for feeding dynamic data into
|
|
@@ -94,6 +115,7 @@ declare class NullPeer implements ModelPeer {
|
|
|
94
115
|
rowDataChanged(row: number): void;
|
|
95
116
|
rowAdded(row: number, count: number): void;
|
|
96
117
|
rowRemoved(row: number, count: number): void;
|
|
118
|
+
reset(): void;
|
|
97
119
|
}
|
|
98
120
|
/**
|
|
99
121
|
* ArrayModel wraps a JavaScript array for use in `.slint` views. The underlying
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ class Component {
|
|
|
33
33
|
this.window.hide();
|
|
34
34
|
}
|
|
35
35
|
get window() {
|
|
36
|
-
return this.comp.window();
|
|
36
|
+
return new WindowAPI(this.comp.window());
|
|
37
37
|
}
|
|
38
38
|
send_mouse_click(x, y) {
|
|
39
39
|
this.comp.send_mouse_click(x, y);
|
|
@@ -42,6 +42,26 @@ class Component {
|
|
|
42
42
|
this.comp.send_keyboard_string_sequence(s);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
class WindowAPI {
|
|
49
|
+
constructor(impl) {
|
|
50
|
+
this.impl = impl;
|
|
51
|
+
}
|
|
52
|
+
show() {
|
|
53
|
+
this.impl.show();
|
|
54
|
+
}
|
|
55
|
+
hide() {
|
|
56
|
+
this.impl.hide();
|
|
57
|
+
}
|
|
58
|
+
get position() {
|
|
59
|
+
return this.impl.get_position();
|
|
60
|
+
}
|
|
61
|
+
set position(pos) {
|
|
62
|
+
this.impl.set_position(pos);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
45
65
|
require.extensions['.60'] = require.extensions['.slint'] =
|
|
46
66
|
function (module, filename) {
|
|
47
67
|
var c = native.load(filename);
|
|
@@ -75,6 +95,7 @@ class NullPeer {
|
|
|
75
95
|
rowDataChanged(row) { }
|
|
76
96
|
rowAdded(row, count) { }
|
|
77
97
|
rowRemoved(row, count) { }
|
|
98
|
+
reset() { }
|
|
78
99
|
}
|
|
79
100
|
/**
|
|
80
101
|
* ArrayModel wraps a JavaScript array for use in `.slint` views. The underlying
|
package/native/Cargo.toml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
[package]
|
|
5
5
|
name = "slint-node"
|
|
6
|
-
version = "0.2.
|
|
6
|
+
version = "0.2.5"
|
|
7
7
|
authors = ["Slint Developers <info@slint-ui.com>"]
|
|
8
8
|
edition = "2021"
|
|
9
9
|
build = "build.rs"
|
|
@@ -20,9 +20,9 @@ crate-type = ["cdylib"]
|
|
|
20
20
|
name = "slint_node_native"
|
|
21
21
|
|
|
22
22
|
[dependencies]
|
|
23
|
-
i-slint-compiler = { version = "=0.2.
|
|
24
|
-
i-slint-core = { version = "=0.2.
|
|
25
|
-
slint-interpreter = { version = "=0.2.
|
|
23
|
+
i-slint-compiler = { version = "=0.2.5"}
|
|
24
|
+
i-slint-core = { version = "=0.2.5"}
|
|
25
|
+
slint-interpreter = { version = "=0.2.5", features = ["display-diagnostics"] }
|
|
26
26
|
|
|
27
27
|
vtable = { version = "0.1.6"}
|
|
28
28
|
|