perspective_js/
lib.rs

1// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2// ┃ ██████ ██████ ██████       █      █      █      █      █ █▄  ▀███ █       ┃
3// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█  ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄  ▀█ █ ▀▀▀▀▀ ┃
4// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄   █ ▄▄▄▄▄ ┃
5// ┃ █      ██████ █  ▀█▄       █ ██████      █      ███▌▐███ ███████▄ █       ┃
6// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
7// ┃ Copyright (c) 2017, the Perspective Authors.                              ┃
8// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
9// ┃ This file is part of the Perspective library, distributed under the terms ┃
10// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
11// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
13#![warn(
14    clippy::all,
15    clippy::panic_in_result_fn,
16    clippy::await_holding_refcell_ref,
17    unstable_features
18)]
19#![allow(non_snake_case)]
20
21extern crate alloc;
22
23mod client;
24mod table;
25pub mod utils;
26mod view;
27
28#[cfg(feature = "export-init")]
29use wasm_bindgen::prelude::*;
30
31pub use crate::client::Client;
32pub use crate::table::*;
33
34#[cfg(feature = "export-init")]
35#[wasm_bindgen(typescript_custom_section)]
36const TS_APPEND_CONTENT: &'static str = r#"
37export type * from "../../src/ts/ts-rs/ViewWindow.d.ts";
38export type * from "../../src/ts/ts-rs/TableInitOptions.d.ts";
39export type * from "../../src/ts/ts-rs/ViewConfigUpdate.d.ts";
40export type * from "../../src/ts/ts-rs/ViewOnUpdateResp.d.ts";
41export type * from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
42export type * from "../../src/ts/ts-rs/UpdateOptions.d.ts";
43
44import type {ViewWindow} from "../../src/ts/ts-rs/ViewWindow.d.ts";
45import type {TableInitOptions} from "../../src/ts/ts-rs/TableInitOptions.d.ts";
46import type {ViewConfigUpdate} from "../../src/ts/ts-rs/ViewConfigUpdate.d.ts";
47import type * as on_update_args from "../../src/ts/ts-rs/ViewOnUpdateResp.d.ts";
48import type {OnUpdateOptions} from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
49import type {UpdateOptions} from "../../src/ts/ts-rs/UpdateOptions.d.ts";
50"#;
51
52#[cfg(feature = "export-init")]
53#[wasm_bindgen]
54pub fn init() {
55    console_error_panic_hook::set_once();
56    utils::set_global_logging();
57}