1 import type { PublicKeyReference } from '@proton/crypto';
2 import type { PACKAGE_TYPE } from '@proton/shared/lib/mail/mailSettings';
4 import type { MIME_TYPES } from '../../constants';
5 import type { EncryptionPreferencesError } from '../../mail/encryptionPreferences';
6 import type { KeyTransparencyVerificationResult } from '../KeyTransparency';
7 import type { SimpleMap } from '../utils';
9 export interface SendPreferences {
12 pgpScheme: PACKAGE_TYPE;
14 publicKeys?: PublicKeyReference[];
15 isPublicKeyPinned?: boolean;
17 hasPinnedKeys: boolean;
18 encryptionDisabled: boolean; // if `encryptionDisabled` is true, `encrypt` will always be false
20 error?: EncryptionPreferencesError;
21 ktVerificationResult?: KeyTransparencyVerificationResult;
24 export interface Packets {
29 signature?: Uint8Array;
30 Preview: Uint8Array | string;
35 export interface Package {
37 Addresses?: { [email: string]: Package };
38 MIMEType?: MIME_TYPES;
39 Body?: string | Uint8Array;
41 BodyKeyPacket?: string;
42 Type?: PACKAGE_TYPE | 0;
43 PublicKey?: PublicKeyReference;
44 AttachmentKeys?: { [AttachmentID: string]: { Key: string; Algorithm: string } };
45 AttachmentKeyPackets?: { [AttachmentID: string]: string };
48 export interface PackageDirect {
49 Addresses?: SimpleMap<PackageDirect>;
50 MIMEType?: MIME_TYPES;
53 BodyKeyPacket?: string;
54 Type?: PACKAGE_TYPE | 0;
55 PublicKey?: PublicKeyReference;
64 PasswordHint?: string;
66 AttachmentKeys?: { Key: string; Algorithm: string }[];
67 AttachmentKeyPackets?: string[];
70 export interface AttachmentDirect {
78 export type PackageStatus = {
79 [key in MIME_TYPES]?: boolean;
82 export type Packages = {
83 [key in MIME_TYPES]?: Package;