Talaria/native/src/talaria.udl

44 lines
809 B
Plaintext
Raw Normal View History

2022-10-27 17:33:35 +00:00
[Error]
enum NativeError {
"Initialization",
"Database",
"Network",
};
2022-10-27 16:08:57 +00:00
enum MessageAck {
"Received",
"Seen",
"Sent",
};
dictionary MessagePreview {
string sender;
string text;
timestamp date;
MessageAck ack;
};
dictionary Dialog {
string id;
string title;
MessagePreview? lastMessage;
boolean pinned;
};
namespace talaria {
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void initDatabase(string path);
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void initClient();
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
boolean needLogin();
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
u64 requestLoginCode(string phone);
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void signIn(u64 tokenPtr, string code);
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
sequence<Dialog> getDialogs();
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void sendMessage(string packed, string text);
};