use wasm_bindgen::prelude::*;
mod store;
mod raindocument;
pub use self::store::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console)]
pub fn log(s: &str);
#[wasm_bindgen(typescript_type = "IRainDocument")]
pub type IRainDocument;
#[wasm_bindgen(typescript_type = "IAuthoringMeta")]
pub type IAuthoringMeta;
#[wasm_bindgen(typescript_type = "Namespace")]
pub type Namespace;
}
#[wasm_bindgen(typescript_custom_section)]
const IAUTHORING_META_TS_INTERFACE: &'static str = r#"export type IAuthoringMeta = {
word: string,
description: string,
operandParserOffset: number,
}[]"#;
#[wasm_bindgen]
pub fn keccak256(data: &[u8]) -> Vec<u8> {
alloy_primitives::keccak256(data).0.to_vec()
}
#[wasm_bindgen(js_name = "eqBytes")]
pub fn eq_bytes(data1: &[u8], data2: &[u8]) -> bool {
data1 == data2
}
#[wasm_bindgen]
pub fn arrayify(hex: &str) -> Vec<u8> {
alloy_primitives::hex::decode(hex).unwrap_throw()
}
#[wasm_bindgen]
pub fn hexlify(data: &[u8]) -> String {
alloy_primitives::hex::encode_prefixed(data)
}