Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / shared / lib / keys / reactivation / interface.ts
blob4c32be134a08b8fad26db8736c6f9a88489917bd
1 import type { PrivateKeyReference } from '@proton/crypto';
3 import type { Address, InactiveKey, Key, User } from '../../interfaces';
5 export interface KeyReactivationData {
6     id: string;
7     Key: Key;
8     privateKey?: PrivateKeyReference;
11 export type KeyReactivationRecord =
12     | {
13           user: User;
14           address?: undefined;
15           keysToReactivate: KeyReactivationData[];
16       }
17     | {
18           user?: undefined;
19           address: Address;
20           keysToReactivate: KeyReactivationData[];
21       };
23 export type OnKeyReactivationCallback = (id: string, result: 'ok' | Error) => void;
25 export interface KeyReactivationRequestStateData {
26     id: string;
27     Key: Key;
28     fingerprint: string;
29     result?: 'ok' | Error;
32 export type KeyReactivationRequestState =
33     | {
34           user: User;
35           address: undefined;
36           keysToReactivate: KeyReactivationRequestStateData[];
37       }
38     | {
39           user: undefined;
40           address: Address;
41           keysToReactivate: KeyReactivationRequestStateData[];
42       };
44 export type KeyReactivationRequest =
45     | {
46           user: User;
47           address?: undefined;
48           keysToReactivate: InactiveKey[];
49       }
50     | {
51           user?: undefined;
52           address: Address;
53           keysToReactivate: InactiveKey[];
54       };