import type { Map } from 'immutable'

declare class ActionType {
  type: string,
  payload?: any,
  meta?: {
    onSuccess?: () => void,
    onSuccessAction?: {}|ActionType,
    onFail?: () => {},
    onFailAction?: {}|ActionType,
  },
}

declare function ActionCreatorType(): ActionType

type RequestActions = {
  request: ActionCreatorType,
  success: ActionCreatorType,
  fail: ActionCreatorType,
}

declare class RequestConfigType {
  method: 'get'|'post'|'put'|'patch'|'delete',
  route: string,
  data: ?any,
}

type EntityType = {}|Map<string,any>
type IdPath = string|[string]|(entity: ?{}) => ?string
