jsonrpc/events: commit type I forgot to commit (#3670)

commit line I forgot to commit
This commit is contained in:
Simon Laux
2022-10-15 20:35:30 +02:00
committed by GitHub
parent f80c78536f
commit e8ea9b7127
2 changed files with 17 additions and 16 deletions

View File

@@ -52,7 +52,7 @@ export type Event=(({
* should not be disturbed by a dialog or so. Instead, use a bubble or so. * should not be disturbed by a dialog or so. Instead, use a bubble or so.
* *
* However, for ongoing processes (eg. configure()) * However, for ongoing processes (eg. configure())
* or for functions that are expected to fail (eg. dc_continue_key_transfer()) * or for functions that are expected to fail (eg. autocryptContinueKeyTransfer())
* it might be better to delay showing these events until the function has really * it might be better to delay showing these events until the function has really
* failed (returned false). It should be sufficient to report only the *last* error * failed (returned false). It should be sufficient to report only the *last* error
* in a messasge box then. * in a messasge box then.
@@ -61,9 +61,9 @@ export type Event=(({
/** /**
* An action cannot be performed because the user is not in the group. * An action cannot be performed because the user is not in the group.
* Reported eg. after a call to * Reported eg. after a call to
* dc_set_chat_name(), dc_set_chat_profile_image(), * setChatName(), setChatProfileImage(),
* dc_add_contact_to_chat(), dc_remove_contact_from_chat(), * addContactToChat(), removeContactFromChat(),
* dc_send_text_msg() or another sending function. * and messages sending functions.
*/ */
"type":"ErrorSelfNotInGroup";}&{"msg":string;})|({ "type":"ErrorSelfNotInGroup";}&{"msg":string;})|({
/** /**
@@ -73,8 +73,8 @@ export type Event=(({
* - Chats created, deleted or archived * - Chats created, deleted or archived
* - A draft has been set * - A draft has been set
* *
* `chat_id` is set if only a single chat is affected by the changes, otherwise 0. * `chatId` is set if only a single chat is affected by the changes, otherwise 0.
* `msg_id` is set if only a single message is affected by the changes, otherwise 0. * `msgId` is set if only a single message is affected by the changes, otherwise 0.
*/ */
"type":"MsgsChanged";}&{"chatId":U32;"msgId":U32;})|({ "type":"MsgsChanged";}&{"chatId":U32;"msgId":U32;})|({
/** /**
@@ -91,24 +91,24 @@ export type Event=(({
"type":"MsgsNoticed";}&{"chatId":U32;})|({ "type":"MsgsNoticed";}&{"chatId":U32;})|({
/** /**
* A single message is sent successfully. State changed from DC_STATE_OUT_PENDING to * A single message is sent successfully. State changed from DC_STATE_OUT_PENDING to
* DC_STATE_OUT_DELIVERED, see dc_msg_get_state(). * DC_STATE_OUT_DELIVERED, see `Message.state`.
*/ */
"type":"MsgDelivered";}&{"chatId":U32;"msgId":U32;})|({ "type":"MsgDelivered";}&{"chatId":U32;"msgId":U32;})|({
/** /**
* A single message could not be sent. State changed from DC_STATE_OUT_PENDING or DC_STATE_OUT_DELIVERED to * A single message could not be sent. State changed from DC_STATE_OUT_PENDING or DC_STATE_OUT_DELIVERED to
* DC_STATE_OUT_FAILED, see dc_msg_get_state(). * DC_STATE_OUT_FAILED, see `Message.state`.
*/ */
"type":"MsgFailed";}&{"chatId":U32;"msgId":U32;})|({ "type":"MsgFailed";}&{"chatId":U32;"msgId":U32;})|({
/** /**
* A single message is read by the receiver. State changed from DC_STATE_OUT_DELIVERED to * A single message is read by the receiver. State changed from DC_STATE_OUT_DELIVERED to
* DC_STATE_OUT_MDN_RCVD, see dc_msg_get_state(). * DC_STATE_OUT_MDN_RCVD, see `Message.state`.
*/ */
"type":"MsgRead";}&{"chatId":U32;"msgId":U32;})|({ "type":"MsgRead";}&{"chatId":U32;"msgId":U32;})|({
/** /**
* Chat changed. The name or the image of a chat group was changed or members were added or removed. * Chat changed. The name or the image of a chat group was changed or members were added or removed.
* Or the verify state of a chat has changed. * Or the verify state of a chat has changed.
* See dc_set_chat_name(), dc_set_chat_profile_image(), dc_add_contact_to_chat() * See setChatName(), setChatProfileImage(), addContactToChat()
* and dc_remove_contact_from_chat(). * and removeContactFromChat().
* *
* This event does not include ephemeral timer modification, which * This event does not include ephemeral timer modification, which
* is a separate event. * is a separate event.
@@ -129,7 +129,7 @@ export type Event=(({
* *
* @param data1 (u32) contact_id of the contact for which the location has changed. * @param data1 (u32) contact_id of the contact for which the location has changed.
* If the locations of several contacts have been changed, * If the locations of several contacts have been changed,
* eg. after calling dc_delete_all_locations(), this parameter is set to `None`. * this parameter is set to `None`.
*/ */
"type":"LocationChanged";}&{"contactId":(U32|null);})|({ "type":"LocationChanged";}&{"contactId":(U32|null);})|({
/** /**
@@ -168,7 +168,7 @@ export type Event=(({
* (Alice, the person who shows the QR code). * (Alice, the person who shows the QR code).
* *
* These events are typically sent after a joiner has scanned the QR code * These events are typically sent after a joiner has scanned the QR code
* generated by dc_get_securejoin_qr(). * generated by getChatSecurejoinQrCodeSvg().
* *
* @param data1 (int) ID of the contact that wants to join. * @param data1 (int) ID of the contact that wants to join.
* @param data2 (int) Progress as: * @param data2 (int) Progress as:
@@ -181,7 +181,7 @@ export type Event=(({
/** /**
* Progress information of a secure-join handshake from the view of the joiner * Progress information of a secure-join handshake from the view of the joiner
* (Bob, the person who scans the QR code). * (Bob, the person who scans the QR code).
* The events are typically sent while dc_join_securejoin(), which * The events are typically sent while secureJoin(), which
* may take some time, is executed. * may take some time, is executed.
* @param data1 (int) ID of the inviting contact. * @param data1 (int) ID of the inviting contact.
* @param data2 (int) Progress as: * @param data2 (int) Progress as:
@@ -192,8 +192,8 @@ export type Event=(({
/** /**
* The connectivity to the server changed. * The connectivity to the server changed.
* This means that you should refresh the connectivity view * This means that you should refresh the connectivity view
* and possibly the connectivtiy HTML; see dc_get_connectivity() and * and possibly the connectivtiy HTML; see getConnectivity() and
* dc_get_connectivity_html() for details. * getConnectivityHtml() for details.
*/ */
"type":"ConnectivityChanged";}|{"type":"SelfavatarChanged";}|({"type":"WebxdcStatusUpdate";}&{"msgId":U32;"statusUpdateSerial":U32;})|({ "type":"ConnectivityChanged";}|{"type":"SelfavatarChanged";}|({"type":"WebxdcStatusUpdate";}&{"msgId":U32;"statusUpdateSerial":U32;})|({
/** /**

View File

@@ -28,6 +28,7 @@ type ContextEvents = { ALL: (event: Event) => void } & {
}; };
export type DcEvent = Event; export type DcEvent = Event;
export type DcEventType<T extends Event["type"]> = Extract<Event, { type: T }>
export class BaseDeltaChat< export class BaseDeltaChat<
Transport extends BaseTransport<any> Transport extends BaseTransport<any>