SelectionSetEvent Type alias

Payload sent to SelectionSet.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");
 }

SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent

Defined in

Last Updated: 23 April, 2020