import DivaSet from '../Set/DivaSet';
import DivaArticle from './DivaArticle';
import ArticleOptionState from './ArticleOptionState';
import DivaCatalogData from '../../model/Catalog/CatalogData';
import BundleRule from '../../interface/Rules/BundleRules';
import IntiArticleType from '../../interface/Articles/InitArticleType';
import { ParamsAddPlannerElement } from '../../interface/FunctionTypes';
import CatalogArticleData from '../../model/Articles/Article/CatalogArticleData';
import PartListArticleToLoad from '../../interface/Articles/PartListArticleToLoadType';
import { DoChangeRetailArticleNumbers } from '../../interface/Articles/ArticlePrefixesType';
import { OrderLineData, VariantItemData, CompactOrderLineData as CompactOrderLine } from '@crystaldesign/basket-model';
import { BannerRule, Events, NotificationEventType, NotificationRule, Rule, WarningRule } from '../../interface/Rules/NotificationRule';
import { CustomDimensionsType } from '../../interface/DivaSetDataType';
declare class DivaArticleHandler {
    loadArticle(set: DivaSet, articleCodex: string, initParams: IntiArticleType | ParamsAddPlannerElement, onInit?: boolean): Promise<DivaArticle>;
    preLoadArticles(set: DivaSet, initParams: (IntiArticleType | ParamsAddPlannerElement)[], onInit?: boolean): Promise<{
        [catalogCodex: string]: {
            toLoad: (IntiArticleType | ParamsAddPlannerElement)[];
            catalog: DivaCatalogData;
            loadedArticles: CatalogArticleData[];
        };
    }>;
    updateAccessoireQuantity(accessoire: DivaArticle, newQuantity: number): Promise<void>;
    toDoAfterArticleLoaded(article: DivaArticle, defaultValues: {
        [codex: string]: string;
    }, variantValues: {
        [codex: string]: string;
    }, from: 'initializingProduct' | 'initializingPartlist' | 'initializing', variantItems?: VariantItemData[], ignorePlanner?: boolean): Promise<void>;
    getArticleInfos(activeArticles: string[], targetArticles: string[], articles: {
        [codex: string]: DivaArticle;
    }): {
        [posNr: string]: {};
    } | undefined;
    updateArticlesOptionStates(myValues: {
        [optCodex: string]: string;
    }, targetArticlesWithNewValues: string[], targetArticlesToUpdate: string[], articles: {
        [basketId: string]: DivaArticle;
    }, from?: 'FromViewClick' | 'calcVariant' | 'initializing' | 'initializingPartlist' | 'initializingProduct' | 'initializingAfterTrans'): Promise<{
        newEDOExtraArticles: any[];
        targetArticlesToUpdate: string[];
        partlistArticlesToLoad: PartListArticleToLoad[];
    }>;
    private triggerUpdateOnVisiblePartilstArticles;
    /**
     * diomex specific function to set options that are currently with an undefined value but visible in ui
     */
    private updateEmptyOption;
    private updateAccessoriesFromGlobalOption;
    private checkEDOArticles;
    getDefaultValuesOfArticles(articles: {
        [bascetId: string]: DivaArticle;
    }): {
        [optCodex: string]: string;
    };
    /************************************************************updateCfgValues********************************************************************************/
    initCfgValues(article: DivaArticle, variantValues: {
        [codex: string]: string;
    }, // Werte aus einem Basiskonfigurat,
    variantItems?: VariantItemData[]): Promise<void>;
    /**
     * This function recalcs the configuration the a specific Article considering all the different and complicated rules
     * you can add the newConfigValues to change the configuration. these get set if they are valid and these can influence
     * other depending configvalues
     * this includes the Price and the loaded Partlistarticles
     * @param article specific Article
     * @param newConfigValues newConfigValues to change the configuration
     * @param alreadyInitializedValues these Values are filled when the article gets initialized from for expample a BasisKonfigurat. These are more important then default Values which get init by evalSetFeatureDefaultDecisions.
     */
    updateCfgValues(article: DivaArticle, newConfigValues: {
        [optCodex: string]: string;
    }, alreadyInitializedValues: {
        [optCodex: string]: string;
    }, dontCalcPrice?: boolean, dontLoadPartlist?: boolean, calcVariantPrice?: boolean, onlyUpdateOnce?: boolean): Promise<PartListArticleToLoad[]>;
    private updateLastElement;
    updateOption(article: DivaArticle, optionCodex: string, newCodex: string, fallbackNewCodex?: string): Promise<void>;
    /****************************************Evaluieren und laden der Partlistarticles **********************************************************************************************************/
    evalAndLoadPartlistArticles(article: DivaArticle, dontLoadPartlist?: boolean, newConfigValues?: {
        [optCodex: string]: string;
    }): Promise<PartListArticleToLoad[]>;
    private loadPartlistArticles;
    private loadPartlistArticle;
    private partlistArticleInitData;
    /**************************************** Querkontrollen über mehrere Article deshalb hier im ArticleHandler ********************************************************************************/
    private evalOpvsOnOpvsConstructionRules;
    defineAllOptionsOfArticles(articles: {
        [basketId: string]: DivaArticle;
    }): void;
    checkNotificationRules(toCheckRules: NotificationRule[] | WarningRule[] | BannerRule[], articles: {
        [basketId: string]: DivaArticle;
    }, visitedOptions: {
        [basketId: string]: string[];
    }, event?: NotificationEventType): any[];
    checkRule(rule: Rule, article: DivaArticle, visitedOptions: {
        [basketId: string]: string[];
    }): boolean;
    checkOnEvent(article: DivaArticle, event?: Events, data?: any): boolean;
    private objectIncudesObject;
    private arrayIncludesArray;
    /*************************define options logic*************************/
    defineOptionsOnArticles(articlesAndOptions: {
        [basketId: string]: {
            article: DivaArticle;
            options: string[];
        };
    }): void;
    checkIfAllOptionsAreDefined(articles: {
        [basketId: string]: DivaArticle;
    }): {
        articleNames: string[];
        options: {
            optionCodex: string;
            baksetId: string;
        }[];
    };
    onDockChanged(dpType: 'AVL' | 'AVR', article: DivaArticle, dockedToArticle: DivaArticle): boolean;
    private onDockUpdate;
    triggerShelfplannerVisibility(artices: {
        [basketId: string]: DivaArticle;
    }, gridGroup?: string): Promise<void>;
    dockedOnAV(type: 'AVR' | 'AVL', article: DivaArticle): DivaArticle | undefined;
    /***************************************Abspeichern orderLines******************************************************/
    getOrderLinesOfArticles(articles: {
        [basketId: string]: DivaArticle;
    }, customDimensions?: CustomDimensionsType[], repairOnly?: boolean, hasFavorites?: boolean): OrderLineData[];
    /**
     * if prices are calculated due to product rabatt it may be possible that due to rounding rest the sum of all the orderlines is not identical to the overwritten productprice
     * for that rounding problematic we calculate the rest and add that to an orderline with price.
     */
    checkForRoundingError(orderlines: OrderLineData[], set: DivaSet): void;
    private getOptiontreeAccessoiresArr;
    splitAccessoiresFromMainArticles(articles: {
        [basketId: string]: DivaArticle;
    }): {
        mainArticles: {
            [basketId: string]: DivaArticle;
        };
        accessoires: {
            [basketId: string]: DivaArticle;
        };
    };
    splitShelfAccessoiresFromArticles(articles: {
        [basketId: string]: DivaArticle;
    }): {
        mainArticles: {
            [basketId: string]: DivaArticle;
        };
        shelfAccessoires: {
            [basketId: string]: DivaArticle;
        };
    };
    getOptionsStatesOfArticles(articles: {
        [basketId: string]: DivaArticle;
    }): {
        [basketId: string]: Map<string, ArticleOptionState>;
    };
    private getAccessoiresBasketData;
    getCompactOrderLine(articles: {
        [basketId: string]: DivaArticle;
    }): {
        [basketId: string]: CompactOrderLine;
    };
    /**
     * This function corrects the partlist based on different rules.
     * Rule bundleRules: Combines multiple partlist articles to a combination of them
     * Rule doChangeRetailArticleNumbers  Based on some rule it can happen, that some SAP or ZKAT numbers have to change. All Partlist articles with an origRetailArticleNr get the new one.
     * @param article
     * @param partlistArticlesToLoad
     * @param bundleRules
     * @param doChangeRetailArticleNumbers
     */
    correctPartlistArticlesByGlobalRules(set: DivaSet, partlistArticlesToLoad: PartListArticleToLoad[], bundleRules: BundleRule[] | undefined, doChangeRetailArticleNumbers?: DoChangeRetailArticleNumbers): Promise<void>;
    private bundlePartlistArticles;
    private createNewPartlistArticleByArticleCodex;
}
declare const articleHandlerInstance: DivaArticleHandler;
export default articleHandlerInstance;
//# sourceMappingURL=DivaArticleHandler.d.ts.map