import type { Color } from '@linkurious/ogma'; import { IImageDataValue, INodeStyle, IStyleIcon, IStyleImage, LkNodeData, OgmaNodeShape } from '@linkurious/rest-client'; import { StyleRule } from './styleRule'; import { ItemAttributes } from './itemAttributes'; export interface OgmaImage extends IStyleImage { url?: string; } export declare enum NodeSizeExtrema { MIN = 50, MAX = 500 } export declare class NodeAttributes extends ItemAttributes { private _baseUrl?; constructor(rulesMap: { color?: Array>; icon?: Array>; image?: Array>; shape?: Array>; size?: Array>; }); /** * Run the callback if an item match with a style in the array of rules */ private static matchStyle; /** * Generate color for a given node (call only if _rulesMap.color is defined */ color(itemData: LkNodeData): Color | Array; /** * Generate icon for a given node */ icon(itemData: LkNodeData): { icon?: IStyleIcon; image?: OgmaImage | null; }; /** * Generate shape for a given node */ shape(itemData: LkNodeData): OgmaNodeShape | undefined; /** * Generate size for a given node */ size(itemData: LkNodeData): number | undefined; /** * return the corresponding size to the value * @param value * @param rule * @param isLog */ static getAutomaticRangeSize(value: number, rule: StyleRule, isLog?: boolean): string | undefined; /** * Return an object containing all node attributes needed by Ogma to style a node */ all(itemData: LkNodeData): { radius?: number | undefined; color: Color | Array; shape?: OgmaNodeShape | undefined; icon?: IStyleIcon; image?: IStyleImage | null; }; /** * Return the value of the image url from a style rule or undefined * @param value * @param itemData * @param baseUrl */ static getImageUrlFromStyleRule(value: string | IImageDataValue | undefined, itemData: LkNodeData, baseUrl?: string): string | undefined; /** * Set the base url (it will be used for image url while styling nodes) * @param baseUrl bse url */ setBaseUrl(baseUrl?: string): void; }