aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--dist/py/src/codemp/codemp.pyi28
-rw-r--r--src/ffi/python/mod.rs3
2 files changed, 28 insertions, 3 deletions
diff --git a/dist/py/src/codemp/codemp.pyi b/dist/py/src/codemp/codemp.pyi
index 4b0afdc..f383f04 100644
--- a/dist/py/src/codemp/codemp.pyi
+++ b/dist/py/src/codemp/codemp.pyi
@@ -1,4 +1,4 @@
-from typing import Tuple, Optional, Callable
+from typing import Optional, Callable
def version() -> str: ...
@@ -61,8 +61,32 @@ class Client:
def current_user(self) -> User: ...
def refresh(self) -> Promise[None]: ...
+class FileTreeUpdated:
+ """
+ Fired when the file tree changes.
+ Contains the modified buffer path (deleted, created or renamed)
+ """
+ path: str
+
+class UserJoin:
+ """
+ Fired when a user joins the workspace
+ """
+ name: str
+
+class UserLeave:
+ """
+ Fired when a user leaves the workspace
+ """
+ name: str
+
class Event:
- pass
+ """
+ Workspace events to notify users of changes happening in the workspace.
+ """
+ FileTreeUpdated: FileTreeUpdated
+ UserJoin: UserJoin
+ UserLeave: UserLeave
class Workspace:
"""
diff --git a/src/ffi/python/mod.rs b/src/ffi/python/mod.rs
index 7032e16..a68e5e6 100644
--- a/src/ffi/python/mod.rs
+++ b/src/ffi/python/mod.rs
@@ -3,7 +3,7 @@ pub mod controllers;
pub mod workspace;
use crate::{
- api::{BufferUpdate, Config, Cursor, Selection, TextChange, User},
+ api::{BufferUpdate, Config, Cursor, Event, Selection, TextChange, User},
buffer::Controller as BufferController,
cursor::Controller as CursorController,
Client, Workspace,
@@ -391,6 +391,7 @@ fn codemp(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<User>()?;
m.add_class::<Workspace>()?;
+ m.add_class::<Event>()?;
m.add_class::<Client>()?;
m.add_class::<Config>()?;