///
import { ChatMessage, NizzaAddToCartHandler, NizzaSetUTMHandler } from '@nizza/core';
import { Queue } from '../utils';
import { AddToCartConfig } from './AddToCartHooks';
import { PlayerProduct } from './Product';
export type GetProductHandler = (productId: string, account?: string, showTax?: boolean) => Promise;
export type GetProductListHandler = (collectionId?: string, account?: string, showTax?: boolean) => Promise;
export type AddToCartHandler = NizzaAddToCartHandler;
export type SetUTMHandler = NizzaSetUTMHandler;
export type LivestreamingProps = {
account: string;
environment: string;
idLivestreaming: string;
isInGlobalPage: boolean;
isInfinite: boolean;
time: number;
redirectTo: boolean;
originOfProducts: string;
showChat: boolean;
showLike: boolean;
showSidebarProducts: boolean;
showQuickView: boolean;
showProductsCarousel: boolean;
showViewers?: boolean;
isLoading?: boolean;
getProductId?: GetProductHandler;
getProducts?: GetProductListHandler;
addToCartConfig?: AddToCartConfig;
setUTM?: SetUTMHandler;
currentOrderForm?: string;
showTax?: boolean;
};
export type Message = ChatMessage;
export interface Heart {
id: number;
color: string;
}
export interface IvsRealTime {
startTime: string;
viewerCount: number;
status: string;
}
export interface HighlightProduct {
products: string[];
collection?: string;
livestreamingId?: string;
backgroundWhiteHighlight?: string;
}
export interface ScriptProperties {
sidebarProducts: boolean;
productsCarousel: boolean;
chat: boolean;
like: boolean;
infinite: boolean;
time: number;
showQuickView: boolean;
pdp: boolean;
isInGlobalPage: boolean;
viewers: boolean;
}
export interface InfoSocket {
socket: WebSocket | undefined;
chat: Message[];
hearts: Heart[];
sessionId: string;
showCounter: boolean | undefined;
showGif: boolean | undefined;
showLoader: boolean | undefined;
emailIsRequired: boolean | undefined;
question?: Question;
messageToDelete?: Message | undefined;
showTax: boolean | undefined;
setHearts: React.Dispatch>;
setChat: React.Dispatch>;
setShowLoader: React.Dispatch>;
sendAccountId: (username?: string, email?: string) => void;
highlightProduct?: HighlightProduct | undefined;
scriptProperties?: ScriptProperties | undefined;
setScriptProperties: React.Dispatch>;
setShowCounter: React.Dispatch>;
setEmailIsRequired: React.Dispatch>;
setQuestion?: React.Dispatch>;
setShowTax: React.Dispatch>;
queueLikeSocket?: Queue | undefined;
queueBubbleProductSocket?: Queue | undefined;
setMessageToDelete: React.Dispatch>;
pinnedMessage: Message | undefined;
setPinnedMessage: (value: React.SetStateAction) => void;
transmitiontype: string | undefined;
productsInCart: PlayerProduct[];
setProductsInCart: React.Dispatch>;
setQueueLikeSocket: React.Dispatch | undefined>>;
setQueueBubbleProductSocket: React.Dispatch | undefined>>;
showCarouselChatButton: boolean | undefined;
activePromo: PromotionTrigger | undefined;
updateLivestreaming: string | undefined;
}
export interface Question {
answers?: Answer[];
question?: string;
index?: number;
type?: string;
status?: string;
time?: number;
totalVotes?: number;
date?: number;
}
export interface Answer {
text: string;
votes: number;
}
export interface OptionsCurrency {
symbol: string;
decimalSeparator: string;
thousandsSeparator: string;
numberOfDecimals: number;
positionSymbol: string;
}
export interface CurrencyFormat {
CurrencyDecimalDigits: number;
CurrencyDecimalSeparator: string;
CurrencyGroupSeparator: string;
CurrencyGroupSize: number;
StartsWithCurrencySymbol: string;
}
export interface HightLightHistoryElement {
productId: string;
joinSecond: number;
outSecond: number;
}
export interface Settings {
isInfinite: boolean;
time: number;
redirectTo: boolean;
showChat: boolean;
showLike: boolean;
showSidebarProducts: boolean;
showProductsCarousel: boolean;
showViewers: boolean;
}
export interface PromotionTrigger {
id: string;
name: string;
variable: string;
goal: number;
status: boolean;
message: string;
triggerDate?: string;
index?: number;
animation: string;
isCoupon: boolean;
}