matrix-rust-sdk/bindings/matrix-sdk-ffi/src/api.udl

170 lines
4.0 KiB
Plaintext

namespace matrix_sdk_ffi {};
callback interface ClientDelegate {
void did_receive_auth_error(boolean is_soft_logout);
};
callback interface NotificationDelegate {
void did_receive_notification(NotificationItem notification);
};
dictionary NotificationItem {
TimelineEvent event;
string room_id;
string? sender_display_name;
string? sender_avatar_url;
string room_display_name;
string? room_avatar_url;
boolean is_noisy;
boolean is_direct;
boolean is_encrypted;
};
interface TimelineEvent {};
dictionary UpdateSummary {
sequence<string> lists;
sequence<string> rooms;
};
callback interface SlidingSyncObserver {
void did_receive_sync_update(UpdateSummary summary);
};
enum SlidingSyncState {
/// Sliding Sync has not started to load anything yet.
"NotLoaded",
/// Sliding Sync has been preloaded, i.e. restored from a cache for example.
"Preloaded",
/// We are trying to load all remaining rooms, might be in batches
/// Updates are received from the loaded rooms, and new rooms are being fetched
/// in background
"PartiallyLoaded",
/// Updates are received for all the loaded rooms, and all rooms have been
/// loaded!
"FullyLoaded",
};
enum SlidingSyncMode {
/// Sync up the entire room list first, page by page
"Paging",
/// Sync up the entire room list first through a growing window
"Growing",
/// Only ever sync the currently selected window
"Selective",
};
callback interface SlidingSyncListStateObserver {
void did_receive_update(SlidingSyncState new_state);
};
[Enum]
interface RoomListEntry {
Empty();
Invalidated(string room_id);
Filled(string room_id);
};
[Enum]
interface SlidingSyncListRoomsListDiff {
Append(sequence<RoomListEntry> values);
Insert(u32 index, RoomListEntry value);
Set(u32 index, RoomListEntry value);
Remove(u32 index);
PushBack(RoomListEntry value);
PushFront(RoomListEntry value);
PopBack();
PopFront();
Clear();
Reset(sequence<RoomListEntry> values);
};
callback interface SlidingSyncListRoomListObserver {
void did_receive_update(SlidingSyncListRoomsListDiff diff);
};
callback interface SlidingSyncListRoomsCountObserver {
void did_receive_update(u32 count);
};
callback interface SlidingSyncListRoomItemsObserver {
void did_receive_update();
};
interface SlidingSyncList {};
callback interface SlidingSyncListOnceBuilt {
SlidingSyncList update_list(SlidingSyncList list);
};
dictionary CreateRoomParameters {
string? name;
string? topic = null;
boolean is_encrypted;
boolean is_direct = false;
RoomVisibility visibility;
RoomPreset preset;
sequence<string>? invite = null;
string? avatar = null;
};
enum RoomVisibility {
/// Indicates that the room will be shown in the published room list.
"Public",
/// Indicates that the room will not be shown in the published room list.
"Private",
};
enum RoomPreset {
/// `join_rules` is set to `invite` and `history_visibility` is set to
/// `shared`.
"PrivateChat",
/// `join_rules` is set to `public` and `history_visibility` is set to
/// `shared`.
"PublicChat",
/// Same as `PrivateChat`, but all initial invitees get the same power level
/// as the creator.
"TrustedPrivateChat",
};
interface RoomMember { };
callback interface TimelineListener {
void on_update(TimelineDiff update);
};
interface TimelineItem {};
interface TimelineDiff {};
dictionary MoveData {
u32 old_index;
u32 new_index;
};
[Enum]
interface PaginationOptions {
SingleRequest(u16 event_limit);
UntilNumItems(u16 event_limit, u16 items);
};
interface RoomMessageEventContent {};
interface MediaSource {
string url();
};
interface SessionVerificationEmoji {};
callback interface SessionVerificationControllerDelegate {
void did_accept_verification_request();
void did_start_sas_verification();
void did_receive_verification_data(sequence<SessionVerificationEmoji> data);
void did_fail();
void did_cancel();
void did_finish();
};