import { type Nullable } from "@onerjs/core/types.js"; import { ConnectionPointCompatibilityState } from "./connectionPointCompatibilityState.js"; import { ConnectionPointDirection } from "./connectionPointDirection.js"; import { type BaseBlock } from "../blockFoundation/baseBlock.js"; import { type ConnectionPointType, type ConnectionPointValue } from "./connectionPointType.js"; import { type StrongRef } from "../runtime/strongRef.js"; /** * This represents a strong reference to the data being passed through a connection point. */ export type RuntimeData = StrongRef>; /** * This defines a connection point. * * A connection point is any input/output of a block. * It can be linked to another connection point following some rules: * - The type of the connection point must be compatible with the other one. * - The direction of the connection point must be different from the other one. * - The connection cannot create a cycle in the list of blocks. * The relationship is always 1:N for input:output */ export declare class ConnectionPoint { /** * The name of the connection point. * This is used to identify the connection point inside a block. */ readonly name: string; /** * The type of the connection point (float, texture, etc.) */ readonly type: U; /** * The direction of the connection point (input or output) */ readonly direction: ConnectionPointDirection; /** * The smart filter block the connection point belongs to. */ readonly ownerBlock: BaseBlock; /** * User provided name for the connection point. */ displayName: Nullable; /** * The @see RunTimeData used during the init phase to reference the result of the previous block. * Those are only used for input connection points. * The previous block are "pushing" this in during the init stage. */ runtimeData: Nullable>; /** * The default runtimeData used when no connection is made to the connection point. */ readonly defaultRuntimeData: Nullable>; private _connectedTo; private _endpoints; /** * Create a new connection point. * @param name - The name the connection point has in the block * @param ownerBlock - The block the connection point belongs to * @param type - The type of the connection point * @param direction - The direction of the connection point * @param defaultRuntimeData - The default runtime data to use when no connection is made to the connection point */ constructor(name: string, ownerBlock: BaseBlock, type: U, direction: ConnectionPointDirection, defaultRuntimeData?: Nullable>); /** * @returns The connection point this connection point is connected to. * (the one on the other side of the connection) * Only input connection points have a connected point which they received their value from. * (Relation is always 1:N for input:output) */ get connectedTo(): Nullable>; /** * @returns The connection points this output connection point is connected to. * (the ones on the other side of the connection) * Only output connection points have a list of endpoints which they provide their value to. * (Relation is always 1:N for input:output) */ get endpoints(): ReadonlyArray>; /** * Gets a state indicating if the current point can be connected to another point * @param other - defines the other connection point * @returns the compatibility state */ checkCompatibilityState(other: ConnectionPoint): ConnectionPointCompatibilityState; /** * Checks if the connection point can be connected to another one. * @param connectionPoint - The other connection point to check compatibility with * @returns true if the connection point can be connected to the other one */ canConnectTo(connectionPoint: ConnectionPoint): boolean; /** * Connect this connection point to another one. * @param other - The other connection point to connect to * @throws if the connection point cannot be connected to the other one */ connectTo(other: ConnectionPoint): void; /** * Disconnects this point from one of his endpoint * @param endpoint - defines the other connection point */ disconnectFrom(endpoint: ConnectionPoint): void; /** * Disconnects this point from all its endpoints. */ disconnectAllEndpoints(): void; /** * Propagates the current runtime data to all endpoints. */ propagateRuntimeData(): void; } //# sourceMappingURL=connectionPoint.d.ts.map