// @flow
import {Component} from 'react'
import {List} from 'immutable'
import * as Constants from '../../../constants/chat'

import type {Options} from '../messages'

export type OptionsFn = (message: Constants.Message, prevMessage: Constants.Message, isFirstMessage: boolean, isSelected: boolean, isScrolling: boolean, key: any, style: Object, onAction: (message: Constants.ServerMessage, event: any) => void, onShowEditor: (message: Constants.Message, event: any) => void, isEditing: boolean) => Options

export type Props = {
  editLastMessageCounter: number,
  editingMessage: ?Constants.Message,
  firstNewMessageID: ?Constants.MessageID,
  followingMap: Constants.FollowingMap,
  headerMessages: List<Constants.Message>,
  listScrollDownCounter: number,
  messages: List<Constants.Message>,
  metaDataMap: Constants.MetaDataMap,
  moreToLoad: boolean,
  onDeleteMessage: (message: Constants.Message) => void,
  onEditMessage: (message: Constants.Message, body: string) => void,
  onFocusInput: () => void,
  onLoadAttachment: (messageID: Constants.MessageID, filename: string) => void,
  onLoadMoreMessages: () => void,
  onMessageAction: (message: Constants.ServerMessage) => void,
  onOpenConversation: (conversationIDKey: Constants.ConversationIDKey) => void,
  onOpenInFileUI: (filename: string) => void,
  onOpenInPopup: (message: Constants.AttachmentMessage) => void,
  onRetryAttachment: (message: Constants.AttachmentMessage) => void,
  onRetryMessage: (outboxID: string) => void,
  optionsFn: OptionsFn,
  selectedConversation: ?Constants.ConversationIDKey,
  supersededBy: ?Constants.SupersedeInfo,
  supersedes: ?Constants.SupersedeInfo,
  validated: boolean,
  you: string,
}

export default class ConversationList extends Component<void, Props, void> {
  onEditLastMessage: () => void
}
