import { ColorOption, IColorable, IContextMenuValue, IPinnable, Point, Positionable, Size } from './interfaces'; import { LGraph } from './LGraph'; import { ISerialisedGroup } from './types/serialisation'; import { LGraphCanvas } from './LGraphCanvas'; import { LGraphNode } from './LGraphNode'; export interface IGraphGroupFlags extends Record { pinned?: true; } export declare class LGraphGroup implements Positionable, IPinnable, IColorable { static minWidth: number; static minHeight: number; static resizeLength: number; static padding: number; static defaultColour: string; id: number; color?: string; title: string; font?: string; font_size: number; _bounding: Float32Array; _pos: Point; _size: Size; /** @deprecated See {@link _children} */ _nodes: LGraphNode[]; _children: Set; graph?: LGraph; flags: IGraphGroupFlags; selected?: boolean; constructor(title?: string, id?: number); /** @inheritdoc {@link IColorable.setColorOption} */ setColorOption(colorOption: ColorOption | null): void; /** @inheritdoc {@link IColorable.getColorOption} */ getColorOption(): ColorOption | null; /** Position of the group, as x,y co-ordinates in graph space */ get pos(): Point; set pos(v: Point); /** Size of the group, as width,height in graph units */ get size(): Size; set size(v: Size); get boundingRect(): Float32Array; get nodes(): LGraphNode[]; get titleHeight(): number; get children(): ReadonlySet; get pinned(): boolean; /** * Prevents the group being accidentally moved or resized by mouse interaction. * Toggles pinned state if no value is provided. */ pin(value?: boolean): void; unpin(): void; configure(o: ISerialisedGroup): void; serialize(): ISerialisedGroup; /** * Draws the group on the canvas * @param graphCanvas * @param ctx */ draw(graphCanvas: LGraphCanvas, ctx: CanvasRenderingContext2D): void; resize(width: number, height: number): boolean; move(deltaX: number, deltaY: number, skipChildren?: boolean): void; /** @inheritdoc */ snapToGrid(snapTo: number): boolean; recomputeInsideNodes(): void; /** * Resizes and moves the group to neatly fit all given {@link objects}. * @param objects All objects that should be inside the group * @param padding Value in graph units to add to all sides of the group. Default: 10 */ resizeTo(objects: Iterable, padding?: number): void; /** * Add nodes to the group and adjust the group's position and size accordingly * @param nodes The nodes to add to the group * @param padding The padding around the group */ addNodes(nodes: LGraphNode[], padding?: number): void; getMenuOptions(): (IContextMenuValue | IContextMenuValue | null)[]; isPointInTitlebar(x: number, y: number): boolean; isInResize(x: number, y: number): boolean; isPointInside: (x: number, y: number) => boolean; setDirtyCanvas: (dirty_foreground: boolean, dirty_background?: boolean) => void; }