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
21mod client;
22mod table;
23pub mod utils;
24mod view;
25
26#[cfg(feature = "export-init")]
27use wasm_bindgen::prelude::*;
28
29pub use crate::client::Client;
30pub use crate::table::*;
31
32#[cfg(feature = "export-init")]
33#[wasm_bindgen(typescript_custom_section)]
34const TS_APPEND_CONTENT: &'static str = r#"
35export type * from "../../src/ts/ts-rs/ViewWindow.d.ts";
36export type * from "../../src/ts/ts-rs/TableInitOptions.d.ts";
37export type * from "../../src/ts/ts-rs/ViewConfigUpdate.d.ts";
38export type * from "../../src/ts/ts-rs/ViewOnUpdateResp.d.ts";
39export type * from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
40export type * from "../../src/ts/ts-rs/UpdateOptions.d.ts";
41
42import type {ViewWindow} from "../../src/ts/ts-rs/ViewWindow.d.ts";
43import type {TableInitOptions} from "../../src/ts/ts-rs/TableInitOptions.d.ts";
44import type {ViewConfigUpdate} from "../../src/ts/ts-rs/ViewConfigUpdate.d.ts";
45import type * as on_update_args from "../../src/ts/ts-rs/ViewOnUpdateResp.d.ts";
46import type {OnUpdateOptions} from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
47import type {UpdateOptions} from "../../src/ts/ts-rs/UpdateOptions.d.ts";
48"#;
49
50#[cfg(feature = "export-init")]
51#[wasm_bindgen]
52pub fn init() {
53    console_error_panic_hook::set_once();
54    utils::set_global_logging();
55}