1+ /*! Rust-TypeScript interop for categorical logic.
2+
3+ This crate provides [WebAssembly](https://webassembly.org/) (Wasm) bindings for
4+ the [`catlog`] crate using Rust's `wasm-bindgen`. The aim is to keep the logic
5+ here as simple as possible, with [`catlog`] doing all the real work. However,
6+ the translation is nontrivial because there is a single, catch-all type
7+ definition for a double theory in TypeScript, but several kinds of double
8+ theories implemented in Rust (discrete theories, modal theories, and so on). The
9+ same is true for other structures, such as models of theories and diagrams in
10+ models.
11+ */
12+
13+ #![ warn( missing_docs) ]
14+
115pub mod notation;
216pub mod result;
317
@@ -8,6 +22,7 @@ pub mod theory;
822
923pub mod analyses;
1024#[ allow( clippy:: new_without_default) ]
25+ #[ allow( missing_docs) ]
1126pub mod theories;
1227
1328use wasm_bindgen:: prelude:: * ;
@@ -29,14 +44,16 @@ export type Ustr = string;
2944export type NonEmpty<T> = Array<T>;
3045"# ;
3146
47+ /** Set panic hook to get better error messages on panics.
48+
49+ When the `console_error_panic_hook` feature is enabled, we can call the
50+ `set_panic_hook` function at least once during initialization, and then we will
51+ get better error messages if our code ever panics.
52+
53+ For more details see <https://github.com/rustwasm/console_error_panic_hook#readme>
54+ */
3255#[ wasm_bindgen]
3356pub fn set_panic_hook ( ) {
34- // When the `console_error_panic_hook` feature is enabled, we can call the
35- // `set_panic_hook` function at least once during initialization, and then
36- // we will get better error messages if our code ever panics.
37- //
38- // For more details see
39- // https://github.com/rustwasm/console_error_panic_hook#readme
4057 #[ cfg( feature = "console_error_panic_hook" ) ]
4158 console_error_panic_hook:: set_once ( ) ;
4259}
0 commit comments