Skip to content

Commit

Permalink
Update some docstrings for overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Jul 10, 2024
1 parent 6187732 commit 651f8bb
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4631,7 +4631,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
}

/**
* TODO: update docstring for overloads
* @param eventObject - An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.
* @param txnId - Optional.
* @returns Promise which resolves: to an empty object `{}`
Expand All @@ -4643,6 +4642,14 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
eventObject: Partial<IEvent>,
txnId?: string,
): Promise<ISendEventResponse>;
/**
* Sends the event as a future (MSC4140).
* @param eventObject - An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.
* @param futureOpts - Properties of the future to send for this event.
* @param txnId - Optional.
* @returns Promise which resolves: to an empty object `{}`
* @returns Rejects: with an error response.
*/
private sendCompleteEvent<F extends ISendFutureRequestOpts>(
roomId: string,
threadId: string | null,
Expand Down Expand Up @@ -4730,11 +4737,16 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
}

/**
* TODO: update docstring for overloads
* encrypts the event if necessary; adds the event to the queue, or sends it; marks the event as sent/unsent
* @returns returns a promise which resolves with the result of the send request
*/
protected async encryptAndSendEvent(room: Room | null, event: MatrixEvent): Promise<ISendEventResponse>;
/**
* Simply sends a future without encrypting it.
* TODO: Allow encrypted futures, and encrypt them properly
* @param futureOpts - Properties of the future to send for this event.
* @returns returns a promise which resolves with the result of the future send request
*/
protected async encryptAndSendEvent<F extends ISendFutureRequestOpts>(
room: Room | null,
event: MatrixEvent,
Expand All @@ -4745,7 +4757,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
event: MatrixEvent,
futureOpts?: F,
): Promise<ISendEventResponse | ISendFutureResponse<F>> {
// TODO: Allow encrypted futures, and encrypt them properly
if (futureOpts) {
return this.sendEventHttpRequest(event, futureOpts);
}
Expand Down

0 comments on commit 651f8bb

Please sign in to comment.