i18n: Upgrade translations from crowdin (681bfc57). (verify)
[ProtonMail-WebClient.git] / applications / verify / src / app / broadcast.ts
blob6a9bd67707deaffb0d8e4d41bcee6aff15f9cf03
1 import type { GenericErrorPayload } from '@proton/shared/lib/broadcast';
2 import genericBroadcast from '@proton/shared/lib/broadcast';
4 export enum MessageType {
5     NOTIFICATION = 'NOTIFICATION',
6     RESIZE = 'RESIZE',
7     HUMAN_VERIFICATION_SUCCESS = 'HUMAN_VERIFICATION_SUCCESS',
8     CLOSE = 'CLOSE',
9     ERROR = 'ERROR',
10     LOADED = 'LOADED',
13 type Message =
14     | {
15           type: MessageType.NOTIFICATION;
16           payload: { type: string; text: string };
17       }
18     | {
19           type: MessageType.RESIZE;
20           payload: { height: number };
21       }
22     | {
23           type: MessageType.HUMAN_VERIFICATION_SUCCESS;
24           payload: { token: string; type: string };
25       }
26     | {
27           type: MessageType.CLOSE;
28       }
29     | {
30           type: MessageType.LOADED;
31       }
32     | {
33           type: MessageType.ERROR;
34           payload: GenericErrorPayload;
35       };
37 const broadcast = (message: Message) => genericBroadcast(message);
39 export default broadcast;