export const BuyFormErrorType = {
   Toast: 'toast',
   Component: 'component',
} as const;
export type BuyFormErrorType = (typeof BuyFormErrorType)[keyof typeof BuyFormErrorType];

export interface BuyFormError {
   message: string;
   type: BuyFormErrorType;
}

export interface BuyFormCollectDataEvent extends CustomEvent<any> {
   getData: () => object;
   getAddToCartData: () => object;
   isPreviewMode: () => boolean;
   isMultiInsert: () => boolean;
   addMultiInsertVariationData: (productId: number, variationId: number, pieces: number) => void;
   addError: (error: BuyFormError) => void;
   getErrors: () => BuyFormError[];
   hasErrors: () => boolean;
   getLatestComponentError: () => BuyFormError | undefined;
   clearErrors: () => void;
   setPieces: (count: number) => void;
   setVariationId: (id: number) => void;
   addNote: (note: object) => void;
}
