import {ConversationProperties} from './conversationProperties';
import {HuDataMember} from './user';

export interface MembershipFromServer {
  id: string;
  version: number;
  is_admin: boolean;
  user: {
    hu_data: {
      member: HuDataMember;
    };
    id: string;
    team_id: string;
    name: string;
  };
  deleted_at?: number;
  /**
   * This is defined only for current user membership
   */
  properties?: ConversationProperties;
}

export interface Membership {
  user: HuDataMember;
  is_admin: boolean;
  version: number;
}

/**
 * Read membership from server
 */
export interface ReadMembership {
  id: string;
  unread_count: number;
  last_read: string;
  version: number;
}

/**
 * Local unread info for a channel
 */
export interface UnreadInfo {
  unreadCount: number;
  lastRead: Nullable<string>;
  version: number;
  ts: string;
}
