codemp/dist/py/codemp.pyi

67 lines
2 KiB
Python
Raw Normal View History

from typing import Tuple
class PyLogger:
def __init__(self, debug) -> None: ...
async def listen(self) -> str | None: ...
class TextChange:
start: int
end: int
content: str
def is_deletion(self) -> bool: ...
def is_addition(self) -> bool: ...
def is_empty(self) -> bool: ...
def apply(self, txt: str) -> str: ...
def from_diff(self, before: str, after: str) -> TextChange: ...
def index_to_rowcol(self, txt: str, index: int) -> Tuple[int, int]: ...
class BufferController:
def content(self) -> str: ...
def send(self, start: int, end: int, txt: str) -> None: ...
async def try_recv(self) -> TextChange | None: ...
async def recv(self) -> TextChange: ...
async def poll(self) -> None: ...
class Cursor:
start: Tuple[int, int]
end: Tuple[int, int]
buffer: str
user: str # can be an empty string
class CursorController:
def send(self, path: str, start: Tuple[int, int], end: Tuple[int, int]) -> None: ...
def try_recv(self) -> Cursor | None: ...
async def recv(self) -> Cursor: ...
async def poll(self) -> None: ...
def stop(self) -> bool: ...
class Workspace:
async def create(self, path: str) -> None: ...
async def attach(self, path: str) -> BufferController: ...
def detach(self, path: str) -> bool: ...
async def fetch_buffers(self) -> None: ...
async def fetch_users(self) -> None: ...
async def list_buffer_users(self, path: str) -> list[str]: ...
async def delete(self, path: str) -> None: ...
def id(self) -> str: ...
def cursor(self) -> CursorController: ...
def buffer_by_name(self, path: str) -> BufferController | None: ...
def buffer_list(self) -> list[str]: ...
def filetree(self) -> list[str]: ...
class Client:
def __init__(self, host: str, username: str, password: str) -> None: ...
async def join_workspace(self, workspace: str) -> Workspace: ...
def leave_workspace(self, workspace: str) -> bool: ...
def get_workspace(self, id: str) -> Workspace: ...
def active_workspaces(self) -> list[str]: ...
def user_id(self) -> str: ...