Talaria/native/src/talaria.udl

44 lines
818 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? last_message;
boolean pinned;
};
namespace talaria {
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void init_database(string path);
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void init_client();
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
boolean need_login();
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
u64 request_login_code(string phone);
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void sign_in(u64 tokenPtr, string code);
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
sequence<Dialog> get_dialogs();
2022-10-27 17:33:35 +00:00
[Throws=NativeError]
void send_message(string packed, string text);
};