export enum AccountDataEvent {
  PushRules = 'm.push_rules',
  Direct = 'm.direct',
  IgnoredUserList = 'm.ignored_user_list',
  // [MSC2867] Per-room "mark as unread" flag (room account data).
  MarkedUnread = 'm.marked_unread',

  CinnySpaces = 'in.cinny.spaces',

  ElementRecentEmoji = 'io.element.recent_emoji',

  PoniesUserEmotes = 'im.ponies.user_emotes',
  PoniesEmoteRooms = 'im.ponies.emote_rooms',

  // [P5-15] Personal soundboard pack (synced across devices). v2 content is a
  // SoundboardContent pack ({pack, clips}); v1 was {clips: [...]} (migrated on read).
  LotusSoundboard = 'io.lotus.soundboard',
  // [P5-15 v2] Global refs: room soundboard packs the user enabled everywhere
  // (mirrors im.ponies.emote_rooms).
  LotusSoundboardRooms = 'io.lotus.soundboard_rooms',

  // [P4-1] Per-thread notification mode overrides (All/Mentions/Mute) plus the
  // global default behavior for threads.
  LotusThreadNotifications = 'io.lotus.thread_notifications',

  SecretStorageDefaultKey = 'm.secret_storage.default_key',

  CrossSigningMaster = 'm.cross_signing.master',
  CrossSigningSelf = 'm.cross_signing.self',
  CrossSigningUser = 'm.cross_signing.user',
  MegolmBackupV1 = 'm.megolm_backup.v1',
}

export type MDirectContent = Record<string, string[]>;

export type SecretStorageDefaultKeyContent = {
  key: string;
};

export type SecretStoragePassphraseContent = {
  algorithm: string;
  salt: string;
  iterations: number;
  bits?: number;
};

export type SecretStorageKeyContent = {
  name?: string;
  algorithm: string;
  iv?: string;
  mac?: string;
  passphrase?: SecretStoragePassphraseContent;
};

export type SecretContent = {
  iv: string;
  ciphertext: string;
  mac: string;
};

export type SecretAccountData = {
  encrypted: Record<string, SecretContent>;
};
