import { ClassificationInfo } from '@crystaldesign/product-handler';
import { ProductConfiguration } from '@crystaldesign/basket-model';
export interface ComponentDefinition<T extends Object = {}> {
    name: string;
    renderFunction: React.FC<ComponentProps<T>>;
}
export interface ComponentProps<T extends Object = {}> {
    key?: string;
    parameters?: {
        [key: string]: string;
    };
    internal?: {
        [key: string]: any | undefined;
    };
    settings: T;
    isVisible?: boolean;
}
export interface Modal {
    title?: string | JSX.Element;
    text?: string | JSX.Element;
    reject?: boolean | string;
    accept?: boolean | string;
    rejectByIcon?: boolean;
    actions?: {
        text: string;
        id: string;
        variant?: 'outlined' | 'contained';
        closeable?: boolean;
    }[];
    dontRenderForm?: boolean;
    callback?: (accepted: boolean | FormData | string) => void;
    content?: React.ReactElement | string;
    progress?: number;
    image?: string;
}
export interface Fullscreen {
    content: React.ReactElement;
    hideClose?: boolean;
    onClose?: () => void;
}
export interface DrawerMenu {
    id: string;
    snapPoints?: number[];
    noModal?: boolean;
    mountElement?: HTMLDivElement;
    showOverlay?: boolean;
    content: JSX.Element | React.ReactElement;
    wrapperStyle?: React.CSSProperties;
    direction?: 'left' | 'right' | 'bottom' | 'top';
    hideCloseButton?: boolean;
    onClose?: () => void;
    open?: boolean;
    title?: string | JSX.Element;
    backgroundColor?: string;
    handleInternScroll?: boolean;
}
export interface HeaderInfos {
    HeaderElement?: HTMLDivElement;
}
export type BannerType = 'INFO' | 'WARNING' | 'ERROR';
export interface Banner {
    key: string;
    type?: BannerType;
    title: string;
    text?: string;
    autoHideInSeconds?: number;
    hideClose?: boolean;
    useLocalStorage?: boolean;
    onClose?: () => void;
}
export interface ClassicSnackBar {
    type: 'classic';
    /**
     * The action to display. It renders after the message, at the end of the snackbar.
     */
    action?: React.ReactNode;
    /**
     * The message to display.
     */
    message?: React.ReactNode;
    /**
     * milliseconds to wait before automatically closing
     */
    autoHideDuration?: number;
}
export interface BigSnackBar {
    type: 'big';
    /**
     * It renders a QR-Code for the provided link above the message
     */
    qrCode?: string;
    /**
     * The message to display.
     */
    message?: React.ReactNode;
    /**
     * milliseconds to wait before automatically closing
     */
    autoHideDuration?: number;
}
export type SnackBar = ClassicSnackBar | BigSnackBar;
export interface LocalStorageValue {
    valuekey?: string;
    userid?: string;
    expireTimestamp: number;
}
interface SendProps {
    variant?: string;
    to: string;
    cc?: string;
    domain?: string;
    language?: string;
}
export interface SendEmailProps extends SendProps {
    data?: any;
    type: 'other';
    kind: string;
}
export interface SendOrderProps extends SendProps {
    type: 'basket';
    divaNr: string;
    version?: string | number;
}
export type EmailContent = SendEmailProps | SendOrderProps;
export type EmailData = {
    dialogText?: string;
    showDialog?: boolean;
    callback?: (success: boolean) => void;
    content: EmailContent;
};
export interface Theme {
    palette?: {
        primary?: {
            main: string;
            light: string;
            dark: string;
            contrastText: string;
        };
        secondary?: {
            main: string;
            light: string;
            dark: string;
            contrastText: string;
        };
        text?: {
            primary: string;
            secondary: string;
        };
    };
    typography?: {
        fontFamily: string;
    };
}
export interface External {
    url: string;
    openInNewTab?: boolean;
}
export interface Component {
    type?: string;
    identifier?: string;
    route?: string;
    parameters?: {
        [param: string]: string | undefined;
    };
    internal?: {
        [key: string]: any | undefined;
    };
    openInNewTab?: boolean | string;
    openInFullscreen?: boolean;
    absoluteFullscreen?: boolean;
}
export type Action = (Component & {
    breadcrumb?: boolean;
}) | External;
export interface ReplaceBreadcrumbs {
    type: 'replace';
    groupId: string;
    list: (AddBreadcrumbsParam & {
        level: number;
    })[];
}
export interface UpdateBreadcrumbs {
    type: 'update';
    param: AddBreadcrumbsParam;
}
export interface AddBreadcrumbsParam {
    groupId: string;
    level?: number;
    name: string;
    component: Component;
}
export type BreadcrumbParams = ReplaceBreadcrumbs | UpdateBreadcrumbs;
export type Event = {
    type: string;
    data?: any;
};
export interface OrganizationInfo {
    id: string;
    displayName: string;
}
export interface ApiConfig {
    analyticsService: string;
    authService: string;
    adminService: string;
    messageService: string;
    catalogService: string;
    supportService: string;
    mediaService: string;
    constructorService: string;
    basketService: string;
    reportService: string;
    idmService: string;
    aiService: string;
    enricherService: string;
    clientArticleService?: string;
    arViewerBaseUrl?: string;
    baseUrl: string;
    baseCdnUrl: string;
    host3d: string;
    diva3darchive: string;
    useDebugUrl?: boolean;
    api2: {
        default: string;
        ek: string;
        web: string;
    };
}
export interface Dimensions {
    isPortrait: boolean;
    isMobile: boolean;
    isTablet: boolean;
    width: number;
    height: number;
}
export type LoginMode = 'offline' | 'mixed' | 'online';
export interface FilterObject {
    id: string;
    value: any;
    op: string;
    or?: string;
}
export interface DivaCoreState {
    /**
     * Contains the current state of
     */
    state: State;
    /**
     * Contains all action functions
     */
    actions: Actions;
    handler: CoreHandlers;
}
export interface DivaCoreProps {
    components: ComponentDefinition<any>[];
    currentComponent?: Component;
    /**
     * @deprecated
     */
    configUrl?: string;
    defaultApiConfig?: Partial<ApiConfigConfig>;
    spinnerClass?: string;
    language?: string;
    organizationId?: string;
    domain?: string;
    identifier?: string;
    telemetry?: boolean;
    environment?: string;
    onEvent?: (event: Event) => void;
}
export interface ApiConfigConfig {
    authService: string;
    adminService: string;
    messageService: string;
    catalogService: string;
    supportService: string;
    constructorService: string;
    mediaService: string;
    aiService: string;
    basketService: string;
    reportService: string;
    baseUrl: string;
    host3d: string;
    api2: string;
    showInitWarnBanner?: string;
}
export interface OrganizationData {
    _id: string;
    logoUrl: string;
    internalId: string;
    displayName: string;
    street: string;
    city: string;
    region: string;
    zipCode: string;
    countryCode: string;
    phone: string;
    email: string;
    originEnvironmentUrl: string;
    type?: 'SUPPLIER' | 'RETAILER';
    parentType?: 'SUPPLIER' | 'RETAILER';
    settings: {
        defaultCurrency: string;
        useCatalogTranslations: string;
        calcEkPriceForProducts?: boolean;
        hidePrices?: 'DEFAULT_VISIBLE' | 'DEFAULT_HIDDEN' | 'ONLY_VISIBLE' | 'ONLY_HIDDEN';
        enable3DExport?: boolean;
        enableAR?: boolean;
        pricePreview?: 'fromBasePrice' | 'fromCurrentPrice' | 'fromCurrentPriceHideCurrent' | 'off';
        renderjobSeparateMaterials?: boolean;
        enableRTV?: boolean;
        forceRTV?: boolean;
        enableVKMarketing?: boolean;
        enableInsights?: boolean;
        disableCollectionEditor?: boolean;
    };
    api2Location?: {
        ek?: {
            url: string;
        };
        vk?: {
            url: string;
        };
        web?: {
            url: string;
        };
    };
    shopBaseUrl?: string;
}
export interface UserData {
    familyName?: string;
    name: string;
    birthdate?: number;
    gender?: string;
    locale?: string;
    picture?: string;
    pictureRefId?: string;
    mainEmail: string;
    phoneNumber?: string;
    isActive?: boolean;
    personalNumber?: string;
    isEmailVerified?: boolean;
    created: number;
    lastUpdated: number;
    createdBy: string;
    lastUpdatedBy: string;
    _id: string;
    cometChatAuthToken?: string;
}
export type UserRole = 'V' | 'E';
export interface BaseNavigationConfiguration {
    logoUrl?: string;
    logoAction?: Action;
    buttons: Button[];
    imprintUrl?: string;
    privacyUrl?: string;
    tosUrl?: string;
    supportUrl?: string;
    feedbackUrl?: string;
    showFooter?: boolean | 'hidden';
    enableMobile?: boolean;
    hideHeader?: boolean;
}
export interface NavigationConfiguration extends BaseNavigationConfiguration {
    customLogo?: string;
    customHeaderElement?: () => JSX.Element;
    breadcrumbs?: Breadcrumbs;
    showFooter: boolean | 'hidden';
    allowHidePrices: boolean;
    showLogin: boolean;
}
export interface Button {
    text: string;
    action: Action;
    permission?: string;
    isPublic?: boolean;
}
export interface Breadcrumbs {
    breadcrumbs: Breadcrumb;
    current: number;
}
export interface Breadcrumb {
    id: string;
    path: Path[];
}
interface Path {
    level: number;
    name: string;
    component: Component;
}
export interface PrintOptionsData {
    Gdpr?: boolean;
    arQrCode: boolean;
    PlanningSketch?: boolean;
    Remark?: boolean;
    Prices?: boolean;
    AllPrices?: boolean;
    OpvCodices?: boolean;
    ModelName?: boolean;
    CollectionLogo?: boolean;
    DivaLogo?: boolean;
    Signature?: boolean;
    ClientpersonData?: boolean;
    SalespersonData?: boolean;
    Partlist?: boolean;
    PrintDate?: boolean;
}
export interface CatalogInfoData {
    lang: string;
    name?: string;
    accountLogo?: string;
    description?: string;
    hasPlanner: boolean;
    has3D: boolean;
    brand?: string;
    currency?: string;
    images: {
        name: string;
        thumbUrl: string;
        url: string;
    }[];
    documents: {
        name: string;
        url: string;
    }[];
}
export interface ProductData {
    _id: string;
    parent?: string;
    originDivaNr?: string;
    baseProduct?: boolean;
    divaNr?: string;
    variantId?: string | number;
    modelName_locales?: {
        [lang: string]: string;
    };
    shortDescription_locales?: {
        [lang: string]: string;
    };
    info_locales?: {
        [lang: string]: string;
    };
    technicalDescription_locales?: {
        [lang: string]: string;
    };
    shortTechnicalDescription_locales?: {
        [lang: string]: string;
    };
    configuration?: ProductConfiguration;
    modelName?: string;
    shortDescription?: string;
    info?: string;
    technicalDescription?: string;
    shortTechnicalDescription?: string;
    orderDescription?: string;
    width?: number;
    height?: number;
    depth?: number;
    calculatedPrice?: number;
    addedPrice?: number;
    discountedPrice?: number;
    livingArea?: string;
    mainCategory?: string;
    subCategory?: string;
    image?: string;
    image2D?: string;
    catalogId?: string[];
    collection?: string[];
    catCodex?: string[];
    supplierArticleNr?: string[];
    retailerArticleNr?: string;
    availableForOrganizations?: string[];
    brand?: string;
    currency?: string;
    articles?: {
        catalogCodex: string;
        articleCodex: string;
        variantValues?: {
            [key: string]: string;
        }[];
    }[];
    dockingPoints?: {
        openAVLFilter?: string[];
        openAVRFilter?: string[];
    };
    media?: any[];
    affiliate?: any[];
    delivery?: any;
    isTopseller?: boolean;
    classificationInfo?: ClassificationInfo;
    uniqueHash?: string;
    collectionId?: string;
}
export interface DivaCoreState {
    /**
     * Contains the current state
     */
    state: State;
    /**
     * Contains all action functions
     */
    actions: Actions;
    handler: CoreHandlers;
}
interface ComponentChangeProps {
    isBlocked?: boolean;
    callback?: () => void;
}
export interface State {
    /**
     * An array of all available component types
     */
    availableComponents: string[];
    /**
     * An array of all avialable languages
     */
    availableLanguages: string[];
    /**
     * The currently loaded organization
     */
    organization: OrganizationData;
    /**
     * The ordered list of the current organization and its parents
     */
    organizationHierarchy: {
        _id: string;
        displayName: string;
        type?: string;
    }[];
    /**
     * The currently logged in user
     */
    user?: UserData;
    /**
     * The JWT of the currently logged in user
     */
    jwt?: string;
    /**
     * The token used to authenticate the user
     */
    nToken?: string;
    /**
     * The configuration for the navigationbar
     */
    navigationConfiguration: NavigationConfiguration;
    /**
     * True if the application is currently initializing
     */
    initializing: boolean;
    /**
     * True if the loading spinner is currently vissible
     */
    loading: boolean;
    /**
     * Specifies if the prices should be displayed or not
     */
    hidePrices: boolean;
    /**
     * Specifies if the additional prices should be displayed or not in planner
     */
    hideConfigPricePreview: boolean;
    /**
     * The current dimensions of the containing div
     */
    dimensions: Dimensions;
    isMobile: boolean;
    /**
     * The current state of the navigator
     */
    headerInfos: HeaderInfos;
    /**
     * Contains the location of all services
     */
    apiConfig: ApiConfig;
    /**
     * The current theme of the application
     */
    theme: Theme;
    /**
     * The current LoginMode of the application
     */
    loginMode: LoginMode;
    /**
     * The context in which the application is running
     */
    applicationEnvironment: 'SELLER' | 'WEB';
    /**
     * there is currently a fullscreen component active
     */
    isFullscreenComponent: boolean;
    /**
     * there is supportservice enabled
     */
    enableSupport: boolean;
    /**
     * config for google maps
     */
    googleMapsConfig?: any;
    /**
     * comet chat config params
     */
    cometChatConfig?: any;
    /**
     * defaultComponent
     */
    defaultComponent?: Component;
    /**
     * currentComponent
     */
    currentComponent?: Component;
    /**
     * componentChange
     */
    componentChange?: ComponentChangeProps;
}
export interface Actions {
    /**
     * Opens a new component or an external URL
     *
     * It takes care of the component/url should be opened in a new tab and if it is blocked by the browser
     */
    openComponent: (data: Action) => Promise<void>;
    /**
     * Opens a component in Fullscreen
     */
    closeComponentInFullscreen: () => void;
    /**
     * Sets flag for dimension calculation to use absoulte window size
     */
    setAbsoluteFullScreen: (val: boolean) => void;
    /**
     * Updates or replaces the breadcrumbs
     */
    updateBreadcrumbs: (params: BreadcrumbParams) => void;
    /**
     * Opens a new modal
     */
    openModal: (data: Modal) => void;
    /**
     * Closes a currently open modal
     */
    closeModal: () => void;
    /**
     * Send an email and optionally opens an input dialog before sending
     */
    sendEmail: (data: EmailData) => Promise<'success' | 'error' | 'aborted'>;
    /**
     * Adds a custom logo to a list of components
     */
    updateCustomLogo: (components: string[], logo?: string) => void;
    /**
     * Adds a custom header element to a list of components
     */
    updateCustomHeaderElement: (components: string[], element?: any) => void;
    /**
     * Toggles the hide prices flag
     *
     * In case "allowHidePrices" is set to "hidden" or "false" for the component, this function has no effect
     */
    toggleHidePrices: () => void;
    /**
     * Toggles the hide additonal prices flag
    
     */
    toggleHideConfigPricePreview: () => void;
    /**
     * Toggles the loading spinner
     *
     * Only after loading is set to "false" for all IDs, the spinner will be closed
     *
     * @param id an arbitrary ID for the current loading process
     * @param hidden if the component should be hidden during the loading process
     * @param toggle set explizitly if the spinner should be activated or deactivated
     */
    toggleLoading: (id: string, hidden?: boolean, toggle?: boolean) => void;
    /**
     * Update the current language
     */
    changeLanguage: (lang: string) => void;
    /**
     * Update the current userMode
     */
    changeLoginMode: (loginMode: LoginMode) => void;
    /**
     * Send an event to a handler outside of diva
     */
    onEvent: (event: Event) => void;
    /**
     * Subscribe an event handler for events from outside of diva
     */
    subscribeEvents: (fn: (event: Event) => void) => void;
    /**
     * Unsubscribe an event handler for events from outside of diva
     */
    unSubscribeEvents: (fn: (event: Event) => void) => void;
    /**
     * Update the current organization
     */
    setOrganization: (organizationId: string) => void;
    /**
     * returns the sessionGuid for the API2. Is async because if not already loaded it make a loginByAuthToken
     */
    getSessionGuid: (userRole: UserRole, loginMode?: LoginMode, organizationId?: string, api2Location?: string) => Promise<string>;
    /**
     * returns the AuthLogin object for the API2.
     */
    getApi2AuthLoginData: (userRole: UserRole, loginMode?: LoginMode, organizationId?: string, api2Location?: string) => Promise<any>;
    /**
     * Logout the current user
     */
    logout: () => void;
    /**
     * Open the login window
     *
     * If the user is already logged in, this function has no effect
     */
    showLoginWindow: () => void;
    /**
     * Checks if the user has a certain permission
     */
    userHasPermission: (permission: string) => boolean;
    /**
     * Open a fullscreen window
     */
    openFullscreen: (fullscreen: Fullscreen) => void;
    /**
     * Close a fullscreen window
     */
    closeFullscreen: () => void;
    /**
     * Open the DrawerMenu
     */
    openDrawerMenu: (drawerMenu: DrawerMenu) => void;
    /**
     * Close the DrawerMenu
     */
    closeDrawerMenu: (id?: string, destroy?: boolean) => void;
    /**
     * Updates HeaderInfos so other component know the state of the header
     */
    updateHeaderInfos: (headerInfos: HeaderInfos) => void;
    /**
     * Open a banner to show infos
     */
    openBanner: (banner: any) => void;
    closeBanner: () => void;
    /**
     * converts a action object to an url
     * @param action
     * @returns url
     */
    resolveComponent: (action: Action) => string;
    openSnackBar: (data: SnackBar) => void;
    setComponentChange: (value: ComponentChangeProps) => void;
}
export interface CoreHandlers {
    productHandler: any;
    organizationHandler: any;
    mediaHandler: any;
    adminHandler: any;
    analyticsHandler: any;
    reportHandler: any;
    supportHandler: any;
    authorizationHandler: any;
    clientArticleHandler: any;
    aiHandler: any;
}
export {};
//# sourceMappingURL=index.d.ts.map