denops_rust/
lib.rs

1/*!
2
3# Denops Rust library
4
5## About
6
7Read this [article](https://zenn.dev/kkiyama117/articles/2021-03-01-denops-rust) also.
8
9## Todo
10
11- [ ] Add type and trait wrapping `denops-deno` and `denops-deno-std`
12
13## 🛠️ Build
14
15## LICENSE
16
17This program is dual licensed by MIT and apache because of its dependencies.
18See each licence also. ([`LICENSE`](https://github.com/kkiyama117/denops-rust/blob/main/LICENSE) and [`LICENSE_APACHE`](https://github.com/kkiyama117/denops-rust/blob/main/LICENSE_APACHE))
19
20## Relations
21
22- https://github.com/vim-denops/denops-deno
23- https://github.com/vim-denops/denops-std-deno
24
25## Info
26
27- https://github.com/rustwasm/wasm-pack/issues/672
28
29*/
30// extern WASM calls are wrapped in unsafe,
31// but they don't technically have to be.
32#![deny(unused_unsafe)]
33
34#[cfg(target_arch = "wasm32")]
35#[cfg(feature = "console")]
36#[macro_use]
37pub mod console;
38
39#[cfg(target_arch = "wasm32")]
40#[cfg(feature = "variable")]
41pub mod variable;
42
43#[cfg(target_arch = "wasm32")]
44#[cfg(feature = "execute")]
45pub mod execute;
46
47#[cfg(target_arch = "wasm32")]
48#[cfg(feature = "autocmd")]
49pub mod autocmd;
50
51#[cfg(target_arch = "wasm32")]
52pub(crate) mod denops;
53
54use wasm_bindgen::prelude::*;
55
56#[wasm_bindgen(module = "https://deno.land/x/denops_std/mod.ts")]
57extern {
58    // https://deno.land/x/denops_std/vim/vim.ts
59    pub type Vim;
60}