setAttributes

Set the attributes of this node.

setAttributes(update: Partial<NodeClassToEditableAttributes[(typeof this)[ClassKey]]>): Promise<(typeof this)[ClassKey] extends "UnknownNode" ? never : typeof this | null

Attributes are merged with existing values, so only the provided attributes are updated.

Parameters

  • update: Partial<NodeClassToEditableAttributes[(typeof this)[ClassKey]]> – The attributes to update.

Returns

  • Promise<(typeof this)[ClassKey] extends "UnknownNode" ? never : typeof this | null> – The updated node, or null if the node was not found.