2022-02-06 17:25:32 +09:00
|
|
|
#![allow(dead_code)]
|
2022-03-13 19:28:41 +09:00
|
|
|
#![allow(unreachable_code)]
|
2022-08-20 00:36:36 +09:00
|
|
|
#![allow(clippy::disallowed_names)]
|
2023-01-28 22:31:57 +09:00
|
|
|
#![allow(clippy::uninlined_format_args)]
|
2022-02-06 17:25:32 +09:00
|
|
|
|
2023-01-31 21:36:59 +09:00
|
|
|
use napi::{Env, JsUnknown};
|
|
|
|
|
2021-09-23 02:29:09 +09:00
|
|
|
#[macro_use]
|
|
|
|
extern crate napi_derive;
|
2021-09-24 18:01:54 +09:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde_derive;
|
2021-09-23 02:29:09 +09:00
|
|
|
|
2022-12-09 19:56:50 +09:00
|
|
|
#[cfg(feature = "snmalloc")]
|
|
|
|
#[global_allocator]
|
|
|
|
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
|
|
|
|
|
2021-11-10 20:04:36 +09:00
|
|
|
#[napi]
|
2021-11-29 13:54:45 +09:00
|
|
|
/// This is a const
|
2021-11-10 20:04:36 +09:00
|
|
|
pub const DEFAULT_COST: u32 = 12;
|
|
|
|
|
2021-12-19 21:17:54 +09:00
|
|
|
#[napi(skip_typescript)]
|
|
|
|
pub const TYPE_SKIPPED_CONST: u32 = 12;
|
|
|
|
|
2021-09-23 02:29:09 +09:00
|
|
|
mod array;
|
2021-10-25 01:00:31 +09:00
|
|
|
mod r#async;
|
2021-11-11 01:33:51 +09:00
|
|
|
mod bigint;
|
2021-09-23 02:29:09 +09:00
|
|
|
mod callback;
|
|
|
|
mod class;
|
2021-11-05 19:31:36 +09:00
|
|
|
mod class_factory;
|
2022-02-06 21:42:48 +09:00
|
|
|
mod date;
|
2021-11-02 01:34:19 +09:00
|
|
|
mod either;
|
2021-09-23 02:29:09 +09:00
|
|
|
mod r#enum;
|
2021-09-24 10:46:27 +09:00
|
|
|
mod error;
|
2021-11-21 17:11:15 +09:00
|
|
|
mod external;
|
2022-03-06 00:19:51 +09:00
|
|
|
mod fn_strict;
|
2021-11-26 18:26:14 +09:00
|
|
|
mod fn_ts_override;
|
2022-05-06 18:40:46 +09:00
|
|
|
mod generator;
|
2021-11-23 20:00:31 +09:00
|
|
|
mod js_mod;
|
2021-12-19 00:16:09 +09:00
|
|
|
mod map;
|
2021-09-23 02:29:09 +09:00
|
|
|
mod nullable;
|
|
|
|
mod number;
|
|
|
|
mod object;
|
2021-11-13 21:51:14 +09:00
|
|
|
mod promise;
|
2022-03-21 17:36:06 +09:00
|
|
|
mod reference;
|
2021-09-28 01:01:19 +09:00
|
|
|
mod serde;
|
2023-03-21 19:12:52 +09:00
|
|
|
mod shared;
|
2021-09-23 02:29:09 +09:00
|
|
|
mod string;
|
2021-11-16 00:09:44 +09:00
|
|
|
mod symbol;
|
2021-11-02 21:36:34 +09:00
|
|
|
mod task;
|
2021-11-12 18:22:57 +09:00
|
|
|
mod threadsafe_function;
|
2021-10-08 22:13:27 +09:00
|
|
|
mod typed_array;
|
2023-01-31 21:36:59 +09:00
|
|
|
|
|
|
|
#[napi]
|
|
|
|
pub fn run_script(env: Env, script: String) -> napi::Result<JsUnknown> {
|
2023-02-06 01:52:59 +09:00
|
|
|
env.run_script(script)
|
2023-01-31 21:36:59 +09:00
|
|
|
}
|