Better types for WebAPI

This commit is contained in:
Fedor Indutny 2021-09-21 17:58:03 -07:00 committed by GitHub
parent c05d23e628
commit b9d6497cb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 156 additions and 107 deletions

View file

@ -30,6 +30,7 @@ import {
GroupSendOptionsType,
SendOptionsType,
} from '../textsecure/SendMessage';
import { HTTPError } from '../textsecure/Errors';
import { IdentityKeys, SenderKeys, Sessions } from '../LibSignalStores';
import { ConversationModel } from '../models/conversations';
import { DeviceType, CallbackResultType } from '../textsecure/Types.d';
@ -696,7 +697,7 @@ function isIdentifierRegistered(identifier: string) {
return !isUnregistered;
}
async function handle409Response(logId: string, error: Error) {
async function handle409Response(logId: string, error: HTTPError) {
const parsed = multiRecipient409ResponseSchema.safeParse(error.response);
if (parsed.success) {
await _waitForAll({
@ -734,7 +735,7 @@ async function handle409Response(logId: string, error: Error) {
async function handle410Response(
conversation: ConversationModel,
error: Error
error: HTTPError
) {
const logId = conversation.idForLogging();