napi-rs/test_module/src/napi5/mod.rs
LongYinan 1a3621b727
feat(napi): major upgrades for napi@1
1. inline everything
2. change `check_status` and `type_of` to macro
3. provide #[module_exports] macro
4. remove debug and repr[transparent] for ffi struct
2020-11-26 11:31:49 +08:00

10 lines
344 B
Rust

use napi::{JsObject, Result};
mod date;
pub fn register_js(exports: &mut JsObject) -> Result<()> {
exports.create_named_method("testObjectIsDate", date::test_object_is_date)?;
exports.create_named_method("testCreateDate", date::test_create_date)?;
exports.create_named_method("testGetDateValue", date::test_get_date_value)?;
Ok(())
}