import { TypedEmitter } from 'tiny-typed-emitter';
import { ProductSchema } from '@byondrnd/showroom-schemas';
import { Visualizer } from '../Visualizer';
export declare namespace IEventsTypesListeners {
    type OnVisualizerLoaded = (event: CustomEvent & {
        detail: {
            visualizer: Visualizer;
        };
    }) => void;
    type OnSceneLoaded = (event: CustomEvent & {
        detail: {
            scene: IScene;
        };
    }) => void;
    type OnProductChanged = (event: CustomEvent & {
        detail: {
            product: ProductSchema.IProduct;
        };
    }) => void;
    type onSceneDisplayed = (event: CustomEvent & {
        detail: {
            scene: IFavoriteScene;
        };
    }) => void;
    type onHotspotClicked = (event: CustomEvent & {
        detail: {
            application: IApplication;
        };
    }) => void;
    type onProductAddedToFavorites = (event: CustomEvent & {
        detail: {
            favorites: IFavoriteProductList;
            product: IProduct;
        };
    }) => void;
    type onSceneAddedToFavorites = (event: CustomEvent & {
        detail: {
            favoriteScenes: IFavoriteSceneList;
            scene: IFavoriteScene;
        };
    }) => void;
    type onProductRemovedFromFavorites = (event: CustomEvent & {
        detail: {
            favorites: IFavoriteProductList;
            product: IProduct;
        };
    }) => void;
    type onSceneRemovedFromFavorites = (event: CustomEvent & {
        detail: {
            favoriteScenes: IFavoriteSceneList;
            scene: IFavoriteScene;
        };
    }) => void;
    type onProductAddedToCart = (event: CustomEvent & {
        detail: {
            product: IProduct;
        };
    }) => void;
    type onOrderSample = (event: CustomEvent & {
        detail: {
            product: IProduct;
        };
    }) => void;
}
export declare namespace IEventsTypes {
    type OnVisualizerLoaded = (eventData: {
        visualizer: Visualizer;
    }) => void;
    type OnSceneLoaded = (eventData: {
        scene: IScene;
    }) => void;
    type OnProductChanged = (eventData: {
        product: ProductSchema.IProduct;
    }) => void;
    type onSceneDisplayed = (eventData: {
        scene: IFavoriteScene;
    }) => void;
    type onHotspotClicked = (eventData: {
        application: IApplication;
    }) => void;
    type onProductAddedToFavorites = (eventData: {
        favorites: IFavoriteProductList;
        product: IProduct;
    }) => void;
    type onSceneAddedToFavorites = (eventData: {
        favoriteScenes: IFavoriteSceneList;
        scene: IFavoriteScene;
    }) => void;
    type onProductRemovedFromFavorites = (eventData: {
        favorites: IFavoriteProductList;
        product: IProduct;
    }) => void;
    type onSceneRemovedFromFavorites = (eventData: {
        favoriteScenes: IFavoriteSceneList;
        scene: IFavoriteScene;
    }) => void;
    type onProductAddedToCart = (eventData: {
        product: IProduct;
    }) => void;
    type onOrderSample = (eventData: {
        product: IProduct;
    }) => void;
}
interface IEventSystem {
    /** once, after the visualizer is loaded */
    visualizerLoaded: IEventsTypes.OnVisualizerLoaded;
    /** every time a scene is loaded */
    sceneLoaded: IEventsTypes.OnSceneLoaded;
    /** every time a product has be added to the scene and finished display */
    productChanged: IEventsTypes.OnProductChanged;
    /** every time a set finished display */
    sceneDisplayed: IEventsTypes.onSceneDisplayed;
    /** every time an hotspot was clicked on the scene */
    hotspotClicked: IEventsTypes.onHotspotClicked;
    /** every time a product was added to favorite */
    productAddedToFavorites: IEventsTypes.onProductAddedToFavorites;
    /** every time a set was added to favorite */
    sceneAddedToFavorites: IEventsTypes.onSceneAddedToFavorites;
    /** every time a product was removed from favorite */
    productRemovedFromFavorites: IEventsTypes.onProductRemovedFromFavorites;
    /** every time a set was removed from favorite */
    sceneRemovedFromFavorites: IEventsTypes.onSceneRemovedFromFavorites;
    /** every time a product was added to cart */
    productAddedToCart: IEventsTypes.onProductAddedToCart;
    /** every time order sample was clicked on scene */
    orderSample: IEventsTypes.onOrderSample;
}
export declare type EventSystemEventSignature = keyof IEventSystem;
export declare type EventSystemEventTypesSignature = IEventSystem[EventSystemEventSignature];
export declare type EventSystemEventDataSignature = Parameters<EventSystemEventTypesSignature>;
export declare type IScene = {
    id: string;
    index: string;
    title: string;
    subtitle: string;
    image: string;
};
export declare type IFavorite = {
    product: IProduct;
};
export declare type IFavoriteScene = {
    id: string;
    scene: IScene;
    image: string;
    favorites: Array<IFavorite>;
};
export declare type IFavoriteProductList = Array<IFavorite>;
export declare type IFavoriteSceneList = Array<IFavoriteScene>;
export declare type IFacet = {
    name: string;
    options: string[];
};
export declare type IFilter = IFacet;
export declare type IApplication = {
    application: string;
    image?: string;
};
export declare type IProduct = {
    sku: string;
    title: string;
    description: string;
    image: string;
    application: string;
    price: string;
    facets: IFacet[];
};
export interface IVisualizerConfig {
    containerSelector: string;
    experienceId: string;
    sceneId?: string;
}
export declare abstract class EventSystem extends TypedEmitter<IEventSystem> {
    /** start and load the visualizer app, will be triggered automatically on [data-role="visualizer"] elements
     * after complete will emit a "visualizerLoaded" event
     */
    abstract initAndLoad(): any;
    /** will return the scene list available in this experience */
    abstract getSceneList(): Array<IScene>;
    /** will set the current scene
     * after complete will emit a "sceneLoaded" event
     */
    abstract setScene(sceneId: string): any;
    /** will return products list according to the current application and filters */
    abstract GetProductList(): Array<IProduct>;
    /** will return applications available on this experience */
    abstract GetApplicationsList(): Array<IApplication>;
    /** will return the current applications */
    abstract GetCurrentApplication(): IApplication;
    /** will set the current applications */
    abstract SetCurrentApplication(application: IApplication): IApplication;
    /** will return the available filters */
    abstract GetFilters(): Array<IFilter>;
    /** will return the current filters */
    abstract GetCurrentFilters(): Array<IFilter>;
    /** will set the current filters */
    abstract SetFilter(filters: Array<IFilter>): Array<IFilter>;
    /** will set a product on a specific application
     * will emit a "productChanged" event after complete
     */
    abstract displayProduct(productSku: string, application: IApplication): Promise<void>;
    /** will display a saved scene
     * will emit a "sceneDisplayed" event after complete
     */
    abstract displayScene(setId: string): Promise<void>;
    /** will return the product displayed on an application in the current scene */
    abstract getDisplayedProduct(application: IApplication): IProduct;
    /** will return all displayed products in the current scene*/
    abstract getDisplayedProducts(): Array<IProduct>;
    /** will add a product to favorites
     * will emit a "productAddedToFavorites" event
     */
    abstract addProductToFavorites(productSku: string, application: IApplication): IFavoriteProductList;
    /** will remove a product from favorites
     * will emit a "productRemovedFromFavorites" event
     */
    abstract removeProductFromFavorites(productSku: string, application: IApplication): IFavoriteProductList;
    /** will return the favorite products */
    abstract getFavoriteProducts(): IFavoriteProductList;
    /** will add a scene to favorites
     * will emit a "sceneAddedToFavorites" event
     */
    abstract addFavoriteScene(): Promise<IFavoriteSceneList>;
    /** will remove a scene from favorites
     * will emit a "sceneRemovedFromFavorites" event
     */
    abstract removeFavoriteScene(setId: string): IFavoriteSceneList;
    /** will return the favorite set list */
    abstract getFavoriteScenes(): IFavoriteSceneList;
    /** will emit a "productAddedToCart" event */
    abstract addProductToCart(product: IProduct): any;
    /** will emit a "orderSample" event */
    abstract orderSample(product: IProduct): any;
}
export {};
