API for rete-connection-reroute-plugin package - Rete.js

API for rete-connection-reroute-plugin package

RerouteProduces

index.ts

Signal types produced by the plugin

ts
type RerouteProduces =
  | { data: Object; type: "pintranslated" }
  | { data: Object; type: "pinselected" }
  | { data: Object; type: "pinunselected" };

ReroutePlugin

index.ts

Reroute plugin

ts
class ReroutePlugin<Schemes extends BaseSchemes>
ParameterExtendsDescription
SchemesBaseSchemes

Extends Scope<RerouteProduces, Requires, BaseArea | RerouteExtra>

Emits pintranslated pinselected pinunselected

Listens rendered unmount reordered connectionpath pointerdown

add

index.ts

Add a new pin to the connection

ts
add(connectionId: string, position: Position, index: number): void
ParameterTypeDescription
connectionIdstringConnection id
positionPositionPin position
indexnumberPin index, if not specified, the pin will be added to the end

Returns void

remove

index.ts

Remove pin

ts
remove(pinId: string): Promise<void>
ParameterTypeDescription
pinIdstringPin id

Returns Promise<void>

select

index.ts

Select pin

ts
select(pinId: string): Promise<void>
ParameterTypeDescription
pinIdstringPin id

Returns Promise<void>

translate

index.ts

Translate pin

ts
translate(pinId: string, dx: number, dy: number): Promise<void>
ParameterTypeDescription
pinIdstringPin id
dxnumberDelta x
dynumberDelta y

Returns Promise<void>

unselect

index.ts

Unselect pin

ts
unselect(pinId: string): Promise<void>
ParameterTypeDescription
pinIdstringPin id

Returns Promise<void>

update

index.ts

Update connection for the pin

ts
update(pin: string | PinStorageRecord): void
ParameterTypeDescription
pin`stringPinStorageRecord`

Returns void

RerouteExtensions

extensions/index.ts

Extensions for the connection reroute plugin

selectablePins

extensions/selectable.ts

Enables synchronization between pins and the selector

ts
selectablePins(reroutePlugin: ReroutePlugin<S>, selector: Selector<SelectorEntity>, accumulating: { active: unknown }): void

Listens pinselected pinunselected pintranslated

ParameterTypeDescription
reroutePluginReroutePlugin<S>Reroute plugin instance
selectorSelector<SelectorEntity>Selector instance
accumulating{ active: unknown }Accumulating state

Returns void

RerouteExtra

index.ts

Signal types consumed by the plugin

ts
type RerouteExtra =
  | RenderSignal<"reroute-pins", { data: PinData }>
  | { data: Object; type: "unmount" };