-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebview.ts
27 lines (24 loc) · 853 Bytes
/
webview.ts
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
import { fromWebviewContract, fromClientContract } from "./shared.ts";
import { contract } from "@yannbcf/altv-rpc";
contract.setupRouter("web", fromClientContract, {
// @ts-expect-error method exposed in the alt:V webengine (cef)
on: alt.on,
// @ts-expect-error method exposed in the alt:V webengine (cef)
off: alt.off,
// @ts-expect-error method exposed in the alt:V webengine (cef)
emit: alt.emit
}, {
// args: { speedo: number }
updateUi: (args) => {
//
}
});
const rpc = contract.init("web", fromWebviewContract, {
// @ts-expect-error method exposed in the alt:V webengine (cef)
once: alt.once,
// @ts-expect-error method exposed in the alt:V webengine (cef)
off: alt.off,
// @ts-expect-error method exposed in the alt:V webengine (cef)
emit: alt.emit
});
rpc.inventoryMove();