import type { GraphElement, StandardShapesTypeMapper } from '../types/element-types'; import type { GraphLink, StandardLinkShapesType } from '../types/link-types'; type RequiredElementProps = { width: number; height: number; }; type ElementWithAttributes = T extends keyof StandardShapesTypeMapper ? { type?: T; attrs?: StandardShapesTypeMapper[T]; } : { type?: undefined; attrs?: StandardShapesTypeMapper['react']; }; /** * Create elements helper function. * @group Utils * @param items - Array of elements to create. * @returns Array of elements. (Nodes) * @example * without custom data * ```ts * const elements = createElements([ * { id: '1', type: 'rect', x: 10, y: 10, width: 100, height: 100 }, * { id: '2', type: 'circle', x: 200, y: 200, width: 100, height: 100 }, * ]); * ``` * @example * with custom data * ```ts * const elements = createElements([ * { id: '1', type: 'rect', x: 10, y: 10 ,data : { label: 'Node 1' }, width: 100, height: 100 }, * { id: '2', type: 'circle', x: 200, y: 200, data : { label: 'Node 2' }, width: 100, height: 100 }, * ]); * ``` */ export declare function createElements(items: Array>): Array; /** * Infer element based on typeof createElements * @group Utils * @example * ```ts * const elements = createElements([ * { id: '1', type: 'rect', x: 10, y: 10 ,data : { label: 'Node 1' }, width: 100, height: 100 }, * { id: '2', type: 'circle', x: 200, y: 200, data : { label: 'Node 2' }, width: 100, height: 100 }, * ]); * * type BaseElementWithData = InferElement; * ``` */ export type InferElement>> = T[number]; /** * Create links helper function. * @group Utils * @param data - Array of links to create. * @returns Array of links. (Edges) * @example * ```ts * const links = createLinks([ * { id: '1', source: '1', target: '2' }, * { id: '2', source: '2', target: '3' }, * ]); * ``` */ export declare function createLinks, Type extends StandardLinkShapesType | string = 'standard.Link'>(data: Array>): Array; export {};