Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions dist/py/src/codemp/codemp.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Tuple, Optional, Callable
from typing import Optional, Callable

def version() -> str: ...

Expand Down Expand Up @@ -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:
"""
Expand Down
3 changes: 2 additions & 1 deletion src/ffi/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>()?;

Expand Down