{"size": 2928, "ext": "js", "max_stars_repo_path": "shared/constants/types/entities.js", "max_stars_repo_name": "AeliusSaionji/client", "max_stars_repo_stars_event_min_datetime": "2021-03-31T11:25:29.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-31T11:25:29.000Z", "max_issues_repo_path": "shared/constants/types/entities.js", "max_issues_repo_name": "meiskam/client", "max_issues_repo_issues_event_min_datetime": "2020-07-11T07:08:33.000Z", "max_issues_repo_issues_event_max_datetime": "2020-07-11T07:08:33.000Z", "max_forks_repo_path": "shared/constants/types/entities.js", "max_forks_repo_name": "meiskam/client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 42.4347826087, "max_line_length": 103, "alphanum_fraction": 0.7698087432}
// @flow
import * as I from 'immutable'
import * as Teams from './teams'
import * as ChatTypes from './chat'
import * as SearchTypes from './search'
import * as Git from './git'
import {type NoErrorTypedAction} from './flux'

export type EntityType = any // TODO stronger typing?

export type Delete = NoErrorTypedAction<'entity:delete', {keyPath: Array<string>, ids: I.List<string>}>
export type Merge = NoErrorTypedAction<
  'entity:merge',
  {keyPath: Array<string>, entities: I.Map<any, EntityType> | I.List<EntityType>}
>
export type Replace = NoErrorTypedAction<
  'entity:replace',
  {keyPath: Array<string>, entities: I.Map<any, EntityType>}
>
export type Subtract = NoErrorTypedAction<
  'entity:subtract',
  {keyPath: Array<string>, entities: I.List<EntityType>}
>

export type Actions = Delete | Merge | Replace | Subtract

export type _SearchSubState = {
  searchResults: I.Map<SearchTypes.SearchResultId, I.RecordOf<SearchTypes.SearchResult>>,
  searchQueryToResult: I.Map<SearchTypes.SearchQuery, I.List<SearchTypes.SearchResultId>>,
  searchKeyToResults: I.Map<string, ?I.List<SearchTypes.SearchResultId>>,
  searchKeyToPending: I.Map<string, boolean>,
  searchKeyToSelectedId: I.Map<string, ?SearchTypes.SearchResultId>,
  searchKeyToShowSearchSuggestion: I.Map<string, boolean>,
  searchKeyToUserInputItemIds: I.Map<string, I.OrderedSet<SearchTypes.SearchResultId>>,
  searchKeyToSearchResultQuery: I.Map<string, ?{text: string, service: SearchTypes.Service}>,
  searchKeyToClearSearchTextInput: I.Map<string, number>,
}
export type SearchSubState = I.RecordOf<_SearchSubState>

export type PaginationState = I.RecordOf<{
  next: I.Map<ChatTypes.ConversationIDKey, string>, // Pass this when we want to get older messages
  prev: I.Map<ChatTypes.ConversationIDKey, string>, // For when we want to get newer messages
}>

// State
export type _State = {
  attachmentDownloadProgress: I.Map<ChatTypes.MessageKey, ?number>,
  attachmentDownloadedPath: I.Map<ChatTypes.MessageKey, ?string>,
  attachmentPreviewPath: I.Map<ChatTypes.MessageKey, ?string>,
  attachmentPreviewProgress: I.Map<ChatTypes.MessageKey, ?number>,
  attachmentSavedPath: I.Map<ChatTypes.MessageKey, ?string>,
  attachmentUploadProgress: I.Map<ChatTypes.MessageKey, ?number>,
  conversationMessages: I.Map<ChatTypes.ConversationIDKey, ChatTypes.ConversationMessages>,
  deletedIDs: I.Map<ChatTypes.ConversationIDKey, I.Set<ChatTypes.MessageID>>,
  git: Git.State,
  messageUpdates: I.Map<
    ChatTypes.ConversationIDKey,
    I.Map<ChatTypes.MessageID, I.OrderedSet<ChatTypes.MessageKey>>
  >,
  messages: I.Map<ChatTypes.MessageKey, ChatTypes.Message>,
  pagination: PaginationState,
  search: SearchSubState,
  searchQueryToResult: I.Map<SearchTypes.SearchQuery, I.List<SearchTypes.SearchResultId>>,
  searchResults: I.Map<SearchTypes.SearchResultId, SearchTypes.SearchResult>,
  teams: Teams.State,
}

export type State = I.RecordOf<_State>
