From 1bac4fcb70ed1cf2510604c69ed3ab6a6939f313 Mon Sep 17 00:00:00 2001 From: Brandel Zachernuk Date: Mon, 23 Dec 2024 15:05:21 -0800 Subject: [PATCH] Events to promises (#104) * replaced event-centric signaling for a Promise-based one in author-specified action circumstances. * Shifted the section, added to TOC --- explainer.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/explainer.md b/explainer.md index 973c67e..b9db31e 100644 --- a/explainer.md +++ b/explainer.md @@ -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) @@ -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 `` 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 `` by ommitting the `stagemode` @@ -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 `` 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,