-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBasic.ets
43 lines (42 loc) · 1.18 KB
/
Basic.ets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import basic from 'libbasic.so';
import log from '../utils/log';
@Entry
@Component
struct Basic {
build() {
Row() {
Column({ space: 20 }) {
Button('Get Boolean').onClick(() => {
const b = basic.getBool();
log.info(b.toString());
})
Button("Get Number").onClick(() => {
const n = basic.getNumber();
log.info(n.toString());
})
Button("Get Undefined").onClick(() => {
const u = basic.getUndefined();
log.info("undefined: ", String(typeof u === 'undefined'));
})
Button('Get Null').onClick(() => {
const n = basic.getNull();
log.info("null: ", String(typeof n === 'object' && n === null));
})
Button('Get Array').onClick(() => {
const a = basic.getArray();
log.info(String(a));
})
Button('Bigint').onClick(() => {
const r = basic.bigintAdd(BigInt(100), BigInt(200));
log.info(String(r));
})
Button("Get Object").onClick(() => {
const o = basic.getObject();
log.info(JSON.stringify(o));
})
}
.width('100%')
}
.height('100%')
}
}