1 import type { ItemState, Maybe, MaybeNull, ShareRole, ShareType } from '@proton/pass/types';
3 export enum PassEncryptionTag {
4 Cache = 'cache' /* Local cache */,
5 Offline = 'offline' /* Offline components */,
6 ItemContent = 'itemcontent',
8 VaultContent = 'vaultcontent',
10 BiometricOfflineKD = 'biometricofflinekd',
13 export enum PassSignatureContext {
14 VaultInviteExistingUser = 'pass.invite.vault.existing-user',
15 VaultInviteNewUser = 'pass.invite.vault.new-user',
18 export enum ContentFormatVersion {
24 export type Rotation = number;
25 export type ShareId = string;
27 export type RotationKey = {
33 export type VaultKey = RotationKey & { userKeyId: Maybe<string> };
34 export type ItemKey = RotationKey;
36 type OpenedShareBase = {
39 expireTime?: MaybeNull<number>;
40 newUserInvitesReady: number;
45 shareRoleId: ShareRole;
47 targetMaxMembers: number;
48 targetMembers: number;
52 export type OpenedShare = OpenedShareBase &
56 contentFormatVersion: number;
57 contentKeyRotation: Rotation;
58 targetType: ShareType.Vault;
62 contentFormatVersion: null;
63 contentKeyRotation: null;
64 targetType: ShareType.Item;
68 export type TypedOpenedShare<T extends ShareType> = Extract<OpenedShare, { targetType: T }>;
70 export type OpenedItem = {
71 aliasEmail: MaybeNull<string>;
73 contentFormatVersion: number;
76 lastUseTime: MaybeNull<number>;