import { Results } from 'groupby-api'; import Configuration from '../configuration'; import Store from '../store'; import Payloads from './payloads'; declare namespace Actions { interface Action { type: S; payload?: T; meta?: Metadata; error?: boolean; } interface Metadata { recallId?: string; searchId?: string; detailsId?: string; pastPurchaseId?: string; tag?: Metadata.Tag; validator?: object; } namespace Metadata { interface Tag { id: number; name: string; origin?: string; } } interface Thunk { (getState?: () => Store.State): Action; } interface ActionCreator { (...args: any[]): Action | Action[] | Thunk; } export import Payload = Payloads; const UPDATE_HISTORY = "UPDATE_HISTORY"; type UpdateHistory = Action; const UPDATE_AUTOCOMPLETE_QUERY = "UPDATE_AUTOCOMPLETE_QUERY"; type UpdateAutocompleteQuery = Action; const UPDATE_DETAILS = "UPDATE_DETAILS"; type UpdateDetails = Action; const SELECT_REFINEMENT = "SELECT_REFINEMENT"; type SelectRefinement = Action; const SELECT_MULTIPLE_REFINEMENTS = "SELECT_MULTIPLE_REFINEMENTS"; type SelectMultipleRefinements = Action; const DESELECT_REFINEMENT = "DESELECT_REFINEMENT"; type DeselectRefinement = Action; const SELECT_COLLECTION = "SELECT_COLLECTION"; type SelectCollection = Action; const SELECT_SORT = "UPDATE_SORTS"; type SelectSort = Action; const APPLY_SORTS = "APPLY_SORTS"; type ApplySorts = Action; const UPDATE_PAGE_SIZE = "UPDATE_PAGE_SIZE"; type UpdatePageSize = Action; const UPDATE_CURRENT_PAGE = "UPDATE_CURRENT_PAGE"; type UpdateCurrentPage = Action; const UPDATE_QUERY = "UPDATE_QUERY"; type UpdateQuery = Action; const RESET_REFINEMENTS = "RESET_REFINEMENTS"; type ResetRefinements = Action; const RESET_PAGE = "RESET_PAGE"; type ResetPage = Action; const ADD_REFINEMENT = "ADD_REFINEMENT"; type AddRefinement = Action; const UPDATE_BIASING = "UPDATE_BIASING"; type UpdateBiasing = Action; const UPDATE_SECURED_PAYLOAD = "UPDATE_SECURED_PAYLOAD"; type UpdateSecuredPayload = Action; type SwitchRefinement = [Actions.ResetPage, Actions.ResetPage, Actions.ResetRefinements, Actions.ResetPage, Actions.AddRefinement]; type Search = [Actions.ResetPage, Actions.ResetPage, Actions.ResetRefinements, Actions.ResetPage, Actions.AddRefinement] | [Actions.ResetPage, Actions.SelectCollection, Actions.ResetPage, Actions.ResetRefinements, Actions.ResetPage, Actions.AddRefinement]; type ResetRecall = [Actions.ResetPage, Actions.ResetPage, Actions.ResetRefinements, Actions.ResetPage, Actions.UpdateQuery] | [Actions.ResetPage, Actions.ResetPage, Actions.ResetRefinements, Actions.ResetPage, Actions.UpdateQuery, Actions.ResetPage, Actions.SelectRefinement]; type UpdateSearch = Array; type ResetPageAndResetRefinements = [Actions.ResetPage, Actions.ResetRefinements]; type ResetPageAndSelectRefinement = [Actions.ResetPage, Actions.SelectRefinement]; type ResetPageAndSelectMultipleRefinements = [Actions.ResetPage, Actions.SelectMultipleRefinements]; type ResetPageAndDeselectRefinement = [Actions.ResetPage, Actions.DeselectRefinement]; type ResetPageAndAddRefinement = [Actions.ResetPage, Actions.AddRefinement]; type CheckAndResetRefinements = ResetPageAndResetRefinements | Action[]; type ResetPageAndUpdateQuery = [Actions.ResetPage, Actions.UpdateQuery]; type ReceiveMoreProductsAndPage = [Actions.ReceiveMoreProducts, Actions.ReceivePage]; const FETCH_MORE_REFINEMENTS = "FETCH_MORE_REFINEMENTS"; type FetchMoreRefinements = Action; const FETCH_PRODUCTS = "FETCH_PRODUCTS"; type FetchProducts = Action; const FETCH_PRODUCTS_WITHOUT_HISTORY = "FETCH_PRODUCTS_WITHOUT_HISTORY"; type FetchProductsWithoutHistory = Action; const FETCH_PRODUCTS_WHEN_HYDRATED = "FETCH_PRODUCTS_WHEN_HYDRATED"; type FetchProductsWhenHydrated = Action; const FETCH_MORE_PRODUCTS = "FETCH_MORE_PRODUCTS"; type FetchMoreProducts = Action; const FETCH_AUTOCOMPLETE_SUGGESTIONS = "FETCH_AUTOCOMPLETE_SUGGESTIONS"; type FetchAutocompleteSuggestions = Action; const FETCH_AUTOCOMPLETE_PRODUCTS = "FETCH_AUTOCOMPLETE_PRODUCTS"; type FetchAutocompleteProducts = Action; const FETCH_COLLECTION_COUNT = "FETCH_COLLECTION_COUNT"; type FetchCollectionCount = Action; const FETCH_PRODUCT_DETAILS = "FETCH_PRODUCT_DETAILS"; type FetchProductDetails = Action; const FETCH_RECOMMENDATIONS_PRODUCTS = "FETCH_RECOMMENDATIONS_PRODUCTS"; type FetchRecommendationsProducts = Action; const FETCH_PAST_PURCHASES = "FETCH_PAST_PURCHASES"; type FetchPastPurchases = Action; const FETCH_PAST_PURCHASE_PRODUCTS = "FETCH_PAST_PURCHASE_PRODUCTS"; type FetchPastPurchaseProducts = Action; const FETCH_MORE_PAST_PURCHASE_REFINEMENTS = "FETCH_MORE_PAST_PURCHASE_REFINEMENTS"; type FetchMorePastPurchaseRefinements = Action; const FETCH_MORE_PAST_PURCHASE_PRODUCTS = "FETCH_MORE_PAST_PURCHASE_PRODUCTS"; type FetchMorePastPurchaseProducts = Action; const FETCH_SAYT_PAST_PURCHASES = "FETCH_SAYT_PAST_PURCHASES"; type FetchSaytPastPurchases = Action; const RECEIVE_SITE_PARAMS = "RECEIVE_SITE_PARAMS"; type ReceiveSiteParams = Action; const RECEIVE_MORE_REFINEMENTS = "RECEIVE_MORE_REFINEMENTS"; type ReceiveMoreRefinements = Action; const RECEIVE_PRODUCTS = "RECEIVE_PRODUCTS"; type ReceiveProducts = Action; const RECEIVE_MORE_PRODUCTS = "RECEIVE_MORE_PRODUCTS"; type ReceiveMoreProducts = Action; const RECEIVE_AUTOCOMPLETE_SUGGESTIONS = "RECEIVE_AUTOCOMPLETE_SUGGESTIONS"; type ReceiveAutocompleteSuggestions = Action; const RECEIVE_AUTOCOMPLETE_PRODUCTS = "RECEIVE_AUTOCOMPLETE_PRODUCTS"; type ReceiveAutocompleteProducts = Action; const RECEIVE_AUTOCOMPLETE_PRODUCT_RECORDS = "RECEIVE_AUTOCOMPLETE_PRODUCT_RECORDS"; type ReceiveAutocompleteProductRecords = Action; const RECEIVE_AUTOCOMPLETE_TEMPLATE = "RECEIVE_AUTOCOMPLETE_TEMPLATE"; type ReceiveAutocompleteTemplate = Action; const RECEIVE_QUERY = "RECEIVE_QUERY"; type ReceiveQuery = Action; const RECEIVE_PRODUCT_RECORDS = "RECEIVE_PRODUCT_RECORDS"; type ReceiveProductRecords = Action; const RECEIVE_COLLECTION_COUNT = "RECEIVE_COLLECTION_COUNT"; type ReceiveCollectionCount = Action; const RECEIVE_NAVIGATIONS = "RECEIVE_NAVIGATIONS"; type ReceiveNavigations = Action; const RECEIVE_PAGE = "RECEIVE_PAGE"; type ReceivePage = Action; const RECEIVE_RECORD_COUNT = "RECEIVE_RECORD_COUNT"; type ReceiveRecordCount = Action; const RECEIVE_TEMPLATE = "RECEIVE_TEMPLATE"; type ReceiveTemplate = Action; const RECEIVE_REDIRECT = "RECEIVE_REDIRECT"; type ReceiveRedirect = Action; const RECEIVE_RECOMMENDATIONS_PRODUCTS = "RECEIVE_RECOMMENDATIONS_PRODUCTS"; type ReceiveRecommendationsProducts = Action; const RECEIVE_DETAILS = "RECEIVE_DETAILS"; type ReceiveDetails = Action; const RECEIVE_PAST_PURCHASE_SKUS = "RECEIVE_PAST_PURCHASE_SKUS"; type ReceivePastPurchaseSkus = Action; const RECEIVE_SAYT_PAST_PURCHASES = "RECEIVE_SAYT_PAST_PURCHASES"; type ReceiveSaytPastPurchases = Action; const RECEIVE_MORE_PAST_PURCHASE_REFINEMENTS = "RECEIVE_MORE_PAST_PURCHASE_REFINEMENTS"; type ReceiveMorePastPurchaseRefinements = Action; const RECEIVE_PAST_PURCHASE_PRODUCTS = "RECEIVE_PAST_PURCHASE_PRODUCTS"; type ReceivePastPurchaseProducts = Action; const RECEIVE_MORE_PAST_PURCHASE_PRODUCTS = "RECEIVE_MORE_PAST_PURCHASE_PRODUCTS"; type ReceiveMorePastPurchaseProducts = Action; const RECEIVE_PAST_PURCHASE_CURRENT_RECORD_COUNT = "RECEIVE_PAST_PURCHASE_CURRENT_RECORD_COUNT"; type ReceivePastPurchaseCurrentRecordCount = Action; const RECEIVE_PAST_PURCHASE_ALL_RECORD_COUNT = "RECEIVE_PAST_PURCHASE_ALL_RECORD_COUNT"; type ReceivePastPurchaseAllRecordCount = Action; const RECEIVE_PAST_PURCHASE_REFINEMENTS = "RECEIVE_PAST_PURCHASE_REFINEMENTS"; type ReceivePastPurchaseRefinements = Action; const RESET_PAST_PURCHASE_REFINEMENTS = "RESET_PAST_PURCHASE_REFINEMENTS"; type ReceivePastPurchaseTemplate = Action; const RECEIVE_PAST_PURCHASE_TEMPLATE = "RECEIVE_PAST_PURCHASE_TEMPLATE"; type ReceivePastPurchaseSiteParams = Action; const RECEIVE_PAST_PURCHASE_SITE_PARAMS = "RECEIVE_PAST_PURCHASE_SITE_PARAMS"; type ResetPastPurchaseRefinements = Action; const SELECT_PAST_PURCHASE_REFINEMENT = "SELECT_PAST_PURCHASE_REFINEMENT"; type SelectPastPurchaseRefinement = Action; const SELECT_MULTIPLE_PAST_PURCHASE_REFINEMENTS = "SELECT_MULTIPLE_PAST_PURCHASE_REFINEMENTS"; type SelectMultiplePastPurchaseRefinements = Action; const RESET_AND_SELECT_PAST_PURCHASE_REFINEMENT = "RESET_AND_SELECT_PAST_PURCHASE_REFINEMENT"; type ResetAndSelectPastPurchaseRefinement = Action; const DESELECT_PAST_PURCHASE_REFINEMENT = "DESELECT_PAST_PURCHASE_REFINEMENT"; type DeselectPastPurchaseRefinement = Action; const RESET_PAST_PURCHASE_PAGE = "RESET_PAST_PURCHASE_PAGE"; type ResetPastPurchasePage = Action; const RECEIVE_PAST_PURCHASE_PAGE = "RECEIVE_PAST_PURCHASE_PAGE"; type ReceivePastPurchasePage = Action; type PastPurchaseReset = [Actions.ResetPastPurchasePage, Actions.ResetPastPurchaseRefinements]; type PastPurchaseSelect = [Actions.ResetPastPurchasePage, Actions.SelectPastPurchaseRefinement]; type PastPurchaseSelectMultiple = [Actions.ResetPastPurchasePage, Actions.SelectMultiplePastPurchaseRefinements]; type PastPurchaseDeselect = [Actions.ResetPastPurchasePage, Actions.DeselectPastPurchaseRefinement]; type PastPurchaseResetAndSelect = [Actions.ResetPastPurchasePage, Actions.ResetPastPurchaseRefinements, Actions.ResetPastPurchasePage, Actions.SelectPastPurchaseRefinement]; type PastPurchaseQueryAndSelect = [Actions.ResetPastPurchasePage, Actions.ResetPastPurchaseRefinements, Actions.UpdatePastPurchaseQuery, Actions.ResetPastPurchasePage, Actions.SelectPastPurchaseRefinement]; type ReceiveNavigationSort = Action; type PastPurchaseQuery = [Actions.ResetPastPurchasePage, Actions.ResetPastPurchaseRefinements, Actions.UpdatePastPurchaseQuery]; type PastPurchaseSortActions = [Actions.ResetPastPurchasePage, Actions.SelectPastPurchaseSort]; const UPDATE_PAST_PURCHASE_PAGE_SIZE = "UPDATE_PAST_PURCHASE_PAGE_SIZE"; type UpdatePastPurchasePageSize = Action; const UPDATE_PAST_PURCHASE_CURRENT_PAGE = "UPDATE_PAST_PURCHASE_CURRENT_PAGE"; type UpdatePastPurchaseCurrentPage = Action; const UPDATE_PAST_PURCHASE_QUERY = "UPDATE_PAST_PURCHASE_QUERY"; type UpdatePastPurchaseQuery = Action; const SELECT_PAST_PURCHASE_SORT = "SELECT_PAST_PURCHASE_SORT"; type SelectPastPurchaseSort = Action; const APPLY_PAST_PURCHASE_SORTS = "APPLY_PAST_PURCHASE_SORTS"; type ApplyPastPurchaseSorts = Action; const RECEIVE_NAVIGATION_SORT = "RECEIVE_NAVIGATION_SORT"; const RECEIVE_INFINITE_SCROLL = "RECEIVE_INFINITE_SCROLL"; type ReceiveInfiniteScroll = Action; const CREATE_COMPONENT_STATE = "CREATE_COMPONENT_STATE"; type CreateComponentState = Action; const REMOVE_COMPONENT_STATE = "REMOVE_COMPONENT_STATE"; type RemoveComponentState = Action; const UPDATE_LOCATION = "UPDATE_LOCATION"; type UpdateLocation = Action; const SET_SESSION_ID = "SET_SESSION_ID"; type SetSessionId = Action; const START_APP = "START_APP"; type StartApp = Action; const SHUTDOWN_APP = "SHUTDOWN_APP"; type ShutdownApp = Action; const REFRESH_STATE = "REFRESH_STATE"; type RefreshState = Action; const SAVE_STATE = "SAVE_STATE"; type SaveState = Action; const START_REDIRECT = "START_REDIRECT"; type StartRedirect = Action; const DONE_REDIRECT = "DONE_REDIRECT"; type DoneRedirect = Action; } export default Actions;