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
use js_sys::{JsString, Object};
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = JsString, typescript_type = "PlayerID")]
#[derive(Clone, Debug, PartialEq, Eq)]
pub type PlayerID;
}
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen]
pub static this_player_id: PlayerID;
}
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = Object, typescript_type = "(typeof players)")]
#[derive(Clone, Debug)]
pub type Players;
#[wasm_bindgen(method, getter)]
pub fn p1(this: &Players) -> PlayerID;
#[wasm_bindgen(method, getter)]
pub fn p2(this: &Players) -> PlayerID;
#[wasm_bindgen]
pub static players: Players;
}