feat: detect image events on paste with ctrl +v or command v#520
feat: detect image events on paste with ctrl +v or command v#520tyrellshawn wants to merge 9 commits intoanomalyco:mainfrom
Conversation
|
I think we currently have paste detection in a few places - including in opencode repo. How does this differ to that? |
|
@Hona I told them that I want to provide that on a library level, as apps would have to re-implement that and pasting binary data like images seems quite common. |
|
|
||
| export class PasteEvent { | ||
| text: string | ||
| data: Buffer |
There was a problem hiding this comment.
I wonder if the PasteEvent should maybe only have data and we drop text as for large pastes like images it would always toString duplicate the data, while consumers of the paste event can do the toString when it is actually text content and not a file?
There was a problem hiding this comment.
I agree but how would we define the data interface. As long as we know it can do toString we are good? I feel like having a getFileType method in the interface would be good too?
There was a problem hiding this comment.
Just as data: Buffer? The PasteEvent has the optional fileType.
|
@kommander any updates needed from me? |
Generated with codex (since anthropic is playing unfair currently). Tested using the examples but havent done any integration tests with opencode yet.