import { SubgraphInput } from './SubgraphInput'; import { SubgraphInputNode } from './SubgraphInputNode'; import { SubgraphOutput } from './SubgraphOutput'; import { SubgraphOutputNode } from './SubgraphOutputNode'; import { DefaultConnectionColors, Hoverable, INodeInputSlot, INodeOutputSlot, Point, ReadOnlyRect, ReadOnlySize } from '../interfaces'; import { LGraphNode } from '../LGraphNode'; import { LinkId, LLink } from '../LLink'; import { RerouteId } from '../Reroute'; import { CanvasPointerEvent } from '../types/events'; import { Serialisable, SubgraphIO } from '../types/serialisation'; import { ConstrainedSize } from '../infrastructure/ConstrainedSize'; import { Rectangle } from '../infrastructure/Rectangle'; import { SlotBase } from '../node/SlotBase'; import { UUID } from '../utils/uuid'; export interface SubgraphSlotDrawOptions { ctx: CanvasRenderingContext2D; colorContext: DefaultConnectionColors; lowQuality?: boolean; fromSlot?: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput; editorAlpha?: number; } /** Shared base class for the slots used on Subgraph . */ export declare abstract class SubgraphSlot extends SlotBase implements SubgraphIO, Hoverable, Serialisable { #private; static get defaultHeight(): number; readonly measurement: ConstrainedSize; readonly id: UUID; readonly parent: SubgraphInputNode | SubgraphOutputNode; type: string; readonly linkIds: LinkId[]; readonly boundingRect: Rectangle; get pos(): Point; set pos(value: Point); /** Whether this slot is connected to another slot. */ get isConnected(): boolean; /** The display name of this slot. */ get displayName(): string; abstract get labelPos(): Point; constructor(slot: SubgraphIO, parent: SubgraphInputNode | SubgraphOutputNode); isPointerOver: boolean; containsPoint(point: Point): boolean; onPointerMove(e: CanvasPointerEvent): void; getLinks(): LLink[]; decrementSlots(inputsOrOutputs: "inputs" | "outputs"): void; measure(): ReadOnlySize; abstract arrange(rect: ReadOnlyRect): void; abstract connect(slot: INodeInputSlot | INodeOutputSlot, node: LGraphNode, afterRerouteId?: RerouteId): LLink | undefined; /** * Disconnects all links connected to this slot. */ disconnect(): void; /** * Checks if this slot is a valid target for a connection from the given slot. * @param fromSlot The slot that is being dragged to connect to this slot. * @returns true if the connection is valid, false otherwise. */ abstract isValidTarget(fromSlot: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput): boolean; /** @remarks Leaves the context dirty. */ draw({ ctx, colorContext, lowQuality, fromSlot, editorAlpha }: SubgraphSlotDrawOptions): void; asSerialisable(): SubgraphIO; }