import { EmptySubgraphInput } from './EmptySubgraphInput'; import { EmptySubgraphOutput } from './EmptySubgraphOutput'; import { Subgraph } from './Subgraph'; import { SubgraphInput } from './SubgraphInput'; import { SubgraphOutput } from './SubgraphOutput'; import { LinkConnector } from '../canvas/LinkConnector'; import { DefaultConnectionColors, Hoverable, INodeInputSlot, INodeOutputSlot, Point, Positionable } from '../interfaces'; import { NodeId } from '../LGraphNode'; import { ExportedSubgraphIONode, Serialisable } from '../types/serialisation'; import { Rectangle } from '../infrastructure/Rectangle'; import { CanvasColour, CanvasPointer, CanvasPointerEvent } from '../litegraph'; import { CanvasItem } from '../types/globalEnums'; export declare abstract class SubgraphIONodeBase implements Positionable, Hoverable, Serialisable { #private; /** The subgraph that this node belongs to. */ readonly subgraph: Subgraph; static margin: number; static minWidth: number; static roundedRadius: number; abstract readonly id: NodeId; get boundingRect(): Rectangle; selected: boolean; pinned: boolean; readonly removable = false; isPointerOver: boolean; abstract readonly emptySlot: EmptySubgraphInput | EmptySubgraphOutput; get pos(): Point; set pos(value: Point); get size(): import('../interfaces').Size; set size(value: import('../interfaces').Size); protected get sideLineWidth(): number; protected get sideStrokeStyle(): CanvasColour; abstract readonly slots: TSlot[]; abstract get allSlots(): TSlot[]; constructor( /** The subgraph that this node belongs to. */ subgraph: Subgraph); move(deltaX: number, deltaY: number): void; /** @inheritdoc */ snapToGrid(snapTo: number): boolean; abstract onPointerDown(e: CanvasPointerEvent, pointer: CanvasPointer, linkConnector: LinkConnector): void; containsPoint(point: Point): boolean; abstract get slotAnchorX(): number; onPointerMove(e: CanvasPointerEvent): CanvasItem; onPointerEnter(): void; onPointerLeave(): void; /** * Renames an IO slot in the subgraph. * @param slot The slot to rename. * @param name The new name for the slot. */ abstract renameSlot(slot: TSlot, name: string): void; /** * Removes an IO slot from the subgraph. * @param slot The slot to remove. */ abstract removeSlot(slot: TSlot): void; /** * Gets the slot at a given position in canvas space. * @param x The x coordinate of the position. * @param y The y coordinate of the position. * @returns The slot at the given position, otherwise `undefined`. */ getSlotInPosition(x: number, y: number): TSlot | undefined; /** * Shows the context menu for an IO slot. * @param slot The slot to show the context menu for. * @param event The event that triggered the context menu. */ protected showSlotContextMenu(slot: TSlot, event: CanvasPointerEvent): void; /** Arrange the slots in this node. */ arrange(): void; draw(ctx: CanvasRenderingContext2D, colorContext: DefaultConnectionColors, fromSlot?: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput, editorAlpha?: number): void; /** @internal Leaves {@link ctx} dirty. */ protected abstract drawProtected(ctx: CanvasRenderingContext2D, colorContext: DefaultConnectionColors, fromSlot?: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput, editorAlpha?: number): void; /** @internal Leaves {@link ctx} dirty. */ protected drawSlots(ctx: CanvasRenderingContext2D, colorContext: DefaultConnectionColors, fromSlot?: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput, editorAlpha?: number): void; configure(data: ExportedSubgraphIONode): void; asSerialisable(): ExportedSubgraphIONode; }