/**
 * root node of product data.
 */
export interface IGXE_Object {
    Format_Version: number;
    Content_Version: string;
    Valid_from?: Date;
    Valid_to?: Date;
    Price_Type: EPriceType;
    /** Used VAT must be specified, if the given prices have VAT included */
    VAT?: number;
    Articles: {
        [artnum: string]: IArticle;
    };
    PropertyClasses?: {
        [classId: string]: IPropertyClass;
    };
    Conditions?: {
        [conditionId: string]: ICondition;
    };
    InterProduct?: IInterProductRules;
}
export declare type TConditionID = string;
export declare enum EPriceType {
    /** There are no prices included or if, they should be ignored */
    None = 0,
    /** The included prices are purchase ("EK") prices */
    Purchase = 1,
    /** The included prices are sales ("VK") prices */
    Sales = 2
}
/**
 * All possible types of price entries per article
 */
export declare enum EPriceLevel {
    /** Base price */
    Base = 0,
    /** Addition price, if currency is %, calculate absolute value on base
     *  price
     */
    AddToBase = 1,
    /** Addition price, if currency is %, calculate absolute value on the
     *  sum of base price and all additional prices
     */
    AddToSum = 2
}
/**
 * All possible types of properties
 */
export declare enum EPropertyType {
    Bool = 0,
    Float = 1,
    Int = 2,
    String = 3,
    Material = 4
}
/**
 * How condition operators can be compared
 */
export declare enum EConditionCompare {
    /** op1 == op2 */
    Equal = 10,
    /** op1 > op2 */
    Greater = 11,
    /** op1 >= op2 */
    GreaterOrEqual = 12,
    /** op1 < op2 */
    Smaller = 13,
    /** op1 <= op2 */
    SmallerOrEqual = 14,
    /** op1 IN [a, b, c] */
    In = 15
}
/**
 * How conditions can be chained. op1 and op2 have to be of type ICondition
 */
export declare enum EConditionJoin {
    AND = 1,
    OR = 2,
    PLUS = 3,
    MINUS = 4,
    MUL = 5,
    DIV = 6
}
export declare enum EPropertyValueUnitGroup {
    LENGTH = "LENGTH",
    AREA = "AREA",
    VOL = "VOL",
    MASS = "MASS",
    ANGLE = "ANGLE"
}
export declare enum EPropertyValueUnit {
    /** Meter */
    LENGTH_M = 100,
    /** Centimeter */
    LENGTH_CM = 101,
    /** Millimeter */
    LENGTH_MM = 102,
    /** Feet */
    LENGTH_FT = 103,
    /** Inches */
    LENGTH_IN = 104,
    /** Square Meter */
    AREA_M2 = 200,
    /** Square Centimeter */
    AREA_CM2 = 201,
    /** Square Millimeter */
    AREA_MM2 = 202,
    /** Square Feet */
    AREA_FT2 = 203,
    /** Square Inches */
    AREA_IN2 = 204,
    /** Cubic Meter */
    VOL_M3 = 300,
    /** Cubic Centimeter */
    VOL_CM3 = 301,
    /** Cubic Millimeter */
    VOL_MM3 = 302,
    /** Cubic Foot */
    VOL_FT3 = 303,
    /** Cubic Inches */
    VOL_IN3 = 304,
    /** Liter */
    VOL_L = 305,
    /** US Gallon */
    VOL_GAL = 306,
    /** Metric Kilogram */
    MASS_KG = 400,
    /** Metric gram */
    MASS_G = 401,
    /** Metric Milligram */
    MASS_MG = 402,
    /** Metric Ton */
    MASS_T = 403,
    /** US Pounds */
    MASS_LBS = 404,
    /** US Ounces */
    MASS_OZ = 405,
    /** Angle (Degree) */
    ANGLE_DEG = 500
}
/**
 * Article.
 */
export interface IArticle {
    /** Optional EAN */
    EAN?: string;
    /** Manufacturer ID */
    Manufacturer: string;
    /** Series ID */
    Series: string;
    /** Article short text. Each Array item is a line. */
    ShortText: string[];
    /** Article long text. Each Array item is a line. */
    LongText: string[];
    /** Array of IDs of Property Classes for this article. (optional)*/
    PropertyClasses?: string[];
    /** Array of IPrice objects */
    Prices: IPrice[];
    /** Article has a graphic representation (default: true) */
    HasGraphics?: boolean;
    /** Article should be added to basket/BOM (default: true) */
    IsCommercial?: boolean;
    /** Condition ID for checking the configuration (does not set any visibility) */
    Condition?: TConditionID;
}
/**
 * Price item.
 */
export interface IPrice {
    /** ISO 4217 currency code or "%" when level != "Base". */
    Currency: string;
    /** price value */
    Value?: number;
    RangeMin?: number;
    RangeMax?: number;
    /** type of price */
    Level: EPriceLevel;
    /** precondition ID defining validity of this price item */
    Precondition?: TConditionID;
    /** optional text. Each Array item is a line. */
    Text?: string[];
}
/**
 * Collection of properties.
 */
export interface IPropertyClass {
    /** List of property objects */
    Properties: {
        [id: string]: IProperty;
    };
    /** Optional precondition ID defining the visibility of the PropClass */
    Precondition?: TConditionID;
}
export declare type PropertyType = "input" | "choiceList" | "toggle" | "readonly";
/** Generic property type. */
export interface IProperty {
    Type: PropertyType;
    /** Property Key. */
    Key: string;
    /** Text. Each Array item is a line. */
    Text: string[];
    Image?: string;
    /** Type of the values. */
    ValueType: EPropertyType;
    /** Optional unit of values. */
    ValueUnit?: EPropertyValueUnit | string;
    /** Allow the user to enter own values?  (default: false) */
    AdditionalValues?: boolean;
    /** Optional value range, low bound */
    ValueRangeFrom?: number;
    /** Optional value range, high bound */
    ValueRangeTo?: number;
    /** Current value. */
    Value?: TPropertyValue;
    /**
     * List of all possible values.
     */
    Values: IPropertyValue[];
    SubProperties: IProperty[];
    /** Visibility */
    Visible?: boolean;
    /** Editability */
    Editable?: boolean;
    Group?: IPropertyGroupDescription;
    /** Optional precondition ID defining the visibility of the Property */
    Precondition?: TConditionID;
    /** Property is valid? */
    Enabled?: boolean;
    ParentPropertyKey?: string;
    /** Optional position index for sorting the properties in the UI */
    Position?: number;
    /** A virtual property is hidden from UI but can be used for conditions and other tasks */
    Virtual?: boolean;
    /** Include this property and value in the variant code of the article*/
    InVarCode?: boolean;
    /** Does the changing of a value requires the geometry to update? */
    Geometric?: boolean;
    /** Apply the value of this property to this Material Category on change */
    MaterialCategory?: string;
    /** Optional default value (otherwise the first valid element from Values[] will be used) */
    Default?: TPropertyValue;
}
export interface IPropertyGroupDescription {
    Key: string;
    Title?: string;
    Description?: string;
    Image?: string;
}
export interface IPropertyGroup extends IPropertyGroupDescription {
    Properties: IProperty[];
    IsDefault: boolean;
}
/**
 * Creates a list of groups using the group definition of the properties.
 *
 * All properties without a definition will be added to a default group. This default group
 * can be identified using the value of its IsDefault property.
 *
 * @param {IProperty[]} properties
 * @returns
 */
export declare const createPropertyGroups: (properties: IProperty[]) => IPropertyGroup[];
/**
 * Supported Property Value Types
 */
export declare type TPropertyValue = string | number | boolean;
/**
 * Property value.
 */
export interface IPropertyValue {
    /** Value (type must comply the value_type of IProperty object) */
    Value: TPropertyValue;
    /** Optional Value Text. Each Array item is a line. */
    Text?: string[];
    /** Optional precondition ID defining the visibility of the value */
    Precondition?: TConditionID;
    /** Optional Preview image */
    Image?: string;
    _pos?: number;
    /** Property is valid? */
    Enabled?: boolean;
    Visible?: boolean;
    Price?: number;
    PriceType?: "included" | "relative";
    Section?: IPropertyValueSectionDescription;
}
export interface IPropertyValueSectionDescription {
    Key: string;
    Title?: string;
    Description?: string;
    Image?: string;
}
export interface IPropertyValueSection extends IPropertyValueSectionDescription {
    Values: IPropertyValue[];
    IsDefault: boolean;
}
/**
 * Creates a list of sections using the section definition of the properties values.
 *
 * All values without a definition will be added to a default section. This default section
 * can be identified using the value of its IsDefault property.
 *
 * @param {IProperty} property
 */
export declare const createPropertyValueSections: (property: IProperty) => IPropertyValueSection[];
export interface PropertyValueChange {
    key: string;
    value: TPropertyValue;
}
export declare type PropertyValueChanges = Record<string, TPropertyValue> | PropertyValueChange[];
export declare const normalizePropertyValueChanges: (rawChanges: PropertyValueChanges) => PropertyValueChange[];
/**
 * Merges two property value changes
 *
 * @param {PropertyValueChanges} a
 * @param {PropertyValueChanges} b
 * @returns {PropertyValueChanges[]}
 */
export declare const mergePropertyValueChanges: (a: PropertyValueChanges, b: PropertyValueChanges) => PropertyValueChange[];
/**
 * Creates a flat configuration object from a list of changes
 *
 * @param {PropertyValueChanges} changes
 * @returns
 */
export declare const createArticleConfigurationValuesFromChanges: (changes: PropertyValueChanges) => Record<string, TPropertyValue>;
/**
 * Data structure to store an article's configuration state.
 */
export declare type IArticleConfiguration = ArticleConfigurationValues;
export declare type ArticleConfigurationValues = Record<string, TPropertyValue>;
/**
 * Generic condition.
 * Each condition consists of two operators, a relation between these
 * operators and an optional negator.
 *
 * Example 1: Op1 is a IProperty.id, Op2 is a property value
 *  {Op1: "PROP1", Comp: EConditionCompare.Equal, Op2: "W1"}
 * means: condition is true, when PROP1=W1
 *
 * Example 2: Op1 is a IProperty.id, Op2 is a list of property values
 *  {Op1: "PROP1", Comp: EConditionCompare.In, Op2: ["W1", "W2"]}
 * means: condition is true, when PROP1 IN (W1, W2)
 *
 * Example 3: Op1 and Op2 are ICondition, chained with AND
 *  {Op1: {
 *			Op1: "PROP1", Comp: EConditionCompare.Equal, Op2: "W1"
 *		},
 *   Comp: EConditionJoin.AND,
 *   Op2: {
 *		  Op1: "WIDTH", Comp: EConditionCompare.Greater, Op2: 900
 *		}
 *  }
 * means: (PROP1=W1) AND (WIDTH>900)
 */
export interface ICondition {
    Not?: boolean;
    Op1: ICondition | string;
    Comp: EConditionCompare | EConditionJoin;
    Op2: ICondition | TPropertyValue[] | TPropertyValue | null;
}
/**
 * InterProductRules defines extended relationships between articles.
 * ArticlePolymorphy can switch between articles based on their configuration.
 * Subarticles will be created when an article reaches a specific state and
 * will be removed when it loses this state.
 */
export interface IInterProductRules {
    ArticlePolymorphy?: {
        [InterProductID: string]: {
            [ArticleID: string]: {
                [PropKey: string]: TPropertyValue;
            };
        };
    };
    SubArticles?: {
        [SubarticleID: string]: {
            Source?: string;
            MainArticleIDs: string[];
            Configuration: {
                [PropKey: string]: TPropertyValue;
            };
        };
    };
}
export declare const createPropertyKey: (path: string[]) => string;
export declare const getPropertyNamesFromKey: (propertyKey: string) => string[];
/**
 * Retrieves the actual active value of a property. This can either be a value of the input property, or the value of a subproperty
 *
 * @param {IProperty} property
 * @returns {(IPropertyValue | undefined)}
 */
export declare const getFinalPropertyValue: (property: IProperty) => IPropertyValue | undefined;
/**
 * Retrieves a property from the property tree
 *
 * @template T
 * @param {T[]} properties
 * @param {(string | string[])} propertyPathOrKey
 * @returns
 */
export declare const findProperty: <T extends IProperty>(properties: T[], propertyPathOrKey: string | string[]) => T | undefined;
/**
 * Finds the definition for a value inside the properties direct subproperties and values.
 *
 * @param {IProperty} property
 * @param {TPropertyValue} targetValue
 * @returns
 */
export declare const findValueDefinition: (property: IProperty, targetValue: TPropertyValue) => IProperty | IPropertyValue | undefined;
export declare const isProperty: (item: IProperty | IPropertyValue) => item is IProperty;
/**
 * Retrieves all currently active subproperties for a property
 *
 * @param {IProperty} property
 * @returns
 */
export declare const findActiveSubProperties: (property: IProperty) => IProperty[];
/**
 * Creates a flat list of properties where all active subproperties are listed after their base property
 *
 * @param {IProperty[]} properties
 * @returns
 */
export declare const createActiveSubPropertyInjectedPropertyList: (properties: IProperty[]) => IProperty[];
/**
 * Creates a fake value representation from a property
 *
 * @param {IProperty} property
 * @returns {IPropertyValue}
 */
export declare const createFakeValueFromProperty: (property: IProperty) => IPropertyValue;
export declare type UnitConfiguration = Record<string, EPropertyValueUnit>;
