// Module augmentation: extend matrix-js-sdk's AccountDataEvents and StateEvents
// interfaces with the custom Matrix event types Vojo / upstream Cinny uses
// (Vojo spaces sidebar, Ponies emote/sticker packs, Element recent emoji,
// MSC2346 bridge metadata, MSC3401 group-call membership, MSC4143 RTC member,
// Vojo power-level tags). Without this, `mx.getAccountData(<custom-key>)` /
// `mx.getStateEvent(<custom-key>)` / `state.getStateEvents(<custom-key>)` fail
// `keyof XxxEvents` narrowing in TypeScript 5.4+.
//
// Content types stay `unknown` here on purpose — call sites already invoke
// `.getContent<T>()` with the right local content type. Keep this file dep-free
// (only ambient declarations) so it loads before any value imports.

import 'matrix-js-sdk';

declare module 'matrix-js-sdk' {
  // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/consistent-type-definitions
  interface AccountDataEvents {
    'in.vojo.spaces': unknown;
    'io.element.recent_emoji': unknown;
    'im.ponies.user_emotes': unknown;
    'im.ponies.emote_rooms': unknown;
  }

  // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/consistent-type-definitions
  interface StateEvents {
    'im.ponies.room_emotes': unknown;
    'in.vojo.room.power_level_tags': unknown;
    'in.vojo.room.voice_messages': unknown;
    // MSC2346 bridge metadata — stable + unstable variants. Mautrix-* and
    // similar bridges write at least one; SDK ships no built-in typing.
    'm.bridge': unknown;
    'uk.half-shot.bridge': unknown;
  }
}
