On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

overlay.registerOnCanOpen

API reference for the overlay.registerOnCanOpen method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Registers a callback that runs when the canOpen state of an overlay target changes.

Parameters

optsobjectRequired

Options for configuring the callback.

targetTargetRequired

The target to check the canOpen state of.

This must be "image_selection".

onCanOpenfunctionRequired

A callback that runs when the canOpen state of the specified target changes.

This callback fires immediately.

Parameters

eventOverlayOpenableEvent<Target>Required

Information about whether or not an overlay can be opened for the specified target.

Returns

void

Returns

() => void