Skip to main content

Interface: IConnectionPreviewer

Defined in: packages/blockly/core/interfaces/i_connection_previewer.ts:14

Displays visual "previews" of where a block will be connected if it is dropped.

Methods index​

MethodDescription
previewReplacementDisplay a connection preview where the draggedCon connects to the staticCon, replacing the replacedBlock (currently connected to the staticCon).
previewConnectionDisplay a connection preview where the draggedCon connects to the staticCon, and no block is being relaced.
hidePreviewHide any previews that are currently displayed.
disposeDispose of any references held by this connection previewer.

Methods​

previewReplacement()​

previewReplacement(
draggedConn,
staticConn,
replacedBlock
): void;

Defined in: packages/blockly/core/interfaces/i_connection_previewer.ts:26

Display a connection preview where the draggedCon connects to the staticCon, replacing the replacedBlock (currently connected to the staticCon).

Parameters​

ParameterTypeDescription
draggedConnRenderedConnection-
staticConnRenderedConnection-
replacedBlockBlockSvgThe block currently connected to the staticCon that is being replaced.

Returns​

void


previewConnection()​

previewConnection(draggedConn, staticConn): void;

Defined in: packages/blockly/core/interfaces/i_connection_previewer.ts:40

Display a connection preview where the draggedCon connects to the staticCon, and no block is being relaced.

Parameters​

ParameterType
draggedConnRenderedConnection
staticConnRenderedConnection

Returns​

void


hidePreview()​

hidePreview(): void;

Defined in: packages/blockly/core/interfaces/i_connection_previewer.ts:46

Hide any previews that are currently displayed.

Returns​

void


dispose()​

dispose(): void;

Defined in: packages/blockly/core/interfaces/i_connection_previewer.ts:49

Dispose of any references held by this connection previewer.

Returns​

void