vitium_api/
lib.rs

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