export const ROOM_PERMISSION_KEYS = [
  'manageServer',
  'manageRoles',
  'manageChannels',
  'manageIcon',
  'kickMembers',
  'banMembers',
  'manageBans',
  'deleteMessages',
  'joinVoice',
  'shareScreen',
  'uploadFiles'
] as const;

export type RoomPermissionKey = typeof ROOM_PERMISSION_KEYS[number];

export type PermissionState = 'allow' | 'deny' | 'inherit';

export type ChannelPermissionTargetType = 'role' | 'user';

export type RoomPermissionMatrix = Partial<Record<RoomPermissionKey, PermissionState>>;

export interface RoomRole {
  id: string;
  name: string;
  color?: string;
  position: number;
  isSystem?: boolean;
  permissions?: RoomPermissionMatrix;
}

export interface RoomRoleAssignment {
  userId: string;
  oderId?: string;
  roleIds: string[];
}

export interface ChannelPermissionOverride {
  channelId: string;
  targetType: ChannelPermissionTargetType;
  targetId: string;
  permission: RoomPermissionKey;
  value: PermissionState;
}
