import { IEdgeStyle, IStyleRule, LkEdgeData, LkNodeData, INodeStyle, SelectorType, IStyleIcon, IStyleImage, IStyles, IRangeValues } from '@linkurious/rest-client'; import { StyleRule } from './styleRule'; export declare enum StyleType { COLOR = "color", ICON = "icon", SIZE = "size", IMAGE = "image", SHAPE = "shape", WIDTH = "width" } export interface Legend { [key: string]: Array<{ label: string; value: string | IStyleIcon | IStyleImage | number; }>; } export declare const SORTING_RULE: string[]; export declare class StyleRules { private _rules; constructor(rules: Array>); /** * Return an array of StyleRule with only 'color' rules and sorted by specificity, itemType and index * * @return {Array} */ get color(): Array; /** * Return an array of StyleRule with only 'icon' rules and sorted by specificity, itemType and index * * @return {Array} */ get icon(): Array; /** * Return an array of StyleRule with only 'image' rules and sorted by specificity, itemType and index * * @return {Array} */ get image(): Array; /** * Return an array of StyleRule with only 'shape' rules and sorted by specificity, itemType and index * * @return {Array} */ get shape(): Array; /** * Return an array of StyleRule with only 'size' rules and sorted by specificity, itemType and index * * @return {Array} */ get size(): Array; /** * Return an array of StyleRule with only 'width' rules and sorted by specificity, itemType and index * * @return {Array} */ get width(): Array; /** * Return an object containing for each node style a sorted array of StyleRule * * @return {{[key: string]: Array} } */ get nodeRules(): { [key: string]: Array; }; /** * Return an object containing for each edge style a sorted array of StyleRule * * @return { {[key: string]: Array}} */ get edgeRules(): { [key: string]: Array; }; /** * Generate a legend with an array of style rules and existing items in visualization */ generateLegend(itemsData: Array): Legend; /** * Return the legend for a specific style type (color, icon, image...) */ static getLegendForStyle(styleType: StyleType, styles: Array, itemsData: Array): Array<{ label: string; value: string | number | IStyleIcon | IStyleImage; }>; /** * Sanitize value for legend */ static sanitizeValue(styleType: SelectorType, value: IRangeValues | number | string | boolean): string; /** * Add items in legend for automatic coloring */ static addLegendAutoColors(itemsData: Array, styleRule: StyleRule, currentLegend: Array<{ label: string; value: string | number | IStyleIcon | IStyleImage; }>): void; /** * Return the label of item type for a legend item */ static getTypeLabel(type: string | undefined | null): string; /** * Return the color of item type from the list of styles */ getColorForType(type: string): string; /** * Return the icon of item type from the list of styles */ getIconForType(type: string): string | number | undefined; /** * Check if a legend item already exists and overwrite it / push it */ static updateLegend(legend: Array<{ label: string; value: string | number | IStyleIcon | IStyleImage; }>, { label, value }: { [key: string]: string; }): void; /** * return an array of StyleRule, containing only the desired style */ static getBy(styleType: StyleType, rules: Array>): Array; /** * From a RawStyle, generate a StyleRule of a specific style */ static getRule(rawRule: IStyleRule, styleType: StyleType): StyleRule; /** * Check for non unique index in styles rules and update them if exists */ static sanitizeStylesIndex(styles: IStyles): IStyles; }