vitium_api/
lib.rs

1pub mod cmd;
2pub mod game;
3pub mod net;
4pub mod prelude;
5pub mod uid;
6pub mod user;
7
8pub use prelude::*;
9
10#[cfg_attr(target_family = "wasm", tsify_next::declare)]
11pub type Dice = String;
12
13/// This is some documentation.
14#[cfg_attr(target_family = "wasm", wasm_bindgen::prelude::wasm_bindgen)]
15pub fn add(left: usize, right: usize) -> usize {
16    left + right
17}
18
19#[cfg_attr(
20    target_family = "wasm",
21    wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
22)]
23const _TS_APPEND_CONTENT: &'static str = r#"
24export type Id<T> = string
25"#;
26
27#[cfg(test)]
28mod tests {
29    use super::*;
30
31    #[test]
32    fn it_works() {
33        let result = add(2, 2);
34        assert_eq!(result, 4);
35    }
36}