-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotocol_types.py
More file actions
42 lines (29 loc) · 773 Bytes
/
Copy pathprotocol_types.py
File metadata and controls
42 lines (29 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict, Optional, List, Union, TypedDict
JsonValue = Union[None, bool, int, float, str, List["JsonValue"], Dict[str, "JsonValue"]]
class RpcRequest(TypedDict, total=False):
jsonrpc: str
id: Union[str, int]
method: str
params: Dict[str, Any]
class RpcError(TypedDict):
code: int
message: str
data: Optional[JsonValue]
class RpcResponse(TypedDict, total=False):
jsonrpc: str
id: Union[str, int, None]
result: Optional[JsonValue]
error: Optional[RpcError]
@dataclass
class PaneInfo:
id: str
workdir: str
father: Optional[str] = None
@dataclass
class Message:
id: int
from_id: str
text: str
ts: float