2019-02-18 17:24:18 +01:00
|
|
|
// @flow
|
|
|
|
import * as ACTIONS from 'constants/action_types';
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type SearchSuggestion = {
|
2019-02-18 17:24:18 +01:00
|
|
|
value: string,
|
|
|
|
shorthand: string,
|
|
|
|
type: string,
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type SearchOptions = {
|
2019-02-18 17:24:18 +01:00
|
|
|
// :(
|
|
|
|
// https://github.com/facebook/flow/issues/6492
|
|
|
|
RESULT_COUNT: number,
|
|
|
|
CLAIM_TYPE: string,
|
|
|
|
INCLUDE_FILES: string,
|
|
|
|
INCLUDE_CHANNELS: string,
|
|
|
|
INCLUDE_FILES_AND_CHANNELS: string,
|
|
|
|
MEDIA_AUDIO: string,
|
|
|
|
MEDIA_VIDEO: string,
|
|
|
|
MEDIA_TEXT: string,
|
|
|
|
MEDIA_IMAGE: string,
|
|
|
|
MEDIA_APPLICATION: string,
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type SearchState = {
|
2019-02-18 17:24:18 +01:00
|
|
|
isActive: boolean,
|
|
|
|
searchQuery: string,
|
|
|
|
options: SearchOptions,
|
|
|
|
suggestions: { [string]: Array<SearchSuggestion> },
|
|
|
|
urisByQuery: {},
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type SearchSuccess = {
|
2019-02-18 17:24:18 +01:00
|
|
|
type: ACTIONS.SEARCH_SUCCESS,
|
|
|
|
data: {
|
|
|
|
query: string,
|
|
|
|
uris: Array<string>,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type UpdateSearchQuery = {
|
2019-02-18 17:24:18 +01:00
|
|
|
type: ACTIONS.UPDATE_SEARCH_QUERY,
|
|
|
|
data: {
|
|
|
|
query: string,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type UpdateSearchSuggestions = {
|
2019-02-18 17:24:18 +01:00
|
|
|
type: ACTIONS.UPDATE_SEARCH_SUGGESTIONS,
|
|
|
|
data: {
|
|
|
|
query: string,
|
|
|
|
suggestions: Array<SearchSuggestion>,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type UpdateSearchOptions = {
|
2019-02-18 17:24:18 +01:00
|
|
|
type: ACTIONS.UPDATE_SEARCH_OPTIONS,
|
|
|
|
data: SearchOptions,
|
|
|
|
};
|