Misha Krieger-Raynauld | addd6fe | 2022-10-22 12:46:04 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 Savoir-faire Linux Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Affero General Public License as |
| 6 | * published by the Free Software Foundation; either version 3 of the |
| 7 | * License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Affero General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Affero General Public |
| 15 | * License along with this program. If not, see |
| 16 | * <https://www.gnu.org/licenses/>. |
| 17 | */ |
Misha Krieger-Raynauld | 8a381da | 2022-11-03 17:37:51 -0400 | [diff] [blame] | 18 | import { AccountDetails, Message, VolatileDetails } from 'jami-web-common'; |
Misha Krieger-Raynauld | 68a9b56 | 2022-10-28 19:47:46 -0400 | [diff] [blame] | 19 | |
| 20 | // These interfaces are used to hold all the parameters for signal handlers |
| 21 | // These parameters' names and types can be found in daemon/bin/nodejs/callback.h |
| 22 | // or in their relevant SWIG interface files (.i) in daemon/bin/nodejs |
| 23 | |
| 24 | export interface AccountDetailsChanged { |
| 25 | accountId: string; |
| 26 | details: AccountDetails; |
| 27 | } |
| 28 | |
Misha Krieger-Raynauld | addd6fe | 2022-10-22 12:46:04 -0400 | [diff] [blame] | 29 | export interface VolatileDetailsChanged { |
| 30 | accountId: string; |
Misha Krieger-Raynauld | 68a9b56 | 2022-10-28 19:47:46 -0400 | [diff] [blame] | 31 | details: VolatileDetails; |
Misha Krieger-Raynauld | addd6fe | 2022-10-22 12:46:04 -0400 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | export interface RegistrationStateChanged { |
| 35 | accountId: string; |
| 36 | state: string; |
| 37 | code: number; |
| 38 | details: string; |
| 39 | } |
| 40 | |
| 41 | export interface NameRegistrationEnded { |
| 42 | accountId: string; |
| 43 | state: number; |
| 44 | username: string; |
| 45 | } |
| 46 | |
| 47 | export interface RegisteredNameFound { |
| 48 | accountId: string; |
| 49 | state: number; |
| 50 | address: string; |
| 51 | username: string; |
| 52 | } |
Charlie | b62c678 | 2022-10-30 15:14:56 -0400 | [diff] [blame] | 53 | |
Misha Krieger-Raynauld | 68a9b56 | 2022-10-28 19:47:46 -0400 | [diff] [blame] | 54 | export interface KnownDevicesChanged { |
| 55 | accountId: string; |
| 56 | devices: Record<string, string>; |
| 57 | } |
| 58 | |
Charlie | b62c678 | 2022-10-30 15:14:56 -0400 | [diff] [blame] | 59 | export interface IncomingAccountMessage { |
| 60 | accountId: string; |
| 61 | from: string; |
Misha Krieger-Raynauld | cb11bba | 2022-11-11 18:08:33 -0500 | [diff] [blame] | 62 | payload: Record<string, string>; |
| 63 | } |
| 64 | |
| 65 | export interface AccountMessageStatusChanged { |
| 66 | accountId: string; |
| 67 | messageId: string; |
| 68 | peer: string; |
| 69 | state: number; // TODO: Replace state number with enum (see account_const.h) |
| 70 | } |
| 71 | |
| 72 | export interface ContactAdded { |
| 73 | accountId: string; |
| 74 | contactId: string; |
| 75 | confirmed: boolean; |
| 76 | } |
| 77 | |
| 78 | export interface ContactRemoved { |
| 79 | accountId: string; |
| 80 | contactId: string; |
| 81 | banned: boolean; |
Charlie | b62c678 | 2022-10-30 15:14:56 -0400 | [diff] [blame] | 82 | } |
Misha Krieger-Raynauld | 68a9b56 | 2022-10-28 19:47:46 -0400 | [diff] [blame] | 83 | |
| 84 | export interface ConversationReady { |
| 85 | accountId: string; |
| 86 | conversationId: string; |
| 87 | } |
| 88 | |
| 89 | export interface ConversationRemoved { |
| 90 | accountId: string; |
| 91 | conversationId: string; |
| 92 | } |
| 93 | |
| 94 | export interface ConversationLoaded { |
| 95 | id: number; |
| 96 | accountId: string; |
| 97 | conversationId: string; |
Misha Krieger-Raynauld | 8a381da | 2022-11-03 17:37:51 -0400 | [diff] [blame] | 98 | messages: Message[]; |
Misha Krieger-Raynauld | 68a9b56 | 2022-10-28 19:47:46 -0400 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | export interface MessageReceived { |
| 102 | accountId: string; |
| 103 | conversationId: string; |
Misha Krieger-Raynauld | 8a381da | 2022-11-03 17:37:51 -0400 | [diff] [blame] | 104 | message: Message; |
Misha Krieger-Raynauld | 68a9b56 | 2022-10-28 19:47:46 -0400 | [diff] [blame] | 105 | } |