Skip to content

ModelAdapter

Interface for model adapters that handle the data management of a flow diagram

destroy(): void

Destroy the model adapter and clean up resources This should be called when the model is no longer needed to prevent memory leaks

void


getEdges(): Edge<object>[]

Get all edges in the model

Edge<object>[]


getMetadata(): Metadata

Get metadata associated with the model

Metadata


getNodes(): Node[]

Get all nodes in the model

Node[]


onChange(callback): void

Register a callback to be called when the model changes

(__namedParameters) => void

Function to be called on changes

void


redo(): void

Redo the last undone change

void


toJSON(): string

Convert the model to a JSON string

string


undo(): void

Undo the last change

void


unregisterOnChange(callback): void

Unregister a callback from being called when the model changes

(__namedParameters) => void

Function to unregister from changes

void


updateEdges(edges): void

Update edges in the model

Edge<object>[]

Array of edges to set

void


updateMetadata(metadata): void

Set metadata for the model

Metadata

Metadata to set

void


updateNodes(nodes): void

Update nodes in the model

Node[]

Array of nodes to set

void