SelectionSetEvent Type

SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent

Payload sent to onChanged event listeners to describe how the contents of the set have changed. The type property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:

processSelectionSetEvent(ev: SelectionSetEvent): void {
  if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)
    console.log("Added " + ev.added.size + " elements");

  if (SelectionSetEventType.Add !== ev.type)
    console.log("Removed " + ev.removed.size + " elements");
}

Defined in

Last Updated: 17 December, 2024