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
extern crate alloc;

mod code_gen;
mod utils;

pub mod registry;
pub mod type_info;

pub use code_gen::{generate_js, type_checking::ts::gen_ts_typings};

pub enum ArchPointerLen {
    U32,
    U64,
}

impl ArchPointerLen {
    #[allow(unused)]
    pub(crate) fn into_bytes(self) -> usize {
        match self {
            ArchPointerLen::U32 => 4,
            ArchPointerLen::U64 => 8,
        }
    }
}

/// Helper struct to pass the generated language strings to an export function.
pub struct ExportStrings {
    pub js_file: String,
    pub ts_file: String,
}