Skip to content

Commit

Permalink
Events to promises (#104)
Browse files Browse the repository at this point in the history
* replaced event-centric signaling for a Promise-based one in author-specified action circumstances.

* Shifted the section, added to TOC
  • Loading branch information
zachernuk authored Dec 23, 2024
1 parent 810e556 commit 1bac4fc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [Fallback content](#fallback-content)
- [DOM API](#dom-api)
- [JavaScript API](#javascript-api)
- [Resource Promises](#resource-promises)
- [DOM Events](#dom-events)
- [DOM Actions](#dom-actions)
- [Visual presentation control](#visual-presentation-control)
Expand Down Expand Up @@ -242,6 +243,18 @@ when playback has been successfully started.
* `pause()`: A method that attempts to pause the playback of a model's animation. If the model is already paused
this method will have no effect.

## Resource Promises

* `ready`: Resolved when the model's source file has been loaded and processed, such that the
bounding box information is available and the animation duration, if present, is known. The
Promise is rejected if the source file is unable to be fetched, or if the file
cannot be interpreted as a valid `<model>` asset.

* `environmentMapReady`: Resolved when a model's selected environment map has been loaded and is
ready to contribute to the visual appearance of the model. The Promise is rejected if there has
been an issue with the model's selected environment map that will prevent its ability to act as
the lighting environment.

## DOM Events

While the author may prevent any built-in interactive behavior for a `<model>` by ommitting the `stagemode`
Expand All @@ -254,15 +267,6 @@ method when handling the `pointerdown` event. If this method is not called for t

The `mousedown` and `touchstart` compatibility events may also be used for this purpose.

* `load`: Dispatched when the model's source file has been loaded and processed, such that the
bounding box information is available and the animation duration, if present, is known.
* `error`: Dispatched if the the model's source file is unable to be fetched, or if the file
cannot be interpreted as a valid `<model>` asset.
* `iblload`: Dispatched when a model's selected environmentmap has been loaded and is ready to
contribute to the visual appearance of the model.
* `iblerror`: Dispatched if there has been an issue with the model's selected environmentmap,
which will prevent its ability to act as the lighting environment.

### DOM actions

In addition to being a standard DOM element, special behaviors may be desirable on spatial platforms,
Expand Down

0 comments on commit 1bac4fc

Please sign in to comment.