import { Omit } from "@intelligentgraphics/ig.utilities";
import { IGXB, IGXE } from "@intelligentgraphics/igd.core";
export declare type IGXBSearchOptions = {
    itemSet?: IGXB.TItems;
    searchMode?: "item" | "parent" | "all";
};
export interface IIGXBManagerSettings {
    /** Initial BOM structure, use static method createNewIGXB() when you have none */
    data: IGXB.IGXB_Object;
    /** Create item groups based on manufacturerId and programId. */
    autoGrouping?: boolean;
}
export interface IIGXBManagerAddArticleInfo {
    /** Manufacturer ID */
    ManufacturerId: string;
    /** Program ID */
    ProgramId: string;
    /** Manufacturer Name */
    ManufacturerName: string;
    /** Program Name */
    ProgramName: string;
    /** Article number */
    ArticleId: string;
    /** ArticlePackageId */
    ArticlePackageId?: string;
    /** Article (short) text. Use this field, if you have just one kind of article text. */
    ArticleShortText: IGXB.TTextEntry;
    /** Article long text */
    ArticleLongText?: IGXB.TTextEntry;
    /** Article variant text */
    ArticleVarText?: IGXB.TVarText;
    /** Article variant code */
    ArticleVarCode?: string;
    /** Article custom (user-defined) text */
    ArticleCustomText?: IGXB.TTextEntry;
    /** Is this an alternative position? (defaults to false) */
    IsAlternative?: boolean;
    /** Commercially relevant? (defaults to true) */
    IsCommercial: boolean;
    /** Quantity (defaults to 1.0) */
    Quantity?: number;
    /** Unit (defaults to "" which mostly means "Pieces") */
    Unit?: string;
    /** Price of a singe unit as it comes from product data */
    SinglePrice?: number;
    /** Additional prices of a singe unit as it comes from product data (like surcharge for a specific color) */
    AdditionalPrices?: IGXB.TAdditionalPrices;
    /** Additional prices of a singe unit as defined by the user */
    CustomPrices?: IGXB.TAdditionalPrices;
    /** Currency as ISO-4217 string (like "EUR", "USD"). Must be given if SinglePrice is given. */
    Currency?: string;
    /** Commercial id for synchronizing BOM entry with product data */
    ComId: any;
    /** Graphical id for synchronizing BOM entry with a graphic representation */
    GfxId?: any;
    /**
     * Id for electronic data interfaces e.g. pin to read from
     * server, or ediData-Object to create LINE/MASS/SAME for this item
     */
    EdiId?: any;
    /** Product data source, useful when using multiple product data sources */
    Source: string;
    /** Article Image either as URI or Base64 encoded */
    Image?: string;
    /** Position x, y, z */
    Position?: {
        x: number;
        y: number;
        z: number;
    };
    /** Rotation x, y, z */
    Rotation?: {
        x: number;
        y: number;
        z: number;
    };
    Configuration?: IGXE.IArticleConfiguration;
    Data: IGXB.IArticleData;
}
/**
 * IGXB Manager class for BOM processing.
 * This is still subject to change and far from complete, use at your own risk.
 */
export declare class IGXBManager {
    private _settings;
    private data;
    static Create(settings: IIGXBManagerSettings): IGXBManager;
    private static getUUID;
    /**
     * Creates an instance of IGXBManager.
     *
     * DO NOT USE THIS DIRECTLY UNLESS YOU KNOW WHAT YOU'RE DOING.
     *
     * Use IGXBManager.Create instead
     *
     * @param {IIGXBManagerSettings} settings
     * @memberof IGXBManager
     */
    constructor(settings: IIGXBManagerSettings);
    getAllArticles(): IGXB.IArticleItem[];
    removeHeaderCalculation(onlyIndex?: number): void;
    addHeaderCalculation(entry: IGXB.IAdditionalPrice, beforeIndex?: number): void;
    /**
     * Removes an item.
     *  @param itemId ID of the item. It must not have sub-items.
     *  @returns true when the item has been removed.
     */
    removeItem(itemId: string, force?: boolean): boolean;
    addSetItem(data: Omit<IGXB.ISetItem, "UID" | "ItemType" | "Items">, inParentId?: string, beforeId?: string): string;
    /** Adds item group at root-level
     * @param caption Optional caption for the group
     * @param beforeId Optional UID of the item of which the group should
     * be inserted before. If not specified, the group will be
     * inserted as last item.
     * @returns UID of the new group item.
     */
    addItemGroup(caption?: string, beforeId?: string, groupIdentifier?: string): string;
    /** Adds a text item.
     * @param text Item text
     * @param important Flag this text as important for an emphasized
     *        representation
     * @param inParentId UID of a GroupItem or ArticleItem to place this
     *        item into as sub-position.
     * @param beforeId optional UID of the item of which this item should
     *        be inserted before. If not specified, the item will be
     *        inserted as last item at root level or (if specified) in the
     *        parent's set of sub-items.
     * @returns UID of the new text item.
     */
    addTextItem(text: IGXB.TTextEntry, important?: boolean, inParentId?: string, beforeId?: string): string;
    /** Adds a article item.
     * @param spec ArticleItem specification.
     * @param inParentId UID of a GroupItem or ArticleItem to place this
     * item into as sub-position.
     * @param beforeId optional UID of the item of which this item should
     * be inserted before. If not specified, the item will be
     * inserted as last item at root level or (if specified) in the
     * parent's set of sub-items.
     * @returns UID of the new item.
     */
    addArticleItem(article: IIGXBManagerAddArticleInfo, inParentId?: string, beforeId?: string): string;
    addImpressionItem(impression: IGXB.IImpressionItem, inParentId?: string, beforeId?: string): string;
    moveItem(itemId: string, inParentId?: string, beforeId?: string): boolean;
    copyItem(input: IGXB.TAnyItem | string, inParentId?: string, beforeId?: string): string | undefined;
    /** Returns the BOM position string of an item.
     *  @param itemId ID of the item.
     *  @returns The position string, like "1" or "3.2.1" or an empty
     * string, if this item is not an ArticleItem.
     */
    getPositionString(itemId: string): string;
    /**
     * Returns the accumulated price for one position, including subitems and additional prices
     */
    private getSubTotal;
    getParentSet(item: string | IGXB.TAnyItem): IGXB.TAnyItem[];
    getParentItem(item: string | IGXB.TAnyItem): IGXB.IArticleItem | IGXB.IItemGroup;
    /**
     * Finds the parent ItemGroup of an item.
     * @param item: The item whose parent should be returned.
     * @returns: The parent ItemGroup or undefined, if the item has no parent group
     */
    getParentGroupItem(item: string | IGXB.TAnyItem): IGXB.IItemGroup;
    /**
     * Finds the parent ArticleItem of an item.
     * @param item: The item whose parent should be returned.
     * @returns: The parent ArticleItem or undefined, if the item has no parent Article Item
     */
    getParentArticleItem(item: string | IGXB.TAnyItem): IGXB.IArticleItem;
    getItem(itemID: string): IGXB.TAnyItem | undefined;
    /** Returns the IGXB article item with the given commercial ID */
    getItemByComId(comId: string): IGXB.IArticleItem | IGXB.IImpressionItem | IGXB.ISetItem | IGXB.IHeadDataItem | undefined;
    /** returns a flat list of IGXB article items that match the given source */
    getItemsBySource(source: string): IGXB.IArticleItem[];
    IGXB: IGXB.IGXB_Object;
    /** Creates a new BOM structure
     * @param priceType: IGXB price type (None, Net, Gross)
     * @param vat: VAT in percent must be given when price type is Gross
     */
    static createNewIGXB(priceType: IGXB.EPriceType, vat?: number): IGXB.IGXB_Object;
    readonly Settings: IIGXBManagerSettings;
    protected findItem(uid: string, items?: IGXB.TItems, searchMode?: "item" | "parent"): IGXB.TAnyItem | undefined;
    findByConditions<T extends IGXB.TAnyItem>(conditions: Partial<T> | ((article: T) => boolean), options: {
        itemSet?: IGXB.TItems;
        searchMode: "all";
    }): T[];
    findByConditions<T extends IGXB.TAnyItem>(conditions: Partial<T> | ((article: T) => boolean), options?: {
        itemSet?: IGXB.TItems;
        searchMode?: "item" | "parent";
    }): T;
    getSubItems(item: IGXB.TAnyItem): IGXB.TAnyItem[];
    /** Finds the index of an item in a given item set.
     *  @param uid: ID of an item (any type)
     *  @param items: list of items to be searched
     *  @returns: zero-based index of the item in the set or undefined if
     * the item is not part of the set.
     */
    protected findItemIndex(uid: string, items: IGXB.TItems): number;
    protected insertItemIntoParent(item: IGXB.TAnyItem, parentId: string, beforeId?: string): boolean;
    protected insertItemIntoSet(newParent: IGXB.TAnyItem | undefined, item: IGXB.TAnyItem, beforeId?: string): boolean;
    private findOrCreateAutoGroup;
}
