mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 07:14:50 +01:00
fix: imports and types
This commit is contained in:
parent
039a54b8e2
commit
a318e3bc28
4 changed files with 9 additions and 17 deletions
|
@ -5,10 +5,6 @@ use crate::{
|
||||||
},
|
},
|
||||||
errors::ControllerError,
|
errors::ControllerError,
|
||||||
};
|
};
|
||||||
use crate::{
|
|
||||||
api::{Controller, Cursor},
|
|
||||||
errors::ControllerError,
|
|
||||||
};
|
|
||||||
use jni::{objects::JObject, JNIEnv};
|
use jni::{objects::JObject, JNIEnv};
|
||||||
use jni_toolbox::jni;
|
use jni_toolbox::jni;
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,6 @@ use crate::buffer::controller::BufferController;
|
||||||
use napi::threadsafe_function::{
|
use napi::threadsafe_function::{
|
||||||
ErrorStrategy::Fatal, ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode,
|
ErrorStrategy::Fatal, ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode,
|
||||||
};
|
};
|
||||||
use napi::threadsafe_function::{
|
|
||||||
ErrorStrategy::Fatal, ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode,
|
|
||||||
};
|
|
||||||
use napi_derive::napi;
|
|
||||||
use napi_derive::napi;
|
use napi_derive::napi;
|
||||||
|
|
||||||
#[napi]
|
#[napi]
|
||||||
|
@ -56,13 +52,15 @@ impl BufferController {
|
||||||
|
|
||||||
/// Return next buffer event if present
|
/// Return next buffer event if present
|
||||||
#[napi(js_name = "try_recv")]
|
#[napi(js_name = "try_recv")]
|
||||||
pub async fn js_try_recv(&self) -> napi::Result<Option<Delta<BufferAck>>> {
|
pub async fn js_try_recv(
|
||||||
|
&self,
|
||||||
|
) -> napi::Result<Option<Delta<crate::buffer::controller::BufferAck>>> {
|
||||||
Ok(self.try_recv().await?)
|
Ok(self.try_recv().await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Wait for next buffer event and return it
|
/// Wait for next buffer event and return it
|
||||||
#[napi(js_name = "recv")]
|
#[napi(js_name = "recv")]
|
||||||
pub async fn js_recv(&self) -> napi::Result<Delta<BufferAck>> {
|
pub async fn js_recv(&self) -> napi::Result<Delta<crate::buffer::controller::BufferAck>> {
|
||||||
Ok(self.recv().await?)
|
Ok(self.recv().await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
use crate::api::controller::{AsyncReceiver, AsyncSender};
|
use crate::api::controller::{AsyncReceiver, AsyncSender};
|
||||||
use crate::cursor::controller::CursorController;
|
use crate::cursor::controller::CursorController;
|
||||||
use napi::threadsafe_function::ErrorStrategy::Fatal;
|
use napi::threadsafe_function::ErrorStrategy::Fatal;
|
||||||
use napi::threadsafe_function::ErrorStrategy::Fatal;
|
|
||||||
use napi::threadsafe_function::{
|
use napi::threadsafe_function::{
|
||||||
ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode,
|
ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode,
|
||||||
};
|
};
|
||||||
use napi::threadsafe_function::{
|
|
||||||
ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode,
|
|
||||||
};
|
|
||||||
use napi_derive::napi;
|
|
||||||
use napi_derive::napi;
|
use napi_derive::napi;
|
||||||
|
|
||||||
#[napi(object, js_name = "Cursor")]
|
#[napi(object, js_name = "Cursor")]
|
||||||
|
|
|
@ -146,12 +146,15 @@ impl Workspace {
|
||||||
|
|
||||||
/// List users attached to a specific buffer
|
/// List users attached to a specific buffer
|
||||||
#[napi(js_name = "list_buffer_users")]
|
#[napi(js_name = "list_buffer_users")]
|
||||||
pub async fn js_list_buffer_users(&self, path: String) -> napi::Result<Vec<JsUser>> {
|
pub async fn js_list_buffer_users(
|
||||||
|
&self,
|
||||||
|
path: String,
|
||||||
|
) -> napi::Result<Vec<crate::ffi::js::client::JsUser>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.list_buffer_users(&path)
|
.list_buffer_users(&path)
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(JsUser::from)
|
.map(super::client::JsUser::from)
|
||||||
.collect())
|
.collect())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue