Skip to main content

subtr_actor/
ts_bindings.rs

1use ts_rs::TS;
2
3#[derive(Debug, Clone, Copy, PartialEq, TS)]
4#[ts(export)]
5pub struct Vector3fTs {
6    pub x: f32,
7    pub y: f32,
8    pub z: f32,
9}
10
11#[derive(Debug, Clone, Copy, PartialEq, TS)]
12#[ts(export)]
13pub struct QuaternionTs {
14    pub x: f32,
15    pub y: f32,
16    pub z: f32,
17    pub w: f32,
18}
19
20#[derive(Debug, Clone, PartialEq, TS)]
21#[ts(export)]
22pub struct RigidBodyTs {
23    pub sleeping: bool,
24    pub location: Vector3fTs,
25    pub rotation: QuaternionTs,
26    pub linear_velocity: Option<Vector3fTs>,
27    pub angular_velocity: Option<Vector3fTs>,
28}
29
30#[derive(Debug, Clone, PartialEq, Eq, Hash, TS)]
31#[ts(export)]
32pub struct PsyNetIdTs {
33    pub online_id: String,
34    pub unknown1: Vec<u8>,
35}
36
37#[derive(Debug, Clone, PartialEq, Eq, Hash, TS)]
38#[ts(export)]
39pub struct SwitchIdTs {
40    pub online_id: String,
41    pub unknown1: Vec<u8>,
42}
43
44#[derive(Debug, Clone, PartialEq, Eq, Hash, TS)]
45#[ts(export)]
46pub struct Ps4IdTs {
47    pub online_id: String,
48    pub name: String,
49    pub unknown1: Vec<u8>,
50}
51
52#[derive(Debug, Clone, PartialEq, Eq, Hash, TS)]
53#[ts(export)]
54pub enum RemoteIdTs {
55    PlayStation(Ps4IdTs),
56    PsyNet(PsyNetIdTs),
57    SplitScreen(u32),
58    Steam(String),
59    Switch(SwitchIdTs),
60    Xbox(String),
61    QQ(String),
62    Epic(String),
63}
64
65#[derive(Debug, Clone, PartialEq, TS)]
66#[ts(export)]
67pub enum HeaderPropTs {
68    Array(Vec<Vec<(String, HeaderPropTs)>>),
69    Bool(bool),
70    Byte {
71        kind: String,
72        value: Option<String>,
73    },
74    Float(f32),
75    Int(i32),
76    Name(String),
77    QWord(String),
78    Str(String),
79    Struct {
80        name: String,
81        fields: Vec<(String, HeaderPropTs)>,
82    },
83}