Skip to main content
Solved

Extension API: hook into deleted shape or line?

  • March 7, 2026
  • 4 replies
  • 29 views

Forum|alt.badge.img+5

Team Lucid,
I am aware we can hook selection.  Is it possible to hook into the user has deleted a shape or line?

Thanks,

Dan

Best answer by Kyler G

Hello,
I believe you want `hookDeleteItems`. This can be found on the document proxy. Reference here.

It would look like this:

// Hook into delete events                                                                                                                                                                  
const handle = this.client.document.hookDeleteItems((itemIds: string[]) => {
console.log('Deleted item IDs:', itemIds);
// Do something with the deleted item IDs
});

// Later, when you want to stop listening:
this.client.document.unhookDeleteItems(handle);

 

Comments

aparrish
Lucid Legend Level 7
Forum|alt.badge.img+15
  • Lucid Legend Level 7
  • March 8, 2026

@quodsimDan do you mean “if”? Here’s the link to Lucid’s API developer document: https://developer.lucid.co/reference/overview#import-document

I hope you can find an answer to your question there!


Forum|alt.badge.img+5
  • Author
  • March 9, 2026

I have read the extension api extensively I dont anything related to ‘if’ the user deletes.


Kyler G
Forum|alt.badge.img+2
  • Lucid product team
  • Answer
  • March 9, 2026

Hello,
I believe you want `hookDeleteItems`. This can be found on the document proxy. Reference here.

It would look like this:

// Hook into delete events                                                                                                                                                                  
const handle = this.client.document.hookDeleteItems((itemIds: string[]) => {
console.log('Deleted item IDs:', itemIds);
// Do something with the deleted item IDs
});

// Later, when you want to stop listening:
this.client.document.unhookDeleteItems(handle);

 


Forum|alt.badge.img+5
  • Author
  • March 10, 2026

that is exactly what I am looking for!  I sorry I missed it!