2024-08-06 23:28:09 +02:00
|
|
|
from typing import Tuple
|
|
|
|
|
|
|
|
class PyLogger:
|
2024-08-09 09:14:27 +02:00
|
|
|
def __init__(self, debug) -> None: ...
|
|
|
|
async def listen(self) -> str | None: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
|
|
|
|
|
2024-08-09 09:14:27 +02:00
|
|
|
class TextChange:
|
|
|
|
start: int
|
|
|
|
end: int
|
2024-08-06 23:28:09 +02:00
|
|
|
content: str
|
|
|
|
|
|
|
|
def is_deletion(self) -> bool: ...
|
|
|
|
def is_addition(self) -> bool: ...
|
|
|
|
def is_empty(self) -> bool: ...
|
|
|
|
def apply(self, txt: str) -> str: ...
|
2024-08-09 09:14:27 +02:00
|
|
|
def from_diff(self, before: str, after: str) -> TextChange: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
def index_to_rowcol(self, txt: str, index: int) -> Tuple[int, int]: ...
|
|
|
|
|
|
|
|
|
2024-08-09 09:14:27 +02:00
|
|
|
class BufferController:
|
2024-08-06 23:28:09 +02:00
|
|
|
def content(self) -> str: ...
|
|
|
|
def send(self, start: int, end: int, txt: str) -> None: ...
|
2024-08-09 09:14:27 +02:00
|
|
|
async def try_recv(self) -> TextChange | None: ...
|
|
|
|
async def recv(self) -> TextChange: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
async def poll(self) -> None: ...
|
|
|
|
|
|
|
|
|
2024-08-09 09:14:27 +02:00
|
|
|
|
|
|
|
class Cursor:
|
2024-08-06 23:28:09 +02:00
|
|
|
start: Tuple[int, int]
|
|
|
|
end: Tuple[int, int]
|
|
|
|
buffer: str
|
|
|
|
user: str # can be an empty string
|
|
|
|
|
|
|
|
|
2024-08-09 09:14:27 +02:00
|
|
|
class CursorController:
|
2024-08-06 23:28:09 +02:00
|
|
|
def send(self, path: str, start: Tuple[int, int], end: Tuple[int, int]) -> None: ...
|
2024-08-09 09:14:27 +02:00
|
|
|
def try_recv(self) -> Cursor | None: ...
|
|
|
|
async def recv(self) -> Cursor: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
async def poll(self) -> None: ...
|
2024-08-09 09:14:27 +02:00
|
|
|
def stop(self) -> bool: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
|
|
|
|
|
2024-08-09 09:14:27 +02:00
|
|
|
class Workspace:
|
2024-08-06 23:28:09 +02:00
|
|
|
async def create(self, path: str) -> None: ...
|
2024-08-09 09:14:27 +02:00
|
|
|
async def attach(self, path: str) -> BufferController: ...
|
|
|
|
def detach(self, path: str) -> bool: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
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: ...
|
2024-08-09 09:14:27 +02:00
|
|
|
def cursor(self) -> CursorController: ...
|
|
|
|
def buffer_by_name(self, path: str) -> BufferController | None: ...
|
|
|
|
def buffer_list(self) -> list[str]: ...
|
2024-08-06 23:28:09 +02:00
|
|
|
def filetree(self) -> list[str]: ...
|
|
|
|
|
|
|
|
|
|
|
|
class Client:
|
2024-08-09 09:14:27 +02:00
|
|
|
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: ...
|