summaryrefslogtreecommitdiff
path: root/ext/js/accessibility/accessibility-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 12:48:14 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 12:48:14 -0500
commit4da4827bcbcdd1ef163f635d9b29416ff272b0bb (patch)
treea8a0f1a8befdb78a554e1be91f2c6059ca3ad5f9 /ext/js/accessibility/accessibility-controller.js
parentfd6bba8a2a869eaf2b2c1fa49001f933fce3c618 (diff)
Add JSDoc type annotations to project (rebased)
Diffstat (limited to 'ext/js/accessibility/accessibility-controller.js')
-rw-r--r--ext/js/accessibility/accessibility-controller.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/js/accessibility/accessibility-controller.js b/ext/js/accessibility/accessibility-controller.js
index e9a24880..a4239947 100644
--- a/ext/js/accessibility/accessibility-controller.js
+++ b/ext/js/accessibility/accessibility-controller.js
@@ -28,15 +28,19 @@ export class AccessibilityController {
* @param {ScriptManager} scriptManager An instance of the `ScriptManager` class.
*/
constructor(scriptManager) {
+ /** @type {ScriptManager} */
this._scriptManager = scriptManager;
+ /** @type {?import('core').TokenObject} */
this._updateGoogleDocsAccessibilityToken = null;
+ /** @type {?Promise<void>} */
this._updateGoogleDocsAccessibilityPromise = null;
+ /** @type {boolean} */
this._forceGoogleDocsHtmlRenderingAny = false;
}
/**
* Updates the accessibility handlers.
- * @param {object} fullOptions The full options object from the `Backend` instance.
+ * @param {import('settings').Options} fullOptions The full options object from the `Backend` instance.
* The value is treated as read-only and is not modified.
*/
async update(fullOptions) {
@@ -53,8 +57,12 @@ export class AccessibilityController {
// Private
+ /**
+ * @param {boolean} forceGoogleDocsHtmlRenderingAny
+ */
async _updateGoogleDocsAccessibility(forceGoogleDocsHtmlRenderingAny) {
// Reentrant token
+ /** @type {?import('core').TokenObject} */
const token = {};
this._updateGoogleDocsAccessibilityToken = token;
@@ -72,6 +80,9 @@ export class AccessibilityController {
this._updateGoogleDocsAccessibilityPromise = null;
}
+ /**
+ * @param {boolean} forceGoogleDocsHtmlRenderingAny
+ */
async _updateGoogleDocsAccessibilityInner(forceGoogleDocsHtmlRenderingAny) {
if (this._forceGoogleDocsHtmlRenderingAny === forceGoogleDocsHtmlRenderingAny) { return; }
@@ -81,6 +92,7 @@ export class AccessibilityController {
try {
if (forceGoogleDocsHtmlRenderingAny) {
if (await this._scriptManager.isContentScriptRegistered(id)) { return; }
+ /** @type {import('script-manager').RegistrationDetails} */
const details = {
allFrames: true,
matchAboutBlank: true,