Registers a callback that runs when the specified type of content is selected.
This callback fires immediately if content is already selected when the callback is registered.
Parameters
Options for configuring the content selection callback.
Properties of opts
The callback to run when the selected content changes.
Parameters
Information about the selection change event.
Properties of event
The number of selected elements.
Returns a snapshot of the content in the user's selection.
The snapshot is known as the draft.
Returns
A snapshot of content from a user's design. This is a Promise
that resolves with the following object:
The individual content items that exist within the snapshot.
Any changes made to this array won't be reflected in the user's design until the save
method is called.
Saves changes made to the content items in the contents
array.
Once this method is called:
- Any changes the app has made to to the content will be reflected in the user's design.
- Any changes the user has made to the content since the snapshot was created may be overwritten.
- Only properties that are different from the original state will be written to the design.
Returns
Promise<void>
The type of content that's selected.
The available options include:
"plaintext"
"image"
"video"
"richtext"
Returns
void
The type of content that triggers a selection change event.
The available options include:
"plaintext"
"image"
"video"
"richtext"
Returns
() => void