import { TriggerEvent } from "react-contexify";

export type Avatar = {
  avatarID: string;
  avatarName: string;
  avatarConfigure: number;
  isSiteHand: boolean;
  isMe: boolean;
  isValve: boolean;
  isAudioInput: boolean;
};

export type SiteYell = {
  avatarID?: string;
  avatarName?: string;
  siteYellVariety: ?string;
  date?: string;
  siteYell?:
    | string
    | CommentSiteYell
    | AbilitySiteYell
    | LevelSiteYell
    | InviteSiteYell
    | TVSiteYell;
  siteYellID: number;
};

export type CommentSiteYell = {
  avatarID: string;
  avatarName: string;
  title: string;
  artist: string;
  genre: string;
  level: number;
  levelText: string;
  stand: number;
  hitPointsMode: number;
};

export type AbilitySiteYell = {
  avatarID: string;
  avatarName: string;
  inputMode: number;
  ability: number;
};

export type LevelSiteYell = {
  avatarID: string;
  avatarName: string;
  title: string;
};

export type InviteSiteYell = {
  siteID: string;
  siteName: string;
  avatarName: string;
};

export type TVSiteYell = {
  href: string;
  title: string;
  text: string;
};

export type SiteView = {
  siteID: string;
  isEditable: boolean;
  isNew: boolean;
  wasNotify: boolean;
  siteNotify: string;
  siteName: string;
  isNetMode: boolean;
  avatars: Avatar[];
  siteHand: string;
  situationValue: number;
  siteYells: SiteYell[];
};

export type Event = { eventID: number; text?: string; data?: ArrayBuffer[] };

export type EventHandler = (data: Event) => void;

export type CloseEventHandler = () => void;

export type OnAvatarInput = (e: TriggerEvent, avatarID: string) => void;

export type OnSiteYellInput = (e: TriggerEvent, avatarID: string) => void;
