import type { GetUserOrdersQuery, MerchantOrderReturnOptions, Order, OrderItem } from '@farfetch/blackout-client'; import type { CourierEntity, OrderEntityDenormalized, OrderItemEntity, OrderItemEntityDenormalized, OrderSummariesDenormalized, OrderSummaryDenormalized, OrderSummaryEntity, ReturnOptionEntity, ReturnOptionEntityDenormalized } from '../entities/types/index.js'; import type { StoreState } from '../types/index.js'; /** * Returns the loading status for a specific request to fetch user * orders made through the `fetchUserOrders` action. * * @param state - Application state. * @param query - Query used in the request. * * @returns True if there an ongoing request to fetch user orders * with the specific query, false otherwise. */ export declare const areUserOrdersLoading: (state: StoreState, query?: GetUserOrdersQuery) => boolean; /** * Returns the error for a specific request to fetch user * orders made through the `fetchUserOrders` action, if any. * * @param state - Application state. * @param query - Query used in the request. * * @returns An error if there was one when fetching user orders, * `undefined` otherwise. */ export declare const getUserOrdersError: (state: StoreState, query?: GetUserOrdersQuery) => import("../types/nullable.types.js").Nullable | undefined; /** * Returns all the order items in the application state. * Please note that this might include order items that were fetched * from multiple requests. If you want to get a specific order item, * please use the `getOrderItem` selector. * * @param state - Application state. * * @returns Object with all order items with its orderItemId as the key. */ export declare const getOrderItems: (state: StoreState) => Record; /** * Returns all the order entities in the application state denormalized. * Please note that this might include orders that were fetched * from multiple requests. If you want to get a specific order, * please use the `getOrder` selector. * * @param state - Application state. * * @returns Object with orders with its orderId as the key. */ export declare const getOrders: (state: StoreState) => Record; /** * Returns all the user order summaries entities in the application state. * Please note that this might include order summaries that were fetched * from multiple requests. If you want to get user orders from a specific * request, please use the `getUserOrdersResult` selector. If you want * to get a specific user order, please use the `getUserOrder` selector. * * @param state - Application state. * * @returns Object with order summaries indexed by its `merchantOrderCode` * value. */ export declare const getUserOrders: (state: StoreState) => Record; /** * Returns a specific user order summary identified * by its merchant order code. * * @param state - Application state. * @param merchantOrderCode - Merchant order code. * * @returns Order summary object or `undefined` if not found. */ export declare const getUserOrder: (state: StoreState, merchantOrderCode: OrderSummaryEntity['merchantOrderCode']) => OrderSummaryDenormalized | undefined; /** * Returns if the user orders are fetched, i.e., there was a request * to fetch user orders through `fetchUserOrders` action that terminated * with either an error or success and there is not a pending fetch * user orders request for the same query. * * @param state - Application state. * @param query - Query used in the request. * * @returns True if there is either an error or order * result and it is not loading, false otherwise. */ export declare const areUserOrdersFetched: (state: StoreState, query?: GetUserOrdersQuery) => boolean | undefined; /** * Returns a shipment tracking label containing the order tracking * events. * * @param state - Application state. * @param trackingNumber - Tracking number of an order. * * @returns The corresponding shipment tracking label object if found, * `undefined` otherwise. */ export declare const getShipmentTrackingLabel: (state: StoreState, trackingNumber: string) => import("../entities/types/labelTracking.types.js").LabelTrackingEntity | undefined; /** * Returns a courier with its name and id. * * @param state - Application state. * @param courierId - Courier Id. * * @returns Courier object. */ export declare const getCourier: (state: StoreState, courierId: CourierEntity['id']) => CourierEntity | undefined; /** * Returns a specific order item identified by its id. * * @param state - Application state. * @param orderItemId - Order item id. * * @returns Order item object. */ export declare const getOrderItem: (state: StoreState, orderItemId: OrderItemEntity['id']) => OrderItemEntityDenormalized | undefined; /** * Returns all the return options in the application state. * Please note that this might include return options that were fetched * from multiple requests. If you want to get the return options from a * specific order, please use the `getOrderReturnOptions` selector. * If you want to get a specific return option, please use the * `getReturnOption` selector. * * @param state - Application state. * * @returns Object with all returnOptions indexed by its `merchantOrderId`. */ export declare const getReturnOptions: (state: StoreState) => Record | undefined; /** * Returns a specific return option identified by its identifier, * merchantOrderId. * * @param state - Application state. * @param merchantOrderId - Merchant order id that identifies a return option. * * @returns A corresponding return option object if found, `undefined` otherwise. */ export declare const getReturnOption: (state: StoreState, merchantOrderId: ReturnOptionEntity['merchantOrderId']) => ReturnOptionEntityDenormalized | undefined; /** * Returns a specific order identified by its id, for either an * authenticated or guest user. * * @param state - Application state. * @param orderId - Order id. * * @returns A corresponding order object if found, `undefined` otherwise. */ export declare const getOrder: (state: StoreState, orderId: Order['id']) => OrderEntityDenormalized | undefined; /** * Returns all return options from a specific order. * * @param state - Application state. * @param orderId - Order id. * * @returns A list of order return options if found, `undefined` otherwise. */ export declare const getOrderReturnOptions: (state: StoreState, orderId: Order['id']) => Record | undefined; /** * Returns all the order summaries from a specific order. * This selector should be used only after the user orders * (alias to order summaries) are fetched through `fetchUserOrders` * action and an order for the same user was fetched through * `fetchOrder` action. * * @param state - Application state. * @param orderId - Order id. * * @returns A corresponding list of order summaries for the order id * if found, `undefined` otherwise. */ export declare const getOrderSummaries: (state: StoreState, orderId: Order['id']) => Record | undefined; /** * Returns all the order items from an order summary (received from * the `fetchUserOrders` action) indexed by its `merchantOrderCode`. * * @param state - Application state. * @param orderId - Order id. * * @returns Object containing order items indexed by its * `merchantOrderCode`. */ export declare const getOrderItemsByMerchantOrderCode: (state: StoreState, orderId: Order['id']) => Record | undefined; /** * Returns the quantity of a product in an order. * * @param state - Application state. * @param orderId - Order id. * @param productOrderId - Product order id. * * @returns Product quantity in the order, if any. */ export declare const getOrderProductQuantity: (state: StoreState, orderId: Order['id'], productId: OrderItem['productId']) => number | undefined; /** * Returns the loading status for a fetch order request for either an * authenticated or guest user. * * @param state - Application state. * @param orderId - Order identifier. * * @returns True if there an ongoing request to fetch the order, * false otherwise. */ export declare const isOrderLoading: (state: StoreState, orderId: Order['id']) => boolean; /** * Returns the error for the fetch order request for either * an authenticated or guest user, if any. * * @param state - Application state. * @param orderId - Order identifier. * * @returns An error if there was one when fetching the order, * `undefined` otherwise. */ export declare const getOrderError: (state: StoreState, orderId: Order['id']) => import("@farfetch/blackout-client").BlackoutError | null | undefined; /** * Returns if the order is fetched, i.e., there was a request to fetch * the order through `fetchOrder` action that terminated with either * an error or success and there is not a pending fetch order request * for the same order. * It will return true if either there is an order loaded in the state * or if there is an error loading the order and it is not loading. * Otherwise, it will return false. * * @param state - Application state. * @param orderId - Order identifier. * * @returns True if there is either an error or order * result and it is not loading, false otherwise. */ export declare const isOrderFetched: (state: StoreState, orderId: Order['id']) => boolean; /** * Returns the loading status for a fetch order return options request * for either an authenticated or guest user. * * @param state - Application state. * @param orderId - Order identifier. * * @returns True if there an ongoing request to fetch the order return * options, false otherwise. */ export declare const areOrderReturnOptionsLoading: (state: StoreState, orderId: Order['id']) => boolean | undefined; /** * Returns the error for the fetch order return options request * for either an authenticated or guest user, if any. * * @param state - Application state. * @param orderId - Order identifier. * * @returns An error if there was one when fetching the order return options, * `undefined` otherwise. */ export declare const getOrderReturnOptionsError: (state: StoreState, orderId: string) => import("@farfetch/blackout-client").BlackoutError | null | undefined; /** * Returns the fetched status for the order return options operation. * It will return true if either there are order return options loaded * in the state or if there is an error loading the order return options * and it is not loading. Otherwise, it will return false. * * @param state - Application state. * @param orderId - Order identifier. * * @returns True if there is either an error or order return options * result and it is not loading, false otherwise. */ export declare const areOrderReturnOptionsFetched: (state: StoreState, orderId: Order['id']) => boolean; /** * Returns the loading status for the fetch shipment trackings request. * * @param state - Application state. * * @returns True if there an ongoing request to fetch shipment trackings, * false otherwise. */ export declare const areShipmentTrackingsLoading: (state: StoreState) => boolean; /** * Returns the error for the fetch shipment trackings request, if any. * * @param state - Application state. * * @returns An error if there was one when fetching shipment trackings, * `undefined` otherwise. */ export declare const getShipmentTrackingsError: (state: StoreState) => import("../types/nullable.types.js").Nullable; /** * Returns the loading status for the fetch order documents request. * * @param state - Application state. * * @returns True if there an ongoing request to fetch order documents, * false otherwise. */ export declare const areOrderDocumentsLoading: (state: StoreState) => boolean; /** * Returns the error for the fetch order documents request, if any. * * @param state - Application state. * * @returns An error if there was one when fetching order documents, * `undefined` otherwise. */ export declare const getOrderDocumentsError: (state: StoreState) => import("../types/nullable.types.js").Nullable; /** * Returns the loading status for the fetch order available items * activities request. * * @param state - Application state. * * @returns True if there an ongoing request to fetch order available items * activities, false otherwise. */ export declare const areOrderAvailableItemsActivitiesLoading: (state: StoreState) => boolean; /** * Returns the error for the fetch order available items activities request, * if any. * * @param state - Application state. * * @returns An error if there was one when fetching order available items activities, * `undefined` otherwise. */ export declare const getOrderAvailableItemsActivitiesError: (state: StoreState) => import("../types/nullable.types.js").Nullable; /** * Returns the loading status for the fetch order item available * activities request. * * @param state - Application state. * * @returns True if there an ongoing request to fetch order item available items * activities, false otherwise. */ export declare const areOrderItemAvailableActivitiesLoading: (state: StoreState) => boolean; /** * Returns the error for the fetch order item available activities request, * if any. * * @param state - Application state. * * @returns An error if there was one when fetching order item available items activities, * `undefined` otherwise. */ export declare const getOrderItemAvailableActivitiesError: (state: StoreState) => import("../types/nullable.types.js").Nullable; /** * Get user orders result. * This returns the result of a specific request made through * the `fetchUserOrders` action. * * @param state - Application state. * @param query - Query used in the request. * * @returns User orders result for the specified query if found, undefined otherwise. */ export declare const getUserOrdersResult: (state: StoreState, query?: GetUserOrdersQuery) => OrderSummariesDenormalized | undefined; /** * Get user orders result. * This returns the result of a specific request made through * the `fetchUserOrders` action but organized by order id instead. * * @param state - Application state. * @param query - Query used in the request. * * @returns User orders result for the specified query organized * by order id if found, undefined otherwise. */ export declare const getUserOrdersResultByOrderId: (state: StoreState, query?: GetUserOrdersQuery) => (Omit & { totalOrders: number; entries: Array<{ orderId: Order['id']; orderSummaries: Array; }>; }) | undefined;