blob: a839309d0af3e5318f5331f7a511af49d4a73fac [file] [log] [blame]
Misha Krieger-Raynauldaddd6fe2022-10-22 12:46:04 -04001/*
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-Raynauld8a381da2022-11-03 17:37:51 -040018import { AccountDetails, Message, VolatileDetails } from 'jami-web-common';
Misha Krieger-Raynauld68a9b562022-10-28 19:47:46 -040019
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
24export interface AccountDetailsChanged {
25 accountId: string;
26 details: AccountDetails;
27}
28
Misha Krieger-Raynauldaddd6fe2022-10-22 12:46:04 -040029export interface VolatileDetailsChanged {
30 accountId: string;
Misha Krieger-Raynauld68a9b562022-10-28 19:47:46 -040031 details: VolatileDetails;
Misha Krieger-Raynauldaddd6fe2022-10-22 12:46:04 -040032}
33
34export interface RegistrationStateChanged {
35 accountId: string;
36 state: string;
37 code: number;
38 details: string;
39}
40
41export interface NameRegistrationEnded {
42 accountId: string;
43 state: number;
44 username: string;
45}
46
47export interface RegisteredNameFound {
48 accountId: string;
49 state: number;
50 address: string;
51 username: string;
52}
Charlieb62c6782022-10-30 15:14:56 -040053
Misha Krieger-Raynauld68a9b562022-10-28 19:47:46 -040054export interface KnownDevicesChanged {
55 accountId: string;
56 devices: Record<string, string>;
57}
58
Charlieb62c6782022-10-30 15:14:56 -040059export interface IncomingAccountMessage {
60 accountId: string;
61 from: string;
Misha Krieger-Raynauldcb11bba2022-11-11 18:08:33 -050062 payload: Record<string, string>;
63}
64
65export 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
72export interface ContactAdded {
73 accountId: string;
74 contactId: string;
75 confirmed: boolean;
76}
77
78export interface ContactRemoved {
79 accountId: string;
80 contactId: string;
81 banned: boolean;
Charlieb62c6782022-10-30 15:14:56 -040082}
Misha Krieger-Raynauld68a9b562022-10-28 19:47:46 -040083
84export interface ConversationReady {
85 accountId: string;
86 conversationId: string;
87}
88
89export interface ConversationRemoved {
90 accountId: string;
91 conversationId: string;
92}
93
94export interface ConversationLoaded {
95 id: number;
96 accountId: string;
97 conversationId: string;
Misha Krieger-Raynauld8a381da2022-11-03 17:37:51 -040098 messages: Message[];
Misha Krieger-Raynauld68a9b562022-10-28 19:47:46 -040099}
100
101export interface MessageReceived {
102 accountId: string;
103 conversationId: string;
Misha Krieger-Raynauld8a381da2022-11-03 17:37:51 -0400104 message: Message;
Misha Krieger-Raynauld68a9b562022-10-28 19:47:46 -0400105}