Refresh `DataTransfer` API
armanbilge opened this issue · 4 comments
I think there are some changes. Also it can use the new FrozenArray
type.
https://html.spec.whatwg.org/multipage/dnd.html#datatransfer
I have a question concerning effectAllowed
and dropEffect
. They return enums form the spec
The dropEffect attribute controls the drag-and-drop feedback that the user is given during a drag-and-drop operation. When the DataTransfer object is created, the dropEffect attribute is set to a string value. On getting, it must return its current value. On setting, if the new value is one of "none", "copy", "link", or "move", then the attribute's current value must be set to the new value. Other values must be ignored.
The effectAllowed attribute is used in the drag-and-drop processing model to initialize the dropEffect attribute during the dragenter and dragover events. When the DataTransfer object is created, the effectAllowed attribute is set to a string value. On getting, it must return its current value. On setting, if drag data store's mode is the read/write mode and the new value is one of "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", or "uninitialized", then the attribute's current value must be set to the new value. Otherwise it must be left unchanged.
But how do I name these things lol, EffectAllowedTypes
and DropEffectTypes
? or Kinds
instead of types?
Hmmm 😂 I see TypeScript is no help here.
erm ... IDK. DropEffectOperation
? but EffectAllowedOperation
seems weird.
I wonder if just DropEffect
and EffectAllowed
could be okay.
DropEffectValue
and EffectAllowedValue
?
I'm also okay with DropEffect
and EffectAllowed
!
/shrug if you don't mind open the PR with anything and then let me bikeshed it for 6 months 😛