@graphty/graphty-element / ai / CommandContext
Interface: CommandContext ​
Defined in: graphty-element/src/ai/commands/types.ts:31
Context provided to command execution.
Properties ​
abortSignal ​
abortSignal:
AbortSignal
Defined in: graphty-element/src/ai/commands/types.ts:45
Fires when the message is cancelled, or undone while it is still going. A command stops on it: once it has fired, every tx call rejects.
emitEvent ​
emitEvent: (
type,data) =>void
Defined in: graphty-element/src/ai/commands/types.ts:47
Function to emit events
Parameters ​
type ​
string
data ​
unknown
Returns ​
void
graph ​
graph:
Graph
Defined in: graphty-element/src/ai/commands/types.ts:33
The graph instance to operate on
tx ​
tx:
TransactionScope
Defined in: graphty-element/src/ai/commands/types.ts:40
The message's transaction. Everything a command changes through tx -- tx.styles.add, tx.layout.set, tx.run -- joins the message's one undoable step, and is rolled back with the rest of the message when a command throws. A change made through graph instead is a step of its own and is not rolled back.
updateStatus ​
updateStatus: (
updates) =>void
Defined in: graphty-element/src/ai/commands/types.ts:49
Function to update AI status
Parameters ​
updates ​
Partial<AiStatus>
Returns ​
void