import { Product } from "./fullTextSearch"; import { Box } from "../utils/bindingBoxes"; import { Channel } from "./common"; export interface RequestKey { uuid: string; storeID: number; cdnCacheKey: string; } export declare enum ResultType { Instagram = "instagram", Visual = "visual", Popular = "popular", Product = "product" } export interface ExtendedRequestKey extends RequestKey { userSessionID: string; sessionToken: string | null | undefined; channel?: Channel; } export interface FetchProductsResponse { image_id: string; items: Product[]; likes: number; t: string; d: string; bbox?: ApiBoundingBox[]; complete_the_look?: { [key: string]: Product[]; }; product_label?: string; similar?: Product[]; video_url?: string; } export interface VisualSearchProductResponse { image_id: string; items: Product[]; method: string; bbox?: (ApiBoundingBox[] | Box[]); } export interface VisualSearchProductResponse { image_id: string; items: Product[]; method: string; bbox?: (ApiBoundingBox[] | Box[]); } export interface DiscoveryImage { image_id: string; likes: number; t: string; d: string; } export interface ShopTheLookResponse extends ShopTheLookData { product_label?: string; image_id?: number | string; similar?: Product[]; } export interface ShopTheLookData { bbox?: ApiBoundingBox[] | Box[]; complete_the_look?: { [key: string]: Product[]; }; showShopTheLookSwitch?: boolean; } export interface ApiBoundingBox { name: string; bb: number[]; person: string; } export interface FetchProductsDiscoveryParams extends RequestKey { imageID: string; mode: ResultType; channel?: Channel; } export interface FetchDiscoveryParams extends RequestKey { mode: ResultType; } export interface FetchProductsDiscoveryParamsUserImageParams extends ExtendedRequestKey { imageID: string; } export interface FetchProductsDiscoveryParamsUserImageWithLatencyParams extends ExtendedRequestKey { imageID: string; method?: string | undefined; channel?: Channel; } export interface SendImageParams extends ExtendedRequestKey { itemName?: string; base64String?: string | null; channel?: Channel; } export interface FetchShopTheLookProductsParams { uuid: string; storeID: number; productId: string; imageUrl: string; cdnCacheKey: string; channel?: Channel; } export type ProductsDiscoveryCallback = ({}: { action: "ProductsDiscovery" | "Error"; payload: FetchProductsResponse | string | undefined; }) => void; export type DiscoveryCallback = ({}: { action: "DiscoveryImages" | "Error"; payload: DiscoveryImage[] | string | undefined; }) => void; export type ImageSendCallback = ({}: { action: "ImageSend" | "Error"; payload: FetchProductsResponse | string | undefined; }) => void; export type ProductsByImageCallback = ({}: { action: "ImageSearch" | "Error"; payload: VisualSearchProductResponse | string | undefined; }) => void; export type ImageSearchCallback = ({}: { action: "ImageSearch" | "Error"; payload: VisualSearchProductResponse | string | undefined; }) => void; export type SimilarStylesCallback = ({}: { action: "SimilarStyles" | "Error"; payload: ShopTheLookResponse | string | undefined; }) => void; export interface VisualSearchUsedProps extends ExtendedRequestKey { imageID: string; products: string; latency: number; count: number; ref: AppReference; } export declare enum AppReference { POPUP = "popup", WIDGET = "widget", PDP = "pdp", AUTOCOMPLETE = "ac" } export declare enum ReportingUPType { visualSearchUsed = 21, discoveryOpen = 37, instagramDiscovery = 35, popularDiscovery = 33, instagramProductVisit = 36, popularProductVisit = 34, visualProductVisit = 32, discoveryInstagramATC = 38, discoveryPopularATC = 39, discoveryVisualATC = 40 }