feat: buffer get name fn

This commit is contained in:
frelodev 2024-08-21 17:38:33 +02:00
parent 380bb58fb6
commit ed3673b92a
2 changed files with 5 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "@codemp/codemp", "name": "@codemp/codemp",
"version": "0.0.2", "version": "0.0.4",
"dependencies": { "dependencies": {
"@napi-rs/cli": "^2.18.0", "@napi-rs/cli": "^2.18.0",

View file

@ -31,6 +31,10 @@ impl BufferController {
}); });
Ok(()) Ok(())
} }
#[napi(js_name = "get_name")]
pub fn js_name(&self) -> napi::Result<&str> {
Ok(&self.name())
}
#[napi(js_name = "try_recv")] #[napi(js_name = "try_recv")]
pub async fn js_try_recv(&self) -> napi::Result<Option<TextChange>> { pub async fn js_try_recv(&self) -> napi::Result<Option<TextChange>> {